enju_biblio 0.1.0.pre63 → 0.1.0.pre64

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/agent_import_files_controller.rb +9 -2
  3. data/app/controllers/agent_import_results_controller.rb +7 -0
  4. data/app/controllers/agent_merge_lists_controller.rb +7 -2
  5. data/app/controllers/agent_merges_controller.rb +7 -2
  6. data/app/controllers/agent_relationship_types_controller.rb +9 -4
  7. data/app/controllers/agent_relationships_controller.rb +8 -2
  8. data/app/controllers/agent_types_controller.rb +9 -4
  9. data/app/controllers/agents_controller.rb +15 -10
  10. data/app/controllers/carrier_types_controller.rb +14 -2
  11. data/app/controllers/content_types_controller.rb +9 -4
  12. data/app/controllers/countries_controller.rb +11 -4
  13. data/app/controllers/create_types_controller.rb +9 -4
  14. data/app/controllers/creates_controller.rb +8 -2
  15. data/app/controllers/donates_controller.rb +7 -2
  16. data/app/controllers/form_of_works_controller.rb +9 -4
  17. data/app/controllers/frequencies_controller.rb +9 -4
  18. data/app/controllers/identifier_types_controller.rb +11 -4
  19. data/app/controllers/import_requests_controller.rb +15 -2
  20. data/app/controllers/items_controller.rb +21 -3
  21. data/app/controllers/languages_controller.rb +12 -4
  22. data/app/controllers/licenses_controller.rb +9 -4
  23. data/app/controllers/manifestation_relationship_types_controller.rb +11 -4
  24. data/app/controllers/manifestation_relationships_controller.rb +8 -2
  25. data/app/controllers/manifestations_controller.rb +105 -10
  26. data/app/controllers/medium_of_performances_controller.rb +9 -4
  27. data/app/controllers/owns_controller.rb +7 -2
  28. data/app/controllers/picture_files_controller.rb +8 -2
  29. data/app/controllers/produce_types_controller.rb +9 -4
  30. data/app/controllers/produces_controller.rb +8 -2
  31. data/app/controllers/realize_types_controller.rb +11 -4
  32. data/app/controllers/realizes_controller.rb +8 -2
  33. data/app/controllers/resource_export_files_controller.rb +7 -2
  34. data/app/controllers/resource_import_files_controller.rb +9 -2
  35. data/app/controllers/resource_import_results_controller.rb +7 -0
  36. data/app/controllers/series_statement_merge_lists_controller.rb +7 -2
  37. data/app/controllers/series_statement_merges_controller.rb +9 -2
  38. data/app/controllers/series_statements_controller.rb +13 -2
  39. data/app/models/agent.rb +0 -9
  40. data/app/models/agent_import_file.rb +3 -3
  41. data/app/models/agent_import_file_transition.rb +1 -1
  42. data/app/models/agent_import_result.rb +0 -1
  43. data/app/models/agent_merge.rb +0 -1
  44. data/app/models/agent_merge_list.rb +0 -1
  45. data/app/models/agent_relationship.rb +0 -1
  46. data/app/models/agent_relationship_type.rb +0 -1
  47. data/app/models/agent_type.rb +0 -1
  48. data/app/models/carrier_type.rb +1 -7
  49. data/app/models/content_type.rb +0 -1
  50. data/app/models/country.rb +0 -1
  51. data/app/models/create.rb +0 -1
  52. data/app/models/create_type.rb +0 -1
  53. data/app/models/donate.rb +0 -1
  54. data/app/models/enju_biblio/ability.rb +25 -2
  55. data/app/models/exemplify.rb +1 -1
  56. data/app/models/form_of_work.rb +0 -1
  57. data/app/models/frequency.rb +0 -1
  58. data/app/models/identifier.rb +1 -1
  59. data/app/models/identifier_type.rb +0 -1
  60. data/app/models/import_request.rb +8 -7
  61. data/app/models/import_request_transition.rb +1 -1
  62. data/app/models/item.rb +0 -5
  63. data/app/models/language.rb +0 -2
  64. data/app/models/license.rb +0 -1
  65. data/app/models/manifestation.rb +29 -33
  66. data/app/models/manifestation_relationship.rb +0 -1
  67. data/app/models/manifestation_relationship_type.rb +0 -1
  68. data/app/models/medium_of_performance.rb +0 -1
  69. data/app/models/own.rb +0 -1
  70. data/app/models/picture_file.rb +1 -3
  71. data/app/models/produce.rb +0 -1
  72. data/app/models/produce_type.rb +0 -1
  73. data/app/models/realize.rb +0 -1
  74. data/app/models/realize_type.rb +0 -1
  75. data/app/models/resource_export_file.rb +9 -3
  76. data/app/models/resource_export_file_transition.rb +1 -1
  77. data/app/models/resource_import_file.rb +18 -10
  78. data/app/models/resource_import_file_transition.rb +1 -1
  79. data/app/models/resource_import_result.rb +0 -1
  80. data/app/models/series_statement.rb +0 -7
  81. data/app/models/series_statement_merge.rb +0 -1
  82. data/app/models/series_statement_merge_list.rb +0 -1
  83. data/app/views/items/index.html.erb +11 -0
  84. data/app/views/layouts/items.html.erb +29 -0
  85. data/app/views/manifestations/_form.html.erb +3 -3
  86. data/app/views/manifestations/_index_form_series_statement.html.erb +1 -1
  87. data/app/views/manifestations/_list.html.erb +15 -0
  88. data/app/views/manifestations/_manifestation.html.erb +59 -38
  89. data/app/views/manifestations/_pickup.html.erb +8 -0
  90. data/app/views/manifestations/_show_detail_librarian.html.erb +8 -0
  91. data/app/views/manifestations/_show_detail_user.html.erb +8 -0
  92. data/app/views/manifestations/_show_holding.html.erb +19 -0
  93. data/app/views/manifestations/_submenu_parent.html.erb +3 -0
  94. data/app/views/manifestations/index.atom.builder +3 -0
  95. data/app/views/manifestations/index.html.erb +31 -1
  96. data/app/views/manifestations/index.opds.builder +3 -0
  97. data/app/views/manifestations/show.html.erb +4 -1
  98. data/app/views/resource_export_files/index.html.erb +2 -2
  99. data/app/views/resource_export_files/show.html.erb +1 -1
  100. data/config/locales/translation_en.yml +1 -0
  101. data/config/locales/translation_ja.yml +1 -0
  102. data/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  103. data/lib/enju_biblio/biblio_helper.rb +2 -0
  104. data/lib/enju_biblio/engine.rb +0 -1
  105. data/lib/enju_biblio/version.rb +1 -1
  106. data/spec/controllers/agent_import_files_controller_spec.rb +3 -3
  107. data/spec/controllers/agent_merge_lists_controller_spec.rb +2 -2
  108. data/spec/controllers/agent_merges_controller_spec.rb +1 -1
  109. data/spec/controllers/agent_types_controller_spec.rb +8 -8
  110. data/spec/controllers/carrier_types_controller_spec.rb +8 -8
  111. data/spec/controllers/content_types_controller_spec.rb +8 -8
  112. data/spec/controllers/create_types_controller_spec.rb +6 -6
  113. data/spec/controllers/form_of_works_controller_spec.rb +6 -6
  114. data/spec/controllers/frequencies_controller_spec.rb +8 -8
  115. data/spec/controllers/identifier_types_controller_spec.rb +8 -8
  116. data/spec/controllers/licenses_controller_spec.rb +6 -6
  117. data/spec/controllers/manifestations_controller_spec.rb +22 -2
  118. data/spec/controllers/medium_of_performances_controller_spec.rb +6 -6
  119. data/spec/controllers/produce_types_controller_spec.rb +6 -6
  120. data/spec/controllers/realize_types_controller_spec.rb +6 -6
  121. data/spec/controllers/resource_export_files_controller_spec.rb +23 -23
  122. data/spec/controllers/resource_import_files_controller_spec.rb +4 -4
  123. data/spec/dummy/app/models/user.rb +0 -1
  124. data/spec/dummy/bin/bundle +3 -0
  125. data/spec/dummy/bin/rails +4 -0
  126. data/spec/dummy/bin/rake +4 -0
  127. data/spec/dummy/bin/setup +29 -0
  128. data/spec/dummy/config/application.rb +2 -2
  129. data/spec/dummy/config/boot.rb +4 -9
  130. data/spec/dummy/config/environment.rb +3 -3
  131. data/spec/dummy/db/schema.rb +118 -118
  132. data/spec/factories/manifestation.rb +8 -0
  133. data/spec/factories/series_statement.rb +5 -0
  134. data/spec/fixtures/events.yml +13 -39
  135. data/spec/fixtures/identifier_types.yml +7 -0
  136. data/spec/fixtures/identifiers.yml +7 -0
  137. data/spec/fixtures/manifestations.yml +9 -0
  138. data/spec/fixtures/use_restrictions.yml +1 -1
  139. data/spec/views/manifestations/show.html.erb_spec.rb +8 -0
  140. metadata +31 -43
  141. data/spec/dummy/db/test.sqlite3 +0 -0
  142. data/spec/dummy/script/rails +0 -6
  143. data/spec/dummy/tmp/cache/stdout +0 -25
  144. data/spec/dummy/tmp/pids/redis-test.pid +0 -1
