enju_biblio 0.1.0.pre34 → 0.1.0.pre35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/manifestations_controller.rb +29 -14
  3. data/app/models/manifestation.rb +30 -17
  4. data/app/models/page_sweeper.rb +1 -1
  5. data/app/models/series_statement.rb +3 -17
  6. data/app/views/manifestations/_form.html.erb +14 -3
  7. data/app/views/manifestations/_index_form_parent.html.erb +21 -0
  8. data/app/views/manifestations/_manifestation.html.erb +12 -12
  9. data/app/views/manifestations/_show_detail_librarian.html.erb +5 -1
  10. data/app/views/manifestations/_show_parent.html.erb +26 -0
  11. data/app/views/manifestations/_show_series_index.html.erb +1 -1
  12. data/app/views/manifestations/_show_series_statement.html.erb +2 -2
  13. data/app/views/manifestations/_submenu_parent.html.erb +8 -0
  14. data/app/views/manifestations/index.html.erb +6 -6
  15. data/app/views/series_statements/index.html.erb +1 -5
  16. data/config/locales/translation_en.yml +3 -0
  17. data/config/locales/translation_ja.yml +3 -0
  18. data/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
  19. data/lib/enju_biblio/version.rb +1 -1
  20. data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +44 -50
  21. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +44 -50
  22. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +43 -49
  23. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +43 -49
  24. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +43 -49
  25. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +43 -49
  26. data/spec/cassette_library/Manifestation/should_import_isbn.yml +3643 -0
  27. data/spec/dummy/app/models/ability.rb +4 -8
  28. data/spec/dummy/db/development.sqlite3 +0 -0
  29. data/spec/dummy/db/schema.rb +3 -12
  30. data/spec/dummy/db/test.sqlite3 +0 -0
  31. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  32. data/spec/dummy/solr/data/test/index/segments_iwe +0 -0
  33. data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
  34. data/spec/fixtures/manifestations.yml +11 -9
  35. data/spec/fixtures/series_statements.yml +15 -2
  36. data/spec/models/manifestation_spec.rb +3 -5
  37. data/spec/models/series_statement_spec.rb +1 -3
  38. metadata +10 -30
  39. data/app/controllers/series_has_manifestations_controller.rb +0 -101
  40. data/app/models/series_has_manifestation.rb +0 -35
  41. data/app/views/manifestations/_serial_form.html.erb +0 -14
  42. data/app/views/manifestations/_submenu_series_statement.html.erb +0 -9
  43. data/app/views/series_has_manifestations/_form.html.erb +0 -27
  44. data/app/views/series_has_manifestations/edit.html.erb +0 -15
  45. data/app/views/series_has_manifestations/index.html.erb +0 -34
  46. data/app/views/series_has_manifestations/new.html.erb +0 -14
  47. data/app/views/series_has_manifestations/show.html.erb +0 -23
  48. data/db/migrate/20110820131417_create_series_has_manifestations.rb +0 -13
  49. data/spec/controllers/series_has_manifestations_controller_spec.rb +0 -443
  50. data/spec/dummy/solr/data/test/index/segments_gs2 +0 -0
  51. data/spec/fixtures/series_has_manifestations.yml +0 -35
  52. data/spec/models/series_has_manifestation_spec.rb +0 -21
  53. data/spec/routing/series_has_manifestations_routing_spec.rb +0 -35
  54. data/spec/views/series_has_manifestations/edit.html.erb_spec.rb +0 -21
  55. data/spec/views/series_has_manifestations/index.html.erb_spec.rb +0 -31
  56. data/spec/views/series_has_manifestations/new.html.erb_spec.rb +0 -21
  57. data/spec/views/series_has_manifestations/show.html.erb_spec.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a61cbe1e5100da511b2e44411b7c45727ff50fc4
4
- data.tar.gz: fdbd62984455ea5e0786a4707bcd8be30e3e258b
3
+ metadata.gz: e09ac2727eecf6e8f78586e7481902fcfde867c3
4
+ data.tar.gz: 7aea3bf47c4098bf4f67aeda182da92e0ede6cbc
5
5
  SHA512:
6
- metadata.gz: 1ccb0b3ffd7d43dc350546820a2303b2a7619f85db19b634596437fb2913c93624e679ea241162abf6bffa72117568ed7aeaf18779ec873d90d946f8f64c7bc2
7
- data.tar.gz: 3f78f29acd4a0a7a25213fd42737d2ed476c912cea2f45a22b7aeb5d66ab11b93bf1e2c572e20ca36700d22e9c5a10b2e6d62e2cc600b5d16b73cd45c2fc7b61
6
+ metadata.gz: e77e8a3fb3d25d49a33f804c38c7eb2199b6892e90d57c30530981cca3c7bbc89533ae188ca1b0881ed953d5d9227b633f4348057695465bf318bc9633064f1f
7
+ data.tar.gz: 70266cae769bf9cae0a83b967966d17ad2f3dfa158be7aa247f3877ad4bebcf9fc5ea1ac00d29a1554783bfc96ed8bedba547e7522f45dbd3e5c79916857cd72
@@ -114,6 +114,7 @@ class ManifestationsController < ApplicationController
114
114
  @index_patron = patron
115
115
  manifestation = @manifestation if @manifestation
116
116
  series_statement = @series_statement if @series_statement
117
+ parent = @parent = Manifestation.where(:id => params[:parent_id]).first if params[:parent_id].present?
117
118
 
118
119
  if defined?(EnjuSubject)
119
120
  subject = @subject if @subject
@@ -126,6 +127,7 @@ class ManifestationsController < ApplicationController
126
127
  with(:publisher_ids).equal_to patron[:publisher].id if patron[:publisher]
127
128
  with(:original_manifestation_ids).equal_to manifestation.id if manifestation
128
129
  with(:series_statement_ids).equal_to series_statement.id if series_statement
130
+ with(:parent_ids).equal_to parent.id if parent
129
131
  end
130
132
  end
131
133
 
@@ -136,23 +138,26 @@ class ManifestationsController < ApplicationController
136
138
  if defined?(EnjuSubject)
137
139
  with(:subject_ids).equal_to subject.id if subject
138
140
  end
139
- if series_statement
140
- with(:series_master).equal_to false
141
- if series_statement.periodical?
141
+ unless parent
142
+ if params[:periodical].to_s.downcase == "true"
143
+ with(:series_master).equal_to true unless parent
144
+ with(:periodical).equal_to true
145
+ #if series_statement.periodical?
146
+ # if mode != 'add'
147
+ # order_by :volume_number, sort[:order]
148
+ # order_by :issue_number, sort[:order]
149
+ # order_by :serial_number, sort[:order]
150
+ # end
151
+ #else
152
+ # with(:periodical).equal_to false
153
+ #end
154
+ else
142
155
  if mode != 'add'
143
- order_by :volume_number, sort[:order]
144
- order_by :issue_number, sort[:order]
145
- order_by :serial_number, sort[:order]
146
- with(:periodical).equal_to true
156
+ with(:periodical).equal_to false
147
157
  end
148
- else
149
- with(:periodical).equal_to false
150
- end
151
- else
152
- if mode != 'add'
153
- with(:periodical).equal_to false
154
158
  end
155
159
  end
160
+ order_by sort[:sort_by], sort[:order] unless oai_search
156
161
  facet :reservable if defined?(EnjuCirculation)
157
162
  end
158
163
  search = make_internal_query(search)
@@ -377,7 +382,7 @@ class ManifestationsController < ApplicationController
377
382
  if @manifestation.series_master?
378
383
  flash.keep(:notice) if flash[:notice]
379
384
  flash[:manifestation_id] = @manifestation.id
380
- redirect_to series_statement_manifestations_url(@manifestation.root_series_statement)
385
+ redirect_to manifestations_url(:parent_id => @manifestation.id)
381
386
  return
382
387
  end
383
388
 
@@ -436,6 +441,14 @@ class ManifestationsController < ApplicationController
436
441
  def new
437
442
  @manifestation = Manifestation.new
438
443
  @manifestation.language = Language.where(:iso_639_1 => @locale).first
444
+ parent = Manifestation.where(:id => params[:parent_id]).first if params[:parent_id].present?
445
+ if parent
446
+ @manifestation.parent_id = parent.id
447
+ @manifestation.original_title = parent.original_title
448
+ @manifestation.title_transcription = parent.title_transcription
449
+ @manifestation.periodical = true if parent.periodical
450
+ @manifestation.series_statements.new(:original_title => parent.root_series_statement.original_title)
451
+ end
439
452
 
440
453
  respond_to do |format|
441
454
  format.html # new.html.erb
@@ -466,6 +479,7 @@ class ManifestationsController < ApplicationController
466
479
  # POST /manifestations.json
467
480
  def create
468
481
  @manifestation = Manifestation.new(params[:manifestation])
482
+ parent = Manifestation.where(:id => @manifestation.parent_id).first
469
483
  unless @manifestation.original_title?
470
484
  @manifestation.original_title = @manifestation.attachment_file_name
471
485
  end
@@ -473,6 +487,7 @@ class ManifestationsController < ApplicationController
473
487
  respond_to do |format|
474
488
  set_patrons
475
489
  if @manifestation.save
490
+ parent.derived_manifestations << @manifestation if parent
476
491
  Sunspot.commit
477
492
 
478
493
  format.html { redirect_to @manifestation, :notice => t('controller.successfully_created', :model => t('activerecord.models.manifestation')) }
@@ -20,10 +20,10 @@ class Manifestation < ActiveRecord::Base
20
20
  :valid_until, :date_submitted, :date_accepted, :date_captured, :ndl_bib_id,
21
21
  :pub_date, :edition_string, :volume_number, :issue_number, :serial_number,
22
22
  :ndc, :content_type_id, :attachment, :classification_number,
23
- :series_statements_attributes,
23
+ :series_statements_attributes, :periodical,
24
24
  :creators_attributes, :contributors_attributes, :publishers_attributes
25
25
  attr_accessible :fulltext_content,
26
- :doi, :number_of_page_string
26
+ :doi, :number_of_page_string, :parent_id
27
27
 
28
28
  has_many :creates, :dependent => :destroy, :foreign_key => 'work_id'
29
29
  has_many :creators, :through => :creates, :source => :patron, :order => 'creates.position'
@@ -42,6 +42,7 @@ class Manifestation < ActiveRecord::Base
42
42
  belongs_to :carrier_type
43
43
  belongs_to :manifestation_content_type, :class_name => 'ContentType', :foreign_key => 'content_type_id'
44
44
  has_many :series_statements
45
+ has_one :root_series_statement, :foreign_key => 'root_manifestation_id', :class_name => 'SeriesStatement'
45
46
  belongs_to :frequency
46
47
  belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id', :validate => true
47
48
  has_one :resource_import_result
@@ -58,7 +59,7 @@ class Manifestation < ActiveRecord::Base
58
59
  text :fulltext, :note, :creator, :contributor, :publisher, :description
59
60
  text :item_identifier do
60
61
  if series_master?
61
- root_series_statement.manifestation.items.pluck(:item_identifier)
62
+ root_series_statement.root_manifestation.items.pluck(:item_identifier)
62
63
  else
63
64
  items.pluck(:item_identifier)
64
65
  end
@@ -93,7 +94,7 @@ class Manifestation < ActiveRecord::Base
93
94
  end
94
95
  string :library, :multiple => true do
95
96
  if series_master?
96
- root_series_statement.manifestation.items.map{|i| i.shelf.library.name}.flatten.uniq
97
+ root_series_statement.root_manifestation.items.map{|i| i.shelf.library.name}.flatten.uniq
97
98
  else
98
99
  items.map{|i| i.shelf.library.name}
99
100
  end
@@ -103,7 +104,7 @@ class Manifestation < ActiveRecord::Base
103
104
  end
104
105
  string :item_identifier, :multiple => true do
105
106
  if series_master?
106
- root_series_statement.manifestation.items.pluck(:item_identifier)
107
+ root_series_statement.root_manifestation.items.pluck(:item_identifier)
107
108
  else
108
109
  items.collect(&:item_identifier)
109
110
  end
@@ -116,7 +117,7 @@ class Manifestation < ActiveRecord::Base
116
117
  time :deleted_at
117
118
  time :pub_date, :multiple => true do
118
119
  if series_master?
119
- root_series_statement.manifestation.pub_dates
120
+ root_series_statement.root_manifestation.pub_dates
120
121
  else
121
122
  pub_dates
122
123
  end
@@ -130,6 +131,9 @@ class Manifestation < ActiveRecord::Base
130
131
  integer :publisher_ids, :multiple => true
131
132
  integer :item_ids, :multiple => true
132
133
  integer :original_manifestation_ids, :multiple => true
134
+ integer :parent_ids, :multiple => true do
135
+ original_manifestations.pluck(:id)
136
+ end
133
137
  integer :required_role_id
134
138
  integer :height
135
139
  integer :width
@@ -158,8 +162,8 @@ class Manifestation < ActiveRecord::Base
158
162
  creator
159
163
  end
160
164
  text :atitle do
161
- unless series_master?
162
- title if periodical?
165
+ if periodical? and root_series_statement.nil?
166
+ titles
163
167
  end
164
168
  end
165
169
  text :btitle do
@@ -167,7 +171,11 @@ class Manifestation < ActiveRecord::Base
167
171
  end
168
172
  text :jtitle do
169
173
  if periodical?
170
- titles
174
+ if root_series_statement
175
+ root_series_statement.titles
176
+ else
177
+ titles
178
+ end
171
179
  end
172
180
  end
173
181
  text :isbn do # 前方一致検索のためtext指定を追加
@@ -188,6 +196,17 @@ class Manifestation < ActiveRecord::Base
188
196
  boolean :series_master do
189
197
  series_master?
190
198
  end
199
+ boolean :resource_master do
200
+ if periodical?
201
+ if series_master?
202
+ true
203
+ else
204
+ false
205
+ end
206
+ else
207
+ true
208
+ end
209
+ end
191
210
  time :acquired_at
192
211
  end
193
212
 
@@ -223,7 +242,7 @@ class Manifestation < ActiveRecord::Base
223
242
  normalize_attributes :manifestation_identifier, :pub_date, :isbn, :issn, :nbn, :lccn, :original_title
224
243
  paginates_per 10
225
244
 
226
- attr_accessor :during_import, :creator_string
245
+ attr_accessor :during_import, :parent_id
227
246
 
228
247
  def check_isbn
229
248
  if isbn.present?
@@ -429,14 +448,8 @@ class Manifestation < ActiveRecord::Base
429
448
  items.order(:acquired_at).first.try(:acquired_at)
430
449
  end
431
450
 
432
- def root_series_statement
433
- series_statements.where(:series_master => true).first
434
- end
435
-
436
451
  def series_master?
437
- series_statements.each do |series_statement|
438
- return true if series_statement.series_master
439
- end
452
+ return true if root_series_statement
440
453
  false
441
454
  end
442
455
 
@@ -1,7 +1,7 @@
1
1
  class PageSweeper < ActionController::Caching::Sweeper
2
2
  include ExpireEditableFragment
3
3
  observe Create, Realize, Produce, Own, Exemplify,
4
- SeriesStatement, SeriesHasManifestation, PictureFile
4
+ SeriesStatement, PictureFile
5
5
 
6
6
  def after_save(record)
7
7
  case record.class.to_s.to_sym
@@ -1,19 +1,19 @@
1
1
  class SeriesStatement < ActiveRecord::Base
2
2
  attr_accessible :original_title, :numbering, :title_subseries,
3
3
  :numbering_subseries, :title_transcription, :title_alternative,
4
- :series_statement_identifier, :note,
4
+ :series_statement_identifier, :note, :series_master,
5
+ :root_manifestation_id,
5
6
  :title_subseries_transcription, :creator_string, :volume_number_string
6
7
  attr_accessible :url, :frequency_id
7
8
 
8
9
  belongs_to :manifestation
9
- belongs_to :manifestation, :foreign_key => :manifestation_id, :class_name => 'Manifestation'
10
+ belongs_to :root_manifestation, :foreign_key => :root_manifestation_id, :class_name => 'Manifestation'
10
11
  has_many :child_relationships, :foreign_key => 'parent_id', :class_name => 'SeriesStatementRelationship', :dependent => :destroy
11
12
  has_many :parent_relationships, :foreign_key => 'child_id', :class_name => 'SeriesStatementRelationship', :dependent => :destroy
12
13
  has_many :children, :through => :child_relationships, :source => :child
13
14
  has_many :parents, :through => :parent_relationships, :source => :parent
14
15
  belongs_to :frequency
15
16
  validates_presence_of :original_title
16
- before_save :create_manifestation
17
17
 
18
18
  acts_as_list
19
19
  searchable do
@@ -37,10 +37,6 @@ class SeriesStatement < ActiveRecord::Base
37
37
 
38
38
  paginates_per 10
39
39
 
40
- def manifestation_included(manifestation)
41
- series_has_manifestations.where(:manifestation_id => manifestation.id).first
42
- end
43
-
44
40
  def titles
45
41
  [
46
42
  original_title,
@@ -50,16 +46,6 @@ class SeriesStatement < ActiveRecord::Base
50
46
  ].flatten.compact
51
47
  end
52
48
 
53
- def create_manifestation
54
- return nil if manifestation
55
- SeriesStatement.transaction do
56
- manifestation = Manifestation.create!(
57
- :original_title => original_title
58
- )
59
- self.manifestation = manifestation
60
- end
61
- end
62
-
63
49
  if defined?(EnjuResourceMerge)
64
50
  has_many :series_statement_merges, :dependent => :destroy
65
51
  has_many :series_statement_merge_lists, :through => :series_statement_merges
@@ -15,11 +15,23 @@
15
15
  <%= f.text_field :title_alternative, :class => 'resource_title' -%>
16
16
  </div>
17
17
 
18
+ <div class="field">
19
+ <%= f.label :periodical %><br />
20
+ <%= f.check_box :periodical %>
21
+ </div>
22
+
18
23
  <div class="field">
19
24
  <%= f.label :series_statement_string -%><br />
20
25
  <%= f.fields_for :series_statements do |series_form| %>
26
+ <%= f.label :original_title %><br />
21
27
  <%= series_form.text_field :original_title %>
22
- <%= series_form.link_to_remove t('page.remove') %>
28
+ <%= series_form.link_to_remove t('page.remove'), :confirm => t('page.are_you_sure') %><br />
29
+ <%= f.label :volume_number_string %><br />
30
+ <%= series_form.text_field :volume_number_string %><br />
31
+ <%= f.label :creator_string %><br />
32
+ <%= series_form.text_field :creator_string %><br />
33
+ <%= f.label :series_master %>
34
+ <%= series_form.check_box :series_master %>
23
35
  <% end %>
24
36
  <p><%= f.link_to_add t('page.add'), :series_statements %></p>
25
37
  </div>
@@ -165,8 +177,7 @@
165
177
  </div>
166
178
 
167
179
  <div class="actions">
168
- <%= hidden_field_tag :patron_id, @patron.id if @patron -%>
169
- <%= hidden_field_tag :manifestation_id, @original_manifestation.id if @original_manifestation -%>
180
+ <%= f.hidden_field :parent_id %>
170
181
  <%= f.submit %>
171
182
  </div>
172
183
  <%= javascript_tag("$(function(){$('#query').focus()})") %>
@@ -0,0 +1,21 @@
1
+ <h2 class="resource_title">
2
+ [M]
3
+ <%= link_to @parent.original_title, @parent, :itemprop => 'name' -%>
4
+ </h2>
5
+
6
+ <div class="search_form">
7
+ <%= form_for :manifestations, :url => manifestations_path, :html => {:method => 'get'} do -%>
8
+ <p>
9
+ <%= label_tag :search_form_top, t('page.search_term') -%>:
10
+ <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
11
+ <%= hidden_field_tag 'parent_id', @parent.id -%>
12
+ <%= hidden_field_tag 'reservable', h(@reservable) if @reservable -%>
13
+ <% if can? :update, Manifestation %>
14
+ <%= render 'page/add' %>
15
+ <% end %>
16
+ <%= submit_tag t('page.search') -%>
17
+ <br />
18
+ <%= link_to t('page.advanced_search'), page_advanced_search_path -%>
19
+ </p>
20
+ <%- end -%>
21
+ </div>
@@ -1,15 +1,14 @@
1
- <tr class="line<%= cycle("0", "1") -%>">
2
- <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
1
+ <tr class="line<%= cycle("0", "1") -%>">
2
+ <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
3
+ <% cache([:manifestation => manifestation.id, :fragment => 'manifestation_html', :role => current_user_role_name, :locale => @locale]) do %>
3
4
  <td style="480px">
4
5
  <% if manifestation.root_series_statement %>
5
6
  <%= render 'manifestations/show_series_index', :manifestation => manifestation, :series_statement => manifestation.root_series_statement -%>
6
7
  <% else %>
7
- <% cache([:manifestation => manifestation.id, :fragment => 'manifestation_html', :role => current_user_role_name, :locale => @locale]) do %>
8
- <%= render 'manifestations/show_index', :manifestation => manifestation -%>
9
- <div class="access_address">
10
- <%= link_to manifestation.access_address, manifestation.access_address if manifestation.access_address.present? -%>
11
- </div>
12
- <% end %>
8
+ <%= render 'manifestations/show_index', :manifestation => manifestation -%>
9
+ <div class="access_address">
10
+ <%= link_to manifestation.access_address, manifestation.access_address if manifestation.access_address.present? -%>
11
+ </div>
13
12
  <% end %>
14
13
  </td>
15
14
  <% if signed_in? %>
@@ -32,7 +31,7 @@
32
31
  <%= link_to image_tag('icons/book_edit.png', :size => '16x16', :alt => t('page.edit')), edit_manifestation_path(manifestation) -%>
33
32
  <% if @series_statement %>
34
33
  <% if manifestation.root_series_statement == @series_statement %>
35
- <%= link_to t('page.destroy'), series_statement_series_has_manifestation_path(manifestation.root_series_statement, manifestation.series_has_manifestations.where(:series_statement_id => manifestation.root_series_statement.id).first), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
34
+ <%= link_to t('page.destroy'), manifestation, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
36
35
  <% end %>
37
36
  <% end %>
38
37
  <% else %>
@@ -45,17 +44,18 @@
45
44
  <%= link_to t('page.add'), new_patron_produce_path(@index_patron[:publisher], :manifestation_id => manifestation.id) unless manifestation.publishers.include?(@index_patron[:publisher]) -%>
46
45
  <% when @series_statement %>
47
46
  <% unless manifestation.series_statements.exists? -%>
48
- <%= link_to t('page.add'), new_series_has_manifestation_path(:series_statement_id => @series_statement.id, :manifestation_id => manifestation.id) -%>
47
+ <%= link_to t('page.add'), new_manifestation_path(:parent_id => @series_statement.root_manifestation.id) if @series_statement.root_manifestation -%>
49
48
  <% end %>
50
49
  <% when @manifestation %>
51
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 -%>
52
51
  <% when @item %>
53
52
  <%= link_to t('page.change'), edit_exemplify_path(@item.exemplify, :manifestation_id => manifestation.id) unless @item.manifestation == manifestation -%>
54
53
  <% else %>
55
- <%= link_to image_tag('icons/arrow_divide.png', :size => '16x16', :alt => t('manifestation.add_derivation')), manifestation_manifestations_path(manifestation, :mode => 'add') -%>
54
+ <%= link_to image_tag('icons/arrow_divide.png', :size => '16x16', :alt => t('manifestation.add_derivation')), new_manifestation_path(:parent_id => manifestation.id) -%>
56
55
  <% end %>
57
56
  <%- end -%>
58
57
  <%- end -%>
59
58
  </td>
60
59
  <% end %>
61
- </tr>
60
+ <% end %>
61
+ </tr>
@@ -16,7 +16,11 @@
16
16
  <td style="width: 500px">
17
17
  <ul>
18
18
  <% manifestation.series_statements.each do |series_statement| %>
19
- <li><%= link_to series_statement.original_title, series_statement -%></li>
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 %>
20
24
  <% end %>
21
25
  </ul>
22
26
  <%= manifestation.volume_number_string %>
@@ -0,0 +1,26 @@
1
+ <table class="table table-striped" id="resource_detail">
2
+ <tr>
3
+ <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_transcription') -%></td>
4
+ <td style="width: 490px"><%= @parent.title_transcription %></td>
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
+ <tr>
15
+ <td><%= t('activerecord.attributes.series_statement.series_master') -%></td>
16
+ <td><%= localized_boolean(@parent.series_master?) %></td>
17
+ </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
+ <tr>
23
+ <td><%= t('activerecord.attributes.series_statement.note') -%></td>
24
+ <td><%= @parent.note %></td>
25
+ </tr>
26
+ </table>
@@ -1,4 +1,4 @@
1
- <strong><%= link_to series_statement.original_title, series_statement_manifestations_path(series_statement, :query => @query) -%></strong>
1
+ <strong><%= link_to manifestation.original_title, manifestations_path(:parent_id => manifestation.id, :query => @query) -%></strong>
2
2
  <%= link_to form_icon(manifestation.carrier_type), manifestation -%>
3
3
  <%= link_to image_tag('icons/world_go.png', :size => '16x16', :alt => t('manifestation.web')), manifestation.access_address unless manifestation.access_address.blank? -%>
4
4
  <br />
@@ -12,8 +12,8 @@
12
12
  </td>
13
13
  </tr>
14
14
  <tr>
15
- <td><%= t('activerecord.attributes.series_statement.periodical') -%></td>
16
- <td><%= localized_boolean(@series_statement.periodical) %></td>
15
+ <td><%= t('activerecord.attributes.series_statement.root_manifestation_id') -%></td>
16
+ <td><%= link_to @series_statement.root_manifestation.original_title, @series_statement.root_manifestation %></td>
17
17
  </tr>
18
18
  <tr>
19
19
  <td><%= t('activerecord.attributes.series_statement.issn') -%></td>
@@ -0,0 +1,8 @@
1
+ <ul>
2
+ <% if can? :create, Manifestation %>
3
+ <li><%= link_to t('page.new', :model => t('activerecord.models.manifestation')), new_manifestation_path(:parent_id => @parent.id) %></li>
4
+ <% end %>
5
+ <% if can? :update, @parent %>
6
+ <li><%= link_to t('page.edit'), edit_manifestation_path(@parent) %></li>
7
+ <% end %>
8
+ </ul>
@@ -14,15 +14,15 @@
14
14
  <%= render 'index_form_manifestation' %>
15
15
  <% when @item %>
16
16
  <%= render 'index_form_item' %>
17
- <% when @series_statement %>
18
- <%= render 'index_form_series_statement' %>
17
+ <% when @parent %>
18
+ <%= render 'index_form_parent' %>
19
19
  <% else %>
20
20
  <%= render 'index_form' %>
21
21
  <% end %>
22
22
  <%= set_focus_on_search_form %>
23
23
 
24
- <% if @series_statement %>
25
- <%= render 'show_series_statement' %>
24
+ <% if @parent %>
25
+ <%= render 'show_parent' %>
26
26
  <% end %>
27
27
 
28
28
  <%- if @manifestations.total_count > 0 -%>
@@ -73,8 +73,8 @@
73
73
  </div>
74
74
 
75
75
  <div id="submenu" class="ui-corner-all">
76
- <% if @series_statement and can?(:update, @series_statement) %>
77
- <%= render 'submenu_series_statement' %>
76
+ <% if @parent and can?(:update, @parent) %>
77
+ <%= render 'submenu_parent' %>
78
78
  <% end %>
79
79
  </div>
80
80
 
@@ -1,8 +1,4 @@
1
- <%- if @manifestation -%>
2
- <%= render 'index_manifestation' -%>
3
- <%- elsif @parent -%>
4
- <%= render 'index_parent' -%>
5
- <%- elsif @series_statement_merge_list -%>
1
+ <%- if @series_statement_merge_list -%>
6
2
  <%= render 'index_series_statement_merge_list' -%>
7
3
  <%- else -%>
8
4
  <%= render 'index' -%>
@@ -80,6 +80,8 @@ en:
80
80
  contributor_string: Contributor
81
81
  publisher_string: Publisher
82
82
  series_statement_string: Series statement
83
+ periodical: Periodical
84
+ series_master: Series master
83
85
  item:
84
86
  call_number: Call number
85
87
  item_identifier: Item identifier
@@ -172,6 +174,7 @@ en:
172
174
  periodical: Periodical
173
175
  title_transcription: Title transcription
174
176
  note: Note
177
+ series_master: Maseter
175
178
  country:
176
179
  name: Name
177
180
  display_name: Display name
@@ -80,6 +80,8 @@ ja:
80
80
  contributor_string: 協力者・編者
81
81
  publisher_string: 出版者
82
82
  series_statement_string: シリーズ情報
83
+ periodical: 定期刊行物
84
+ series_master: シリーズ情報マスタ
83
85
  item:
84
86
  call_number: 請求記号
85
87
  item_identifier: 所蔵情報ID
@@ -172,6 +174,7 @@ ja:
172
174
  periodical: 定期刊行物
173
175
  title_transcription: シリーズ名よみ
174
176
  note: 注記
177
+ series_master: マスタ
175
178
  country:
176
179
  name: 名前
177
180
  display_name: 表示名
@@ -0,0 +1,6 @@
1
+ class AddRootManifestationIdToSeriesStatement < ActiveRecord::Migration
2
+ def change
3
+ add_column :series_statements, :root_manifestation_id, :integer
4
+ add_index :series_statements, :root_manifestation_id
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.1.0.pre34"
2
+ VERSION = "0.1.0.pre35"
3
3
  end