enju_biblio 0.1.0.pre36 → 0.1.0.pre37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/scaffold.css +56 -0
  3. data/app/controllers/manifestations_controller.rb +18 -22
  4. data/app/controllers/series_statements_controller.rb +6 -35
  5. data/app/models/enju_biblio/ability.rb +2 -4
  6. data/app/models/manifestation.rb +75 -92
  7. data/app/models/series_statement.rb +13 -18
  8. data/app/views/manifestations/_edit_detail.html.erb +10 -0
  9. data/app/views/manifestations/_form.html.erb +49 -34
  10. data/app/views/manifestations/_manifestation.html.erb +2 -12
  11. data/app/views/manifestations/_show_detail_librarian.html.erb +3 -33
  12. data/app/views/manifestations/_show_detail_user.html.erb +3 -18
  13. data/app/views/manifestations/_show_parent.html.erb +0 -12
  14. data/app/views/manifestations/_show_series_detail.html.erb +26 -0
  15. data/app/views/manifestations/show.html.erb +1 -27
  16. data/app/views/series_statements/_form.html.erb +1 -1
  17. data/app/views/series_statements/_index.html.erb +3 -11
  18. data/app/views/series_statements/show.html.erb +22 -30
  19. data/config/locales/translation_en.yml +2 -0
  20. data/config/locales/translation_ja.yml +2 -0
  21. data/config/routes.rb +3 -7
  22. data/db/migrate/005_create_manifestations.rb +4 -3
  23. data/db/migrate/20081028083142_create_patron_import_files.rb +1 -1
  24. data/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  25. data/lib/enju_biblio/biblio_helper.rb +1 -1
  26. data/lib/enju_biblio/version.rb +1 -1
  27. data/spec/controllers/import_requests_controller_spec.rb +1 -1
  28. data/spec/controllers/manifestations_controller_spec.rb +0 -6
  29. data/spec/controllers/series_statements_controller_spec.rb +4 -4
  30. data/spec/dummy/app/controllers/application_controller.rb +1 -0
  31. data/spec/dummy/app/models/ability.rb +2 -4
  32. data/spec/dummy/config/application.rb +1 -0
  33. data/spec/dummy/db/development.sqlite3 +0 -0
  34. data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
  35. data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
  36. data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
  37. data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
  38. data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
  39. data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +18 -0
  40. data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +16 -0
  41. data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
  42. data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
  43. data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
  44. data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
  45. data/spec/dummy/db/schema.rb +92 -9
  46. data/spec/dummy/db/test.sqlite3 +0 -0
  47. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  48. data/spec/dummy/solr/data/test/index/segments_l8s +0 -0
  49. data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
  50. data/spec/fixtures/manifestations.yml +66 -70
  51. data/spec/fixtures/series_statements.yml +1 -1
  52. data/spec/fixtures/subject_types.yml +28 -0
  53. data/spec/models/import_request_spec.rb +2 -0
  54. data/spec/models/manifestation_spec.rb +66 -70
  55. data/spec/models/series_statement_spec.rb +1 -0
  56. metadata +35 -37
  57. data/app/controllers/series_statement_relationships_controller.rb +0 -20
  58. data/app/models/series_statement_relationship.rb +0 -30
  59. data/app/views/series_statement_relationships/_form.html.erb +0 -27
  60. data/app/views/series_statement_relationships/edit.html.erb +0 -15
  61. data/app/views/series_statement_relationships/index.html.erb +0 -34
  62. data/app/views/series_statement_relationships/new.html.erb +0 -14
  63. data/app/views/series_statement_relationships/show.html.erb +0 -24
  64. data/app/views/series_statements/_index_parent.html.erb +0 -53
  65. data/app/views/series_statements/_manifestation_list.html.erb +0 -17
  66. data/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  67. data/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
  68. data/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
  69. data/db/migrate/20120728204337_create_series_statement_relationships.rb +0 -11
  70. data/spec/controllers/series_statement_relationships_controller_spec.rb +0 -179
  71. data/spec/dummy/solr/data/test/index/segments_iwe +0 -0
  72. data/spec/models/series_statement_relationship_spec.rb +0 -17
  73. data/spec/requests/series_statement_relationships_spec.rb +0 -11
  74. data/spec/routing/series_statement_relationships_routing_spec.rb +0 -35
  75. data/spec/views/series_statement_relationships/edit.html.erb_spec.rb +0 -20
  76. data/spec/views/series_statement_relationships/index.html.erb_spec.rb +0 -23
  77. data/spec/views/series_statement_relationships/new.html.erb_spec.rb +0 -20
  78. data/spec/views/series_statement_relationships/show.html.erb_spec.rb +0 -17
@@ -36,18 +36,8 @@
36
36
  <% end %>
37
37
  <% else %>
38
38
  <% case %>
39
- <% when @index_patron[:creator] %>
40
- <%= link_to t('page.add'), new_patron_create_path(@index_patron[:creator], :work_id => manifestation.id) unless manifestation.creators.include?(@index_patron[:creator]) -%>
41
- <% when @index_patron[:contributor] %>
42
- <%= link_to t('page.add'), new_patron_realize_path(@index_patron[:contributor], :expression_id => manifestation.id) unless manifestation.contributors.include?(@index_patron[:contributor]) -%>
43
- <% when @index_patron[:publisher] %>
44
- <%= link_to t('page.add'), new_patron_produce_path(@index_patron[:publisher], :manifestation_id => manifestation.id) unless manifestation.publishers.include?(@index_patron[:publisher]) -%>
45
- <% when @series_statement %>
46
- <% unless manifestation.series_statements.exists? -%>
47
- <%= link_to t('page.add'), new_manifestation_path(:parent_id => @series_statement.root_manifestation.id) if @series_statement.root_manifestation -%>
48
- <% end %>
49
- <% when @manifestation %>
50
- <%= link_to t('page.add'), new_manifestation_manifestation_relationship_path(@manifestation, :child_id => manifestation.id) unless @manifestation.derived_manifestations.include?(manifestation) or @manifestation == manifestation -%>
39
+ <% when @parent %>
40
+ <%= link_to t('page.add'), new_manifestation_manifestation_relationship_path(@parent, :child_id => manifestation.id) unless @parent.derived_manifestations.include?(manifestation) or @parent == manifestation -%>
51
41
  <% when @item %>
52
42
  <%= link_to t('page.change'), edit_exemplify_path(@item.exemplify, :manifestation_id => manifestation.id) unless @item.manifestation == manifestation -%>
53
43
  <% else %>
@@ -10,26 +10,15 @@
10
10
  <td style="width: 500px"><%= manifestation.title_alternative -%></td>
11
11
  </tr>
12
12
  <% end %>
13
- <%- if manifestation.series_statements.exists? -%>
14
13
  <tr>
15
14
  <td style="width: 200px"><%= t('activerecord.models.series_statement') -%>:</td>
16
15
  <td style="width: 500px">
17
- <ul>
18
- <% manifestation.series_statements.each do |series_statement| %>
19
- <% if series_statement.root_manifestation %>
20
- <li><%= link_to series_statement.original_title, series_statement.root_manifestation -%></li>
21
- <% else %>
22
- <li><%= series_statement.original_title -%></li>
23
- <% end %>
24
- <% end %>
25
- </ul>
26
- <%= manifestation.volume_number_string %>
16
+ <%= render 'show_series_detail', :manifestation => manifestation %>
27
17
  <%- if manifestation.issn.present? -%>
28
18
  (<%= t('activerecord.attributes.manifestation.issn') -%>: <%= manifestation.issn -%>)
29
19
  <%- end -%>
30
20
  </td>
31
21
  </tr>
32
- <% end %>
33
22
  <%= render 'edition_and_number', :manifestation => manifestation %>
34
23
  <tr>
35
24
  <td style="width: 200px"><%= t('page.form') -%>:</td>
@@ -60,27 +49,8 @@
60
49
  <td><%= manifestation.price -%></td>
61
50
  </tr>
62
51
  <% if defined?(EnjuSubject) %>
63
- <tr>
64
- <td><%= t('activerecord.models.subject') -%>:</td>
65
- <td>
66
- <%- unless manifestation.subjects.empty? -%>
67
- <ul>
68
- <%- manifestation.subjects.each do |subject| -%>
69
- <li>
70
- <%= link_to subject.term, subject -%>
71
- <%- unless subject.classifications.empty? -%>
72
- (
73
- <%- subject.classifications.each do |classification| -%>
74
- <%= classification.classification_type.name -%>: <%= link_to classification.category, classification -%>
75
- <%- end -%>
76
- )
77
- <%- end -%>
78
- </li>
79
- <%- end -%>
80
- </ul>
81
- <%- end -%>
82
- </td>
83
- </tr>
52
+ <%= render 'manifestations/subject_detail', :manifestation => manifestation %>
53
+ <%= render 'manifestations/classification_detail', :manifestation => manifestation %>
84
54
  <% end %>
85
55
  <%- unless manifestation.periodical? -%>
86
56
  <tr>
@@ -10,22 +10,15 @@
10
10
  <td style="width: 500px"><%= manifestation.title_alternative -%></td>
11
11
  </tr>
12
12
  <% end %>
13
- <%- if manifestation.series_statements.exists? -%>
14
13
  <tr>
15
14
  <td style="width: 200px"><%= t('activerecord.models.series_statement') -%>:</td>
16
15
  <td style="width: 500px">
17
- <ul>
18
- <% manifestation.series_statements.each do |series_statement| %>
19
- <li><%= link_to series_statement.original_title, series_statement -%></li>
20
- <% end %>
21
- </ul>
22
- <%= manifestation.volume_number_string %>
16
+ <%= render 'show_series_detail', :manifestation => manifestation %>
23
17
  <%- if manifestation.issn.present? -%>
24
18
  (<%= t('activerecord.attributes.manifestation.issn') -%>: <%= manifestation.issn -%>)
25
19
  <%- end -%>
26
20
  </td>
27
21
  </tr>
28
- <% end %>
29
22
  <%= render 'edition_and_number', :manifestation => manifestation %>
30
23
  <tr>
31
24
  <td style="width: 200px"><%= t('page.form') -%>:</td>
@@ -58,16 +51,8 @@
58
51
  </tr>
59
52
  <% end %>
60
53
  <% if defined?(EnjuSubject) %>
61
- <%- unless manifestation.subjects.empty? -%>
62
- <tr>
63
- <td><%= t('activerecord.models.subject') -%>:</td>
64
- <td>
65
- <%- manifestation.subjects.each do |subject| -%>
66
- <%= link_to subject.term, subject -%>
67
- <%- end -%>
68
- </td>
69
- </tr>
70
- <%- end -%>
54
+ <%= render 'manifestations/subject_detail', :manifestation => manifestation %>
55
+ <%= render 'manifestations/classification_detail', :manifestation => manifestation %>
71
56
  <% end %>
72
57
  <%- unless manifestation.periodical? -%>
73
58
  <tr>
@@ -3,22 +3,10 @@
3
3
  <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_transcription') -%></td>
4
4
  <td style="width: 490px"><%= @parent.title_transcription %></td>
5
5
  </tr>
6
- <tr>
7
- <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_subseries') -%></td>
8
- <td style="width: 490px"><%= @parent.root_series_statement.title_subseries %>
9
- <% if @parent.root_series_statement.title_subseries_transcription? %>
10
- (<%= @parent.root_series_statement.title_subseries_transcription %>)
11
- <% end %>
12
- </td>
13
- </tr>
14
6
  <tr>
15
7
  <td><%= t('activerecord.attributes.series_statement.series_master') -%></td>
16
8
  <td><%= localized_boolean(@parent.series_master?) %></td>
17
9
  </tr>
18
- <tr>
19
- <td><%= t('activerecord.attributes.series_statement.series_statement_identifier') -%></td>
20
- <td><%= @parent.root_series_statement.series_statement_identifier %></td>
21
- </tr>
22
10
  <tr>
23
11
  <td><%= t('activerecord.attributes.series_statement.note') -%></td>
24
12
  <td><%= @parent.note %></td>
@@ -0,0 +1,26 @@
1
+ <ul>
2
+ <% manifestation.original_manifestations.each do |m| %>
3
+ <li>
4
+ <%= link_to m.original_title, m %>
5
+ <% if can? :create, Manifestation and m.periodical? %>
6
+ (<%= link_to t('manifestation.add_next_issue'), new_manifestation_path(:parent_id => m.id) %>)
7
+ <% end %>
8
+ <% if m.series_statements.exists? %>
9
+ <ul>
10
+ <% m.series_statements.each do |s| %>
11
+ <li>
12
+ <%= s.original_title %>
13
+ <%= s.volume_number_string %>
14
+ </li>
15
+ <% end %>
16
+ </ul>
17
+ <% end %>
18
+ </li>
19
+ <% end %>
20
+ </ul>
21
+
22
+ <ul>
23
+ <% manifestation.series_statements.each do |series_statement| %>
24
+ <li><%= link_to series_statement.original_title, manifestations_path(:query => series_statement.original_title) %></li>
25
+ <% end %>
26
+ </ul>
@@ -73,33 +73,7 @@
73
73
  </ul>
74
74
 
75
75
  <%- if current_user.try(:has_role?, 'Librarian') -%>
76
- <ul>
77
- <li>
78
- <%- case when @expression -%>
79
- <%= link_to t('page.edit'), edit_expression_manifestation_path(@expression, @manifestation) -%>
80
- <%- when @patron -%>
81
- <%= link_to t('page.edit'), edit_publisher_manifestation_path(@patron, @manifestation) -%>
82
- <%- else -%>
83
- <%= link_to t('page.edit'), edit_manifestation_path(@manifestation) -%>
84
- <%- end -%>
85
- <ul>
86
- <li><%= link_to t('manifestation.edit_creator'), work_patrons_path(@manifestation) -%></li>
87
- <li><%= link_to t('manifestation.edit_contributor'), expression_patrons_path(@manifestation) -%></li>
88
- <li><%= link_to t('manifestation.edit_publisher'), manifestation_patrons_path(@manifestation) -%></li>
89
- <%- if @manifestation.periodical? -%>
90
- <li><%= link_to t('manifestation.add_next_issue'), new_series_statement_manifestation_path(@manifestation.root_series_statement) if @manifestation.root_series_statement -%></li>
91
- <%- end -%>
92
- </ul>
93
- </li>
94
- <% if can? :delete, @manifestation %>
95
- <li><%= link_to t('page.destroy'), @manifestation, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></li>
96
- <% end %>
97
- <li><%= link_to t('manifestation.add_derivation'), manifestation_manifestations_path(@manifestation, :mode => 'add') -%></li>
98
- <% if defined?(EnjuSubject) %>
99
- <li><%= link_to t('page.listing', :model => t('activerecord.models.subject')), work_subjects_path(@manifestation) -%></li>
100
- <% end %>
101
- <li><%= link_to t('manifestation.edit_item'), manifestation_items_path(@manifestation) -%></li>
102
- </ul>
76
+ <%= render 'manifestations/edit_detail' %>
103
77
  <% end %>
104
78
  </div>
105
79
  </div>
@@ -33,11 +33,11 @@
33
33
  <%= f.label :numbering_subseries -%><br />
34
34
  <%= f.text_field :numbering_subseries %>
35
35
  </div>
36
- -->
37
36
  <div class="field">
38
37
  <%= f.label :series_statement_identifier -%><br />
39
38
  <%= f.text_field :series_statement_identifier, :class => 'resource_identifier' %>
40
39
  </div>
40
+ -->
41
41
  <div class="field">
42
42
  <%= f.label :note -%><br />
43
43
  <%= f.text_area :note, :class => 'resource_textarea' -%>
@@ -17,7 +17,6 @@
17
17
  <th id="position"></th>
18
18
  <th><%= t('activerecord.attributes.series_statement.original_title') -%></th>
19
19
  <th></th>
20
- <th></th>
21
20
  </tr>
22
21
 
23
22
  <% @series_statements.each do |series_statement| %>
@@ -29,15 +28,6 @@
29
28
  </td>
30
29
  <td>
31
30
  <strong><%= link_to series_statement.original_title, series_statement %></strong>
32
- <% if series_statement.manifestation -%>
33
- <% if series_statement.manifestation.publishers.exists? %>
34
- <br />
35
- <%= patrons_list(series_statement.manifestation.publishers.readable_by(current_user)) %>
36
- <% end %>
37
- <% end %>
38
- </td>
39
- <td>
40
- <%= link_to t('page.new', :model => t('activerecord.models.manifestation')), new_series_statement_manifestation_path(series_statement) -%>
41
31
  </td>
42
32
  <td>
43
33
  <%= link_to t('page.edit'), edit_series_statement_path(series_statement) if can? :update, series_statement -%>
@@ -54,6 +44,8 @@
54
44
 
55
45
  <div id="submenu" class="ui-corner-all">
56
46
  <ul>
57
- <li><%= link_to t('page.new', :model => t('activerecord.models.series_statement')), new_series_statement_path -%></li>
47
+ <% if can? :create, SeriesStatement %>
48
+ <li><%= link_to t('page.new', :model => t('activerecord.models.series_statement')), new_series_statement_path -%></li>
49
+ <% end %>
58
50
  </ul>
59
51
  </div>
@@ -2,41 +2,33 @@
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.series_statement')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
5
+ <% if @series_statement.root_manifestation and @manifestation_ids %>
6
+ <%= render 'manifestations/paginate_id_link', :manifestation => @series_statement.root_manifestation , :manifestation_ids => @manifestation_ids %>
7
+ <% end %>
5
8
 
6
9
  <h2 class="resource_title">
7
10
  <%= @series_statement.original_title %>
11
+ <%= image_tag('icons/newspaper.png', :size => '16x16', :alt => t('manifestation.serial')) if @series_statement.periodical -%>
8
12
  </h2>
9
13
 
10
- <div id="tabs">
11
- <%= render 'tab_menu', :series_statement => @series_statement %>
12
- <div id="detail">
13
- <table class="table table-striped" id="resource_detail">
14
- <tr>
15
- <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_transcription') -%></td>
16
- <td style="width: 490px"><%= @series_statement.title_transcription %></td>
17
- </tr>
18
- <tr>
19
- <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_subseries') -%></td>
20
- <td style="width: 490px"><%= @series_statement.title_subseries %>
21
- <% if @series_statement.title_subseries_transcription? %>
22
- (<%= @series_statement.title_subseries_transcription %>)
23
- <% end %>
24
- </td>
25
- </tr>
26
- <tr>
27
- <td><%= t('activerecord.attributes.series_statement.series_statement_identifier') -%></td>
28
- <td><%= @series_statement.series_statement_identifier %></td>
29
- </tr>
30
- <tr>
31
- <td><%= t('activerecord.attributes.series_statement.note') -%></td>
32
- <td><%= @series_statement.note %></td>
33
- </tr>
34
- </table>
35
- </div>
36
- </div>
37
-
38
- <%= render 'series_statements/refine_search_form', :series_statement => @series_statement %>
39
- <%= render 'manifestation_list' -%>
14
+ <table id="resource_detail">
15
+ <tr>
16
+ <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_transcription') -%></td>
17
+ <td style="width: 490px"><%= @series_statement.title_transcription %></td>
18
+ </tr>
19
+ <tr>
20
+ <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_subseries') -%></td>
21
+ <td style="width: 490px"><%= @series_statement.title_subseries %>
22
+ <% if @series_statement.title_subseries_transcription? %>
23
+ (<%= @series_statement.title_subseries_transcription %>)
24
+ <% end %>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <td><%= t('activerecord.attributes.series_statement.note') -%></td>
29
+ <td><%= @series_statement.note %></td>
30
+ </tr>
31
+ </table>
40
32
  </div>
41
33
  </div>
42
34
 
@@ -82,6 +82,8 @@ en:
82
82
  series_statement_string: Series statement
83
83
  periodical: Periodical
84
84
  series_master: Series master
85
+ subject: Subject
86
+ classification: Classification
85
87
  item:
86
88
  call_number: Call number
87
89
  item_identifier: Item identifier
@@ -82,6 +82,8 @@ ja:
82
82
  series_statement_string: シリーズ情報
83
83
  periodical: 定期刊行物
84
84
  series_master: シリーズ情報マスタ
85
+ subject: 件名
86
+ classification: 分類
85
87
  item:
86
88
  call_number: 請求記号
87
89
  item_identifier: 所蔵情報ID
data/config/routes.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  Rails.application.routes.draw do
2
+ resources :people
3
+
4
+
2
5
  resources :manifestations do
3
6
  resources :patrons
4
7
  resources :produces
5
8
  resources :exemplifies
6
9
  resources :series_statements
7
- resources :series_has_manifestations
8
10
  resources :items
9
11
  resources :picture_files
10
12
  resources :manifestations
@@ -64,16 +66,10 @@ Rails.application.routes.draw do
64
66
 
65
67
  resources :donates
66
68
 
67
- resources :series_has_manifestations
68
-
69
69
  resources :series_statements do
70
70
  resources :manifestations
71
- resources :series_has_manifestations
72
- resources :series_statement_relationships
73
71
  end
74
72
 
75
- resources :series_statement_relationships
76
-
77
73
  resources :countries
78
74
  resources :languages
79
75
  resources :form_of_works
@@ -28,9 +28,9 @@ class CreateManifestations < ActiveRecord::Migration
28
28
  t.string :issn
29
29
  t.integer :price # TODO: 通貨単位
30
30
  t.text :fulltext
31
- t.string :volume_number_list
32
- t.string :issue_number_list
33
- t.string :serial_number_list
31
+ t.string :volume_number_string
32
+ t.string :issue_number_string
33
+ t.string :serial_number_string
34
34
  t.integer :edition
35
35
  t.text :note
36
36
  t.boolean :repository_content, :default => false, :null => false
@@ -52,5 +52,6 @@ class CreateManifestations < ActiveRecord::Migration
52
52
  #add_index :manifestations, :frequency_id
53
53
  add_index :manifestations, :manifestation_identifier
54
54
  add_index :manifestations, :updated_at
55
+ add_index :manifestations, :date_of_publication
55
56
  end
56
57
  end
@@ -6,7 +6,7 @@ class CreatePatronImportFiles < ActiveRecord::Migration
6
6
  t.integer :size
7
7
  t.integer :user_id
8
8
  t.text :note
9
- t.datetime :imported_at
9
+ t.datetime :executed_at
10
10
  t.string :state
11
11
  t.string :patron_import_file_name
12
12
  t.string :patron_import_content_type
@@ -6,7 +6,7 @@ class CreateResourceImportFiles < ActiveRecord::Migration
6
6
  t.integer :size
7
7
  t.integer :user_id
8
8
  t.text :note
9
- t.datetime :imported_at
9
+ t.datetime :executed_at
10
10
  t.string :state
11
11
  t.string :resource_import_file_name
12
12
  t.string :resource_import_content_type
@@ -51,7 +51,7 @@ module EnjuBiblio
51
51
  if options[:nolink]
52
52
  patrons_list = patrons.map{|patron| patron.full_name}
53
53
  else
54
- patrons_list = patrons.map{|patron| link_to(patron.full_name, patron, options)}
54
+ patrons_list = patrons.map{|patron| link_to(patron.full_name, manifestations_path(:query => patron.full_name), options)}
55
55
  end
56
56
  patrons_list.join(" ").html_safe
57
57
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.1.0.pre36"
2
+ VERSION = "0.1.0.pre37"
3
3
  end
@@ -171,7 +171,7 @@ describe ImportRequestsController do
171
171
  describe "with valid params", :vcr => true do
172
172
  it "assigns a newly created import_request as @import_request" do
173
173
  post :create, :import_request => @attrs
174
- assigns(:import_request).should be_valid
174
+ assigns(:import_request).manifestation.save! #should be_valid
175
175
  end
176
176
 
177
177
  it "redirects to the created import_request" do
@@ -118,12 +118,6 @@ describe ManifestationsController do
118
118
  assigns(:manifestations).collect(&:id).should eq assigns(:manifestation).derived_manifestations.collect(&:id)
119
119
  end
120
120
 
121
- it "should get index with publisher_id" do
122
- get :index, :publisher_id => 1
123
- response.should be_success
124
- assigns(:manifestations).collect(&:id).should eq Patron.find(1).manifestations.order('created_at DESC').collect(&:id)
125
- end
126
-
127
121
  it "should get index with query" do
128
122
  get :index, :query => '2005'
129
123
  response.should be_success
@@ -55,7 +55,7 @@ describe SeriesStatementsController do
55
55
  series_statement = FactoryGirl.create(:series_statement)
56
56
  get :show, :id => series_statement.id
57
57
  assigns(:series_statement).should eq(series_statement)
58
- response.should redirect_to series_statement_manifestations_url(assigns(:series_statement))
58
+ response.should be_success
59
59
  end
60
60
  end
61
61
 
@@ -66,7 +66,7 @@ describe SeriesStatementsController do
66
66
  series_statement = FactoryGirl.create(:series_statement)
67
67
  get :show, :id => series_statement.id
68
68
  assigns(:series_statement).should eq(series_statement)
69
- response.should redirect_to series_statement_manifestations_url(assigns(:series_statement))
69
+ response.should be_success
70
70
  end
71
71
  end
72
72
 
@@ -77,7 +77,7 @@ describe SeriesStatementsController do
77
77
  series_statement = FactoryGirl.create(:series_statement)
78
78
  get :show, :id => series_statement.id
79
79
  assigns(:series_statement).should eq(series_statement)
80
- response.should redirect_to series_statement_manifestations_url(assigns(:series_statement))
80
+ response.should be_success
81
81
  end
82
82
  end
83
83
 
@@ -86,7 +86,7 @@ describe SeriesStatementsController do
86
86
  series_statement = FactoryGirl.create(:series_statement)
87
87
  get :show, :id => series_statement.id
88
88
  assigns(:series_statement).should eq(series_statement)
89
- response.should redirect_to series_statement_manifestations_url(assigns(:series_statement))
89
+ response.should be_success
90
90
  end
91
91
  end
92
92
  end
@@ -10,6 +10,7 @@ class ApplicationController < ActionController::Base
10
10
  enju_library
11
11
  enju_inventory
12
12
  enju_event
13
+ enju_subject
13
14
 
14
15
  private
15
16
  def render_403
@@ -36,8 +36,7 @@
36
36
  Realize,
37
37
  RealizeType,
38
38
  ResourceImportFile,
39
- SeriesStatement,
40
- SeriesStatementRelationship
39
+ SeriesStatement
41
40
  ]
42
41
  can :update, [
43
42
  ContentType,
@@ -95,8 +94,7 @@
95
94
  Produce,
96
95
  Realize,
97
96
  ResourceImportFile,
98
- SeriesStatement,
99
- SeriesStatementRelationship
97
+ SeriesStatement
100
98
  ]
101
99
  can :read, [
102
100
  CarrierType,
@@ -62,5 +62,6 @@ require 'enju_event'
62
62
  require 'enju_manifestation_viewer'
63
63
  require 'enju_export'
64
64
  require 'enju_ndl'
65
+ require 'enju_subject'
65
66
  require 'mobylette'
66
67
  require 'plugins'
Binary file
@@ -0,0 +1,27 @@
1
+ class CreateSubjects < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :subjects do |t|
4
+ t.integer :parent_id
5
+ t.integer :use_term_id
6
+ t.string :term
7
+ t.text :term_transcription
8
+ t.integer :subject_type_id, :null => false
9
+ t.text :scope_note
10
+ t.text :note
11
+ t.integer :required_role_id, :default => 1, :null => false
12
+ t.integer :lock_version, :default => 0, :null => false
13
+ t.datetime :created_at
14
+ t.datetime :updated_at
15
+ t.datetime :deleted_at
16
+ end
17
+ add_index :subjects, :term
18
+ add_index :subjects, :parent_id
19
+ add_index :subjects, :use_term_id
20
+ add_index :subjects, :subject_type_id
21
+ add_index :subjects, :required_role_id
22
+ end
23
+
24
+ def self.down
25
+ drop_table :subjects
26
+ end
27
+ end
@@ -0,0 +1,19 @@
1
+ class CreateClassifications < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :classifications do |t|
4
+ t.integer :parent_id
5
+ t.string :category, :null => false
6
+ t.text :note
7
+ t.integer :classification_type_id, :null => false
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :classifications, :parent_id
12
+ add_index :classifications, :category
13
+ add_index :classifications, :classification_type_id
14
+ end
15
+
16
+ def self.down
17
+ drop_table :classifications
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ class CreateClassificationTypes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :classification_types do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :classification_types
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateSubjectHeadingTypes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :subject_heading_types do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :subject_heading_types
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateSubjectTypes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :subject_types do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :subject_types
15
+ end
16
+ end