@@ -1,15 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class ResourceImportFile < ActiveRecord::Base
3
- include Statesman::Adapters::ActiveRecordModel
3
+ include Statesman::Adapters::ActiveRecordQueries
4
4
  include ImportFile
5
- attr_accessible :resource_import, :edit_mode, :user_encoding, :mode,
6
- :default_shelf_id, :library_id
7
5
  default_scope { order('resource_import_files.id DESC') }
8
6
  scope :not_imported, -> { in_state(:pending) }
9
7
  scope :stucked, -> { in_state(:pending).where('resource_import_files.created_at < ?', 1.hour.ago) }
10
8
 
11
9
  if Setting.uploaded_file.storage == :s3
12
- has_attached_file :resource_import, storage: :s3, s3_credentials: "#{Setting.amazon}",
10
+ has_attached_file :resource_import, storage: :s3,
11
+ s3_credentials: Setting.amazon,
13
12
  s3_permissions: :private
14
13
  else
15
14
  has_attached_file :resource_import,
@@ -105,21 +104,27 @@ class ResourceImportFile < ActiveRecord::Base
105
104
  unless manifestation
106
105
  if row['doi'].present?
107
106
  doi = URI.parse(row['doi']).path.gsub(/^\//, "")
108
- manifestation = Identifier.where(body: doi, identifier_type_id: IdentifierType.where(name: 'doi').first_or_create.id).first.try(:manifestation)
107
+ identifier_type_doi = IdentifierType.where(name: 'doi').first
108
+ identifier_type_doi = IdentifierType.where(name: 'doi').create! unless identifier_type_doi
109
+ manifestation = Identifier.where(body: doi, identifier_type_id: identifier_type_doi.id).first.try(:manifestation)
109
110
  end
110
111
  end
111
112
 
112
113
  unless manifestation
113
114
  if row['jpno'].present?
114
115
  jpno = row['jpno'].to_s.strip
115
- manifestation = Identifier.where(body: jpno, identifier_type_id: IdentifierType.where(name: 'jpno').first_or_create.id).first.try(:manifestation)
116
+ identifier_type_jpno = IdentifierType.where(name: 'jpno').first
117
+ identifier_type_jpno = IdentifierType.where(name: 'jpno').create! unless identifier_type_jpno
118
+ manifestation = Identifier.where(body: jpno, identifier_type_id: identifier_type_jpno.id).first.try(:manifestation)
116
119
  end
117
120
  end
118
121
 
119
122
  unless manifestation
120
123
  if row['isbn'].present?
121
124
  isbn = StdNum::ISBN.normalize(row['isbn'])
122
- m = Identifier.where(body: isbn, identifier_type_id: IdentifierType.where(name: 'isbn').first_or_create.id).first.try(:manifestation)
125
+ identifier_type_isbn = IdentifierType.where(name: 'isbn').first
126
+ identifier_type_isbn = IdentifierType.where(name: 'isbn').create! unless identifier_type_isbn
127
+ m = Identifier.where(body: isbn, identifier_type_id: identifier_type_isbn.id).first.try(:manifestation)
123
128
  end
124
129
  if m
125
130
  if m.series_statements.exists?
@@ -301,13 +306,14 @@ class ResourceImportFile < ActiveRecord::Base
301
306
  item.binded_at = binded_at if binded_at
302
307
 
303
308
  item_columns = %w(
304
- call_number item_price
309
+ call_number
305
310
  binding_item_identifier binding_call_number binded_at
306
311
  )
307
312
  item_columns.each do |column|
308
- item.assign_attributes(:"#{column}" => row[column], as: :admin)
313
+ item.assign_attributes(:"#{column}" => row[column])
309
314
  end
310
315
 
316
+ item.price = row['item_price'] if row['item_price'].present?
311
317
  item.note = row['item_note'] if row['item_note'].present?
312
318
  item.url = row['item_url'] if row['item_url'].present?
313
319
 
@@ -723,7 +729,9 @@ class ResourceImportFile < ActiveRecord::Base
723
729
  %w(isbn issn doi jpno).each do |id_type|
724
730
  if row["#{id_type}"].present?
725
731
  import_id = Identifier.new(body: row["#{id_type}"])
726
- import_id.identifier_type = IdentifierType.where(name: id_type).first_or_create
732
+ identifier_type = IdentifierType.where(name: id_type).first
733
+ identifier_type = IdentifierType.where(name: id_type).create! unless identifier_type
734
+ import_id.identifier_type = identifier_type
727
735
  identifier[:"#{id_type}"] = import_id if import_id.valid?
728
736
  end
729
737
  end
@@ -3,7 +3,7 @@ class ResourceImportFileTransition < ActiveRecord::Base
3
3
 
4
4
 
5
5
  belongs_to :resource_import_file, inverse_of: :resource_import_file_transitions
6
- attr_accessible :to_state, :sort_key, :metadata
6
+ #attr_accessible :to_state, :sort_key, :metadata
7
7
  end
8
8
 
9
9
  # == Schema Information
@@ -1,5 +1,4 @@
1
1
  class ResourceImportResult < ActiveRecord::Base
2
- attr_accessible :resource_import_file_id, :manifestation_id, :item_id, :body
3
2
  default_scope { order('resource_import_results.id') }
4
3
  scope :file_id, proc{|file_id| where(resource_import_file_id: file_id)}
5
4
  scope :failed, -> { where(manifestation_id: nil) }
@@ -1,11 +1,4 @@
1
1
  class SeriesStatement < ActiveRecord::Base
2
- attr_accessible :original_title, :numbering, :title_subseries,
3
- :numbering_subseries, :title_transcription, :title_alternative,
4
- :series_statement_identifier, :note,
5
- :root_manifestation_id, :url,
6
- :title_subseries_transcription, :creator_string, :volume_number_string
7
- attr_accessible :series_master
8
-
9
2
  has_many :series_statement_merges, dependent: :destroy
10
3
  has_many :series_statement_merge_lists, through: :series_statement_merges
11
4
  belongs_to :manifestation, touch: true
@@ -1,5 +1,4 @@
1
1
  class SeriesStatementMerge < ActiveRecord::Base
2
- attr_accessible :series_statement_id, :series_statement_merge_list_id
3
2
  belongs_to :series_statement, validate: true
4
3
  belongs_to :series_statement_merge_list, validate: true
5
4
  validates_presence_of :series_statement, :series_statement_merge_list
@@ -1,5 +1,4 @@
1
1
  class SeriesStatementMergeList < ActiveRecord::Base
2
- attr_accessible :title
3
2
  has_many :series_statement_merges, dependent: :destroy
4
3
  has_many :series_statements, through: :series_statement_merges
5
4
  validates_presence_of :title
@@ -76,4 +76,15 @@
76
76
  <li><%= link_to t('page.new', model: t('activerecord.models.item')), new_item_path(manifestation_id: @manifestation.id) -%></li>
77
77
  <%- end -%>
78
78
  </ul>
79
+ <% if defined?(EnjuCirculation) %>
80
+ <h4><%= t('activerecord.models.circulation_status') -%></h4>
81
+ <ul>
82
+ <%- @circulation_status_facet.each do |facet| -%>
83
+ <li><%= circulation_status_facet(facet) %></li>
84
+ <%- end -%>
85
+ <%- if params[:circulation_status] -%>
86
+ <li><%= link_to t('page.remove_this_facet'), url_for(params.merge(circulation_status: nil, page: nil, view: nil, only_path: true)) -%></li>
87
+ <%- end -%>
88
+ </ul>
89
+ <% end %>
79
90
  </div>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= @locale.to_s -%>" lang="<%= @locale.to_s -%>">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <%= render 'page/include' %>
6
+ <title><%= title(controller.controller_name) %></title>
7
+ <% if %w(index show new edit).include?(controller.action_name) %>
8
+ <%= book_jacket_header(Setting.book_jacket.source) %>
9
+ <% if Setting.book_jacket.source == :google %>
10
+ <script type="text/javascript" src="https://www.google.com/jsapi"></script>
11
+ <%= render 'manifestations/google_book_thumbnail_header', manifestation: @manifestation if @manifestation %>
12
+ <% end %>
13
+ <% end %>
14
+ </head>
15
+ <body itemscope itemtype="http://schema.org/WebPage">
16
+
17
+ <%= render 'page/header' %>
18
+ <%= render 'page/menu' %>
19
+
20
+ <div id="content">
21
+
22
+ <%= yield %>
23
+
24
+ </div>
25
+
26
+ <%= render 'page/footer' %>
27
+
28
+ </body>
29
+ </html>
@@ -146,9 +146,9 @@
146
146
  <p><%= f.link_to_add t('page.add'), :identifiers %></p>
147
147
  </div>
148
148
 
149
- <% if defined?(EnjuSubject) %>
150
- <%= render 'manifestations/subject_form', f: f %>
151
- <% end %>
149
+ <% if defined?(EnjuSubject) %>
150
+ <%= render 'manifestations/subject_form', f: f %>
151
+ <% end %>
152
152
 
153
153
  <!--
154
154
  <div class="field">
@@ -9,7 +9,7 @@
9
9
  <%= label_tag :search_form_top, t('page.search_term') -%>:
10
10
  <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
11
11
  <%= hidden_field_tag 'reservable', h(@reservable) if @reservable -%>
12
- <% if can? :update, Manifestation %>
12
+ <% if can? :create, Manifestation %>
13
13
  <%= render 'page/add' %>
14
14
  <% end %>
15
15
  <%= submit_tag t('page.search') -%>
@@ -4,3 +4,18 @@
4
4
 
5
5
  <%= paginate(manifestations) -%>
6
6
  <br />
7
+
8
+ <div>
9
+ <%- if manifestations and manifestations.size > @manifestations.limit_value.div(2) -%>
10
+ <%= form_for :manifestations, html: {method: 'get'} do -%>
11
+ <p>
12
+ <%= label_tag :search_form_bottom, t('page.search_term') -%>:
13
+ <%= search_field_tag 'query', h(@query), {id: 'search_form_bottom', class: 'search_form', placeholder: t('page.search_term')} -%>
14
+ <%= hidden_field_tag 'reservable', h(@reservable) if @reservable -%>
15
+ <%= submit_tag t('page.search') -%>
16
+ <br />
17
+ <%= link_to t('page.advanced_search'), page_advanced_search_path -%>
18
+ </p>
19
+ <%- end -%>
20
+ <%- end -%>
21
+ </div>
@@ -1,44 +1,65 @@
1
- <tr class="line<%= cycle("0", "1") -%>">
2
- <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
3
- <td style="480px">
4
- <% if manifestation.root_series_statement %>
5
- <%= render 'manifestations/show_series_index', manifestation: manifestation, series_statement: manifestation.root_series_statement -%>
1
+ <tr class="line<%= cycle("0", "1") -%>">
2
+ <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
3
+ <% cache([manifestation, fragment: 'manifestation_html', role: current_user_role_name, locale: @locale]) do %>
4
+ <td style="480px">
5
+ <% if manifestation.root_series_statement %>
6
+ <%= render 'manifestations/show_series_index', manifestation: manifestation, series_statement: manifestation.root_series_statement -%>
7
+ <% else %>
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
+ <% if current_user.try(:has_role?, 'Librarian') %>
13
+ <%- unless manifestation.items.empty? -%>
14
+ (<%= link_to "#", { onclick: "$('#holding_#{manifestation.id}').toggle(); return false;"} do t('page.holding') end %>)
15
+ <% end %>
6
16
  <% else %>
7
- <%= render 'manifestations/show_index', manifestation: manifestation -%>
8
- <div class="access_address">
9
- <%= link_to manifestation.access_address, manifestation.access_address if manifestation.access_address.present? -%>
10
- </div>
17
+ <%- unless manifestation.items.for_checkout.on_shelf.empty? -%>
18
+ (<%= link_to "#", { onclick: "$('#holding_#{manifestation.id}').toggle(); return false;"} do t('page.holding') end %>)
19
+ <%- end -%>
20
+ <%- end -%>
21
+ <% if defined?(EnjuBookmark) %>
22
+ <%- if manifestation.tags.first -%>
23
+ (<%= link_to "#", { onclick: "$('#tag_#{manifestation.id}').toggle(); return false;" } do t('activerecord.models.tag') end %>)
24
+ <%- end -%>
25
+ <%= render 'manifestations/show_tag', manifestation: manifestation -%>
11
26
  <% end %>
12
- </td>
13
- <% if signed_in? %>
14
- <td id="edit_icons">
15
- <% if defined?(EnjuCirculation) %>
16
- <% unless params[:mode] == 'add' %>
17
- <% if manifestation.is_reservable_by?(current_user) %>
18
- <%- reserve = manifestation.is_reserved_by?(current_user) -%>
19
- <%- if reserve -%>
20
- <%= link_to t('reserve.show'), reserve -%>
21
- <%- else -%>
22
- <%= link_to t('activerecord.models.reserve'), new_reserve_path(manifestation_id: manifestation.id) if can? :create, Reserve -%>
23
- <%- end -%>
24
- <% end %>
25
- <br />
27
+ <% end %>
28
+ <%= render 'manifestations/holding', manifestation: manifestation -%>
29
+ </td>
30
+ <% if signed_in? %>
31
+ <td id="edit_icons">
32
+ <% if defined?(EnjuCirculation) %>
33
+ <% unless params[:mode] == 'add' %>
34
+ <% if manifestation.is_reservable_by?(current_user) %>
35
+ <%- reserve = manifestation.is_reserved_by?(current_user) -%>
36
+ <%- if reserve -%>
37
+ <%= link_to t('reserve.show'), reserve -%>
38
+ <%- else -%>
39
+ <%= link_to t('activerecord.models.reserve'), new_reserve_path(manifestation_id: manifestation.id) if can? :create, Reserve -%>
40
+ <%- end -%>
26
41
  <% end %>
42
+ <br />
27
43
  <% end %>
28
- <%- if can? :update, manifestation -%>
29
- <% unless params[:mode] == 'add' %>
30
- <%= link_to image_tag('icons/book_edit.png', size: '16x16', alt: t('page.edit')), edit_manifestation_path(manifestation) -%>
44
+ <% end %>
45
+ <%- if can? :update, manifestation -%>
46
+ <% unless params[:mode] == 'add' %>
47
+ <% if manifestation.serial? && manifestation.series_master? %>
48
+ <%= link_to t('page.new_acquisition'), new_manifestation_path(parent_id: manifestation.id) %>
49
+ <% end %>
50
+ <%= link_to t('page.edit'), edit_manifestation_path(manifestation) -%>
51
+ <% else %>
52
+ <% case %>
53
+ <% when @parent %>
54
+ <%= link_to t('page.add'), new_manifestation_relationship_path(manifestation_id: @parent.id, child_id: manifestation.id) unless @parent.derived_manifestations.include?(manifestation) or @parent == manifestation -%>
55
+ <% when @item %>
56
+ <%= link_to t('page.change'), edit_item_path(@item, manifestation_id: manifestation.id) unless @item.manifestation == manifestation -%>
31
57
  <% else %>
32
- <% case %>
33
- <% when @parent %>
34
- <%= link_to t('page.add'), new_manifestation_relationship_path(manifestation_id: @parent.id, child_id: manifestation.id) unless @parent.derived_manifestations.include?(manifestation) or @parent == manifestation -%>
35
- <% when @item %>
36
- <%= link_to t('page.change'), edit_item_path(@item, manifestation_id: manifestation.id) unless @item.manifestation == manifestation -%>
37
- <% else %>
38
- <%= link_to image_tag('icons/arrow_divide.png', size: '16x16', alt: t('manifestation.add_derivation')), new_manifestation_path(parent_id: manifestation.id) -%>
39
- <% end %>
40
- <%- end -%>
58
+ <%= link_to image_tag('icons/arrow_divide.png', size: '16x16', alt: t('manifestation.add_derivation')), new_manifestation_path(parent_id: manifestation.id) -%>
59
+ <% end %>
41
60
  <%- end -%>
42
- </td>
43
- <% end %>
44
- </tr>
61
+ <%- end -%>
62
+ </td>
63
+ <% end %>
64
+ <% end %>
65
+ </tr>
@@ -12,6 +12,14 @@
12
12
  <%- end -%>
13
13
  </p>
14
14
  <% end %>
15
+ <% if defined?(EnjuBookmark) %>
16
+ <p>
17
+ <strong><%= t('page.tag') -%>:</strong>
18
+ <%- manifestation.tags.each do |tag| -%>
19
+ <%= link_to tag.name, manifestations_path(tag: tag.name) -%>
20
+ <%- end -%>
21
+ </p>
22
+ <% end %>
15
23
  </div>
16
24
  <div style="clear: both"></div>
17
25
  <div style="margin-top: 5px">
@@ -58,6 +58,14 @@
58
58
  <%= render 'manifestations/subject_detail', manifestation: manifestation %>
59
59
  <%= render 'manifestations/classification_detail', manifestation: manifestation %>
60
60
  <% end %>
61
+ <% if defined?(EnjuBookmark) %>
62
+ <tr>
63
+ <td><%= t('activerecord.models.tag') -%>:</td>
64
+ <td>
65
+ <%= render 'manifestations/tag_list', manifestation: manifestation -%>
66
+ </td>
67
+ </tr>
68
+ <% end %>
61
69
  <%- unless manifestation.serial? -%>
62
70
  <tr>
63
71
  <td><%= t('page.identifier') -%>:</td>
@@ -60,6 +60,14 @@
60
60
  <%= render 'manifestations/subject_detail', manifestation: manifestation %>
61
61
  <%= render 'manifestations/classification_detail', manifestation: manifestation %>
62
62
  <% end %>
63
+ <% if defined?(EnjuBookmark) %>
64
+ <tr>
65
+ <td><%= t('activerecord.models.tag') -%>:</td>
66
+ <td>
67
+ <%= render 'manifestations/tag_list', manifestation: manifestation -%>
68
+ </td>
69
+ </tr>
70
+ <% end %>
63
71
  <%- unless manifestation.serial? -%>
64
72
  <tr>
65
73
  <td><%= t('page.identifier') -%>:</td>
@@ -51,7 +51,26 @@
51
51
  </td>
52
52
  <% end %>
53
53
  </tr>
54
+ <% if can? :update, item %>
55
+ <script>
56
+ $(function(){
57
+ $('a#item_identifier_item_<%= item.id %>').data(
58
+ 'powertip',
59
+ 'item_identifier: <%= item.item_identifier %>'
60
+ );
61
+ $('a#item_identifier_item_<%= item.id %>').powerTip({
62
+ placement: 'e',
63
+ mouseOnToPopup: true
64
+ });
65
+ });
66
+ </script>
67
+ <%= render 'items/tooltip', item: item %>
68
+ <% end %>
54
69
  <%- end -%>
55
70
  </table>
71
+
72
+ <%- if can? :create, Item -%>
73
+ <p><%= link_to t('page.new', model: t('activerecord.models.item')), new_item_path(manifestation_id: manifestation.id) -%></p>
74
+ <%- end -%>
56
75
  </div>
57
76
  <% end %>
@@ -5,4 +5,7 @@
5
5
  <% if can? :update, @parent %>
6
6
  <li><%= link_to t('page.edit'), edit_manifestation_path(@parent) %></li>
7
7
  <% end %>
8
+ <% if can? :delete, @parent %>
9
+ <li><%= link_to t('page.destroy'), manifestation_path(@parent), data: {confirm: t('page.are_you_sure')}, method: :delete %></li>
10
+ <% end %>
8
11
  </ul>
@@ -5,6 +5,9 @@ atom_feed(url: manifestations_url(format: :atom)) do |feed|
5
5
  @manifestations.each do |manifestation|
6
6
  feed.entry(manifestation) do |entry|
7
7
  entry.title(manifestation.original_title)
8
+ if defined?(EnjuBookmark)
9
+ entry.content(manifestation.tags.join(' '), type: 'html')
10
+ end
8
11
 
9
12
  manifestation.creators.readable_by(current_user).each do |agent|
10
13
  entry.author do |author|
@@ -62,7 +62,14 @@
62
62
  <%= paginate(@manifestations) -%>
63
63
  <br />
64
64
  </div>
65
-
65
+ <% if defined?(EnjuBookmark) %>
66
+ <div id="tag_cloud">
67
+ <h3 class="resource_title"><%= t('activerecord.models.tag') -%></h3>
68
+ <div id="tag_cloud_list"></div>
69
+ <%= image_tag 'spinner.gif', id: 'spinner_tag_cloud',
70
+ style: 'padding-bottom: 15px; padding-left: 40px;' -%>
71
+ </div>
72
+ <% end %>
66
73
  <%- else -%>
67
74
  <!-- TODO: 検索結果が少ない場合にも表示させる -->
68
75
  <%= render 'manifestations/not_found' -%>
@@ -77,8 +84,31 @@
77
84
  <% if @parent and can?(:update, @parent) %>
78
85
  <%= render 'submenu_parent' %>
79
86
  <% end %>
87
+ <h3><%= link_to h("#{t('page.total')}: #{@count[:query_result]}"), url_for(params.merge(action: 'index', view: nil, carrier_type: nil, library: nil, language: nil, subject: nil, only_path: true)) -%></h3>
88
+ <%- if @manifestations.total_count > 0 -%>
89
+ <%= render 'manifestations/all_facet' -%>
90
+ <%- end -%>
91
+ <div>
92
+ <%- if params[:library_id].blank? -%>
93
+ <%= link_to((image_tag 'icons/feed.png', size: '16x16', alt: t('page.feed'), class: 'icon'), url_for(params.merge(format: :rss, page: nil, library_id: nil, only_path: true))) -%> <%= link_to t('page.search_result_feed'), url_for(params.merge(format: :rss, page: nil, library_id: nil, commit: nil, only_path: true)) -%>
94
+ <%- else -%>
95
+ <%= link_to((image_tag 'icons/feed.png', size: '16x16', alt: t('page.feed'), class: 'icon'), url_for(params.merge(format: :rss, page: nil, only_path: true))) -%> <%= link_to t('page.search_result_feed'), url_for(params.merge(format: :rss, page: nil, commit: nil, only_path: true)) -%>
96
+ <%- end -%>
97
+ </div>
80
98
  </div>
81
99
 
100
+ <% if defined?(EnjuBookmark) %>
101
+ <script type="text/javascript">
102
+ window.onload = function() {
103
+ $("#tag_cloud_list").load('<%= url_for(params.merge(view: "tag_cloud", only_path: true)) -%>', hideTagCloudSpinner);
104
+ }
105
+
106
+ function hideTagCloudSpinner(){
107
+ $("#spinner_tag_cloud").hide();
108
+ }
109
+ </script>
110
+ <% end %>
111
+
82
112
  <% if @manifestation_ids and @search_query %>
83
113
  <%= render 'session_ids' %>
84
114
  <% end %>