blacklight-spotlight 3.0.0.alpha.8 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/app/assets/images/blacklight/arrow-alt-circle-left.svg +1 -0
  4. data/app/assets/images/blacklight/arrow-alt-circle-right.svg +1 -0
  5. data/app/assets/javascripts/spotlight/admin/{add_new_page_button.js → add_new_button.js} +7 -0
  6. data/app/assets/javascripts/spotlight/admin/block_mixins/autocompleteable.js +4 -4
  7. data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +55 -1
  8. data/app/assets/javascripts/spotlight/admin/blocks/browse_group_categories_block.js +88 -0
  9. data/app/assets/javascripts/spotlight/admin/blocks/pages_block.js +1 -1
  10. data/app/assets/javascripts/spotlight/admin/blocks/solr_documents_base_block.js +1 -1
  11. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -2
  12. data/app/assets/javascripts/spotlight/admin/crop.es6 +11 -0
  13. data/app/assets/javascripts/spotlight/admin/croppable.js +1 -1
  14. data/app/assets/javascripts/spotlight/admin/index.js +0 -2
  15. data/app/assets/javascripts/spotlight/admin/search_typeahead.js +2 -2
  16. data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
  17. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +11 -3
  18. data/app/assets/javascripts/spotlight/user/browse_group_categories.js +59 -0
  19. data/app/assets/javascripts/spotlight/user/index.js +1 -0
  20. data/app/assets/stylesheets/spotlight/_accessibility.scss +1 -1
  21. data/app/assets/stylesheets/spotlight/_breadcrumbs.scss +8 -0
  22. data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
  23. data/app/assets/stylesheets/spotlight/_catalog.scss +6 -6
  24. data/app/assets/stylesheets/spotlight/_curation.scss +6 -0
  25. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +214 -83
  26. data/app/assets/stylesheets/spotlight/_header.scss +1 -1
  27. data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
  28. data/app/assets/stylesheets/spotlight/_pages.scss +10 -5
  29. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
  30. data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -0
  31. data/app/assets/stylesheets/spotlight/_translations.scss +7 -0
  32. data/app/assets/stylesheets/spotlight/browse_group_categories_block.scss +69 -0
  33. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +1 -2
  34. data/app/controllers/concerns/spotlight/search_helper.rb +2 -8
  35. data/app/controllers/spotlight/appearances_controller.rb +0 -12
  36. data/app/controllers/spotlight/browse_controller.rb +7 -3
  37. data/app/controllers/spotlight/catalog_controller.rb +1 -1
  38. data/app/controllers/spotlight/concerns/application_controller.rb +13 -2
  39. data/app/controllers/spotlight/exhibits_controller.rb +2 -3
  40. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  41. data/app/controllers/spotlight/groups_controller.rb +80 -0
  42. data/app/controllers/spotlight/pages_controller.rb +6 -9
  43. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  44. data/app/controllers/spotlight/searches_controller.rb +7 -19
  45. data/app/controllers/spotlight/translations_controller.rb +46 -0
  46. data/app/helpers/spotlight/application_helper.rb +1 -1
  47. data/app/helpers/spotlight/crop_helper.rb +4 -1
  48. data/app/helpers/spotlight/crud_link_helpers.rb +1 -1
  49. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  50. data/app/jobs/spotlight/add_uploads_from_csv.rb +30 -5
  51. data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
  52. data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
  53. data/app/models/concerns/spotlight/translatables.rb +17 -1
  54. data/app/models/sir_trevor_rails/blocks/browse_group_categories_block.rb +25 -0
  55. data/app/models/spotlight/ability.rb +2 -0
  56. data/app/models/spotlight/about_page.rb +3 -1
  57. data/app/models/spotlight/blacklight_configuration.rb +2 -1
  58. data/app/models/spotlight/contact.rb +1 -1
  59. data/app/models/spotlight/custom_field.rb +3 -3
  60. data/app/models/spotlight/exhibit.rb +18 -4
  61. data/app/models/spotlight/feature_page.rb +3 -1
  62. data/app/models/spotlight/featured_image.rb +29 -12
  63. data/app/models/spotlight/group.rb +22 -0
  64. data/app/models/spotlight/group_member.rb +11 -0
  65. data/app/models/spotlight/home_page.rb +3 -1
  66. data/app/models/spotlight/main_navigation.rb +2 -2
  67. data/app/models/spotlight/masthead.rb +1 -1
  68. data/app/models/spotlight/page.rb +5 -1
  69. data/app/models/spotlight/page_configurations.rb +6 -0
  70. data/app/models/spotlight/page_content.rb +2 -0
  71. data/app/models/spotlight/resources/csv_upload.rb +2 -1
  72. data/app/models/spotlight/resources/iiif_manifest.rb +8 -6
  73. data/app/models/spotlight/resources/upload.rb +1 -1
  74. data/app/models/spotlight/search.rb +10 -1
  75. data/app/models/spotlight/solr_document_sidecar.rb +7 -5
  76. data/app/models/spotlight/temporary_image.rb +8 -0
  77. data/app/services/spotlight/exhibit_import_export_service.rb +482 -0
  78. data/app/services/spotlight/solr_document_builder.rb +1 -0
  79. data/app/values/custom_field_name.rb +1 -0
  80. data/app/views/catalog/_save_search.html.erb +1 -1
  81. data/app/views/spotlight/about_pages/_empty.html.erb +5 -5
  82. data/app/views/spotlight/browse/_search.html.erb +5 -3
  83. data/app/views/spotlight/browse/_search_title.html.erb +2 -1
  84. data/app/views/spotlight/browse/index.html.erb +13 -0
  85. data/app/views/spotlight/catalog/_document.html.erb +2 -4
  86. data/app/views/spotlight/catalog/index.iiif_json.jbuilder +22 -0
  87. data/app/views/spotlight/contacts/_form.html.erb +1 -1
  88. data/app/views/spotlight/feature_pages/_empty.html.erb +5 -5
  89. data/app/views/spotlight/featured_images/_form.html.erb +1 -1
  90. data/app/views/spotlight/featured_images/_upload_form.html.erb +1 -1
  91. data/app/views/spotlight/home_pages/_empty.html.erb +3 -3
  92. data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
  93. data/app/views/spotlight/pages/_form.html.erb +2 -2
  94. data/app/views/spotlight/searches/_form.html.erb +13 -0
  95. data/app/views/spotlight/searches/_group.html.erb +27 -0
  96. data/app/views/spotlight/searches/_search.html.erb +1 -0
  97. data/app/views/spotlight/searches/index.html.erb +58 -17
  98. data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
  99. data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
  100. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
  101. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +44 -0
  102. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
  103. data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
  104. data/app/views/spotlight/translations/_general.html.erb +7 -7
  105. data/app/views/spotlight/translations/_groups.html.erb +34 -0
  106. data/app/views/spotlight/translations/_import.html.erb +24 -0
  107. data/app/views/spotlight/translations/_metadata.html.erb +1 -1
  108. data/app/views/spotlight/translations/_page.html.erb +5 -5
  109. data/app/views/spotlight/translations/_pages.html.erb +4 -4
  110. data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
  111. data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
  112. data/app/views/spotlight/translations/edit.html.erb +14 -6
  113. data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
  114. data/config/i18n-tasks.yml +7 -0
  115. data/config/locales/spotlight.ar.yml +47 -24
  116. data/config/locales/spotlight.en.yml +182 -127
  117. data/config/routes.rb +16 -1
  118. data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
  119. data/db/migrate/20210113092223_create_spotlight_groups.rb +23 -0
  120. data/lib/generators/spotlight/install_generator.rb +23 -2
  121. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
  122. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +3 -1
  123. data/lib/spotlight/engine.rb +27 -3
  124. data/lib/spotlight/upload_field_config.rb +1 -0
  125. data/lib/spotlight/version.rb +1 -1
  126. data/spec/controllers/spotlight/about_pages_controller_spec.rb +3 -3
  127. data/spec/controllers/spotlight/browse_controller_spec.rb +24 -1
  128. data/spec/controllers/spotlight/catalog_controller_spec.rb +1 -1
  129. data/spec/controllers/spotlight/contacts_controller_spec.rb +2 -2
  130. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +11 -0
  131. data/spec/controllers/spotlight/groups_controller_spec.rb +103 -0
  132. data/spec/controllers/spotlight/home_pages_controller_spec.rb +2 -2
  133. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
  134. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +2 -2
  135. data/spec/controllers/spotlight/searches_controller_spec.rb +10 -3
  136. data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
  137. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +1 -1
  138. data/spec/examples.txt +1437 -1389
  139. data/spec/factories/featured_images.rb +4 -0
  140. data/spec/factories/group.rb +17 -0
  141. data/spec/factories/searches.rb +11 -1
  142. data/spec/features/add_contacts_spec.rb +1 -1
  143. data/spec/features/browse_category_admin_spec.rb +39 -7
  144. data/spec/features/browse_category_navigation_spec.rb +44 -0
  145. data/spec/features/browse_category_spec.rb +2 -2
  146. data/spec/features/catalog_spec.rb +2 -2
  147. data/spec/features/create_exhibit_spec.rb +5 -4
  148. data/spec/features/dashboard_spec.rb +7 -7
  149. data/spec/features/edit_search_fields_spec.rb +2 -2
  150. data/spec/features/exhibits/administration_spec.rb +3 -3
  151. data/spec/features/exhibits/edit_metadata_fields_spec.rb +1 -1
  152. data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
  153. data/spec/features/exhibits/translation_editing_spec.rb +57 -8
  154. data/spec/features/home_page_spec.rb +13 -4
  155. data/spec/features/item_admin_spec.rb +4 -4
  156. data/spec/features/javascript/about_page_admin_spec.rb +1 -1
  157. data/spec/features/javascript/block_controls_spec.rb +3 -1
  158. data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +64 -0
  159. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
  160. data/spec/features/javascript/browse_group_admin_spec.rb +45 -0
  161. data/spec/features/javascript/edit_in_place_spec.rb +3 -3
  162. data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
  163. data/spec/features/javascript/search_config_admin_spec.rb +1 -1
  164. data/spec/features/report_a_problem_spec.rb +6 -5
  165. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -3
  166. data/spec/helpers/spotlight/pages_helper_spec.rb +2 -2
  167. data/spec/i18n_spec.rb +0 -2
  168. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
  169. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
  170. data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +41 -0
  171. data/spec/models/solr_document_spec.rb +2 -3
  172. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
  173. data/spec/models/spotlight/exhibit_spec.rb +18 -2
  174. data/spec/models/spotlight/featured_image_spec.rb +27 -0
  175. data/spec/models/spotlight/group_spec.rb +19 -0
  176. data/spec/models/spotlight/main_navigation_spec.rb +1 -1
  177. data/spec/models/spotlight/page_spec.rb +6 -1
  178. data/spec/models/spotlight/resources/upload_spec.rb +43 -79
  179. data/spec/models/spotlight/role_spec.rb +3 -3
  180. data/spec/models/spotlight/search_spec.rb +30 -3
  181. data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +168 -23
  182. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
  183. data/spec/services/spotlight/solr_document_builder_spec.rb +1 -1
  184. data/spec/spec_helper.rb +1 -1
  185. data/spec/support/features/test_features_helpers.rb +15 -0
  186. data/spec/test_app_templates/Gemfile.extra +1 -3
  187. data/spec/test_app_templates/catalog_controller.rb +6 -3
  188. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  189. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +1 -1
  190. data/spec/views/spotlight/browse/index.html.erb_spec.rb +2 -0
  191. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -1
  192. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +6 -6
  193. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
  194. data/spec/views/spotlight/pages/show.html.erb_spec.rb +1 -0
  195. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
  196. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +7 -8
  197. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
  198. data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
  199. data/vendor/assets/javascripts/tiny-slider.js +3218 -0
  200. data/vendor/assets/stylesheets/tiny-slider.css +1 -0
  201. metadata +399 -284
  202. data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
  203. data/app/serializers/spotlight/featured_image_representer.rb +0 -29
  204. data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
  205. data/app/serializers/spotlight/page_representer.rb +0 -33
  206. data/vendor/assets/javascripts/handlebars-v1.3.0.js +0 -2746
@@ -9,6 +9,7 @@
9
9
  <div class="category-caption">
10
10
  <p class="category-title">
11
11
  <%= search.title %>
12
+ <% if search.subtitle.present? %><span class="category-subtitle"><%= search.subtitle %></span><% end %>
12
13
  </p>
13
14
 
14
15
  <% if browse_block.display_item_counts? %>
@@ -0,0 +1,44 @@
1
+ <% if browse_group_categories_block.groups? %>
2
+ <% browse_group_categories_block.groups.each do |group| %>
3
+ <div class="browse-group-categories-block" data-browse-group-categories-count="<%= group.searches.count %>">
4
+ <div class="d-flex flex-column flex-md-row py-2">
5
+ <div class="d-flex justify-content-between align-items-end">
6
+ <h2 class="m-0"><%= group.title %></h2>
7
+ <div class="pl-5">
8
+ <%= link_to 'View all', exhibit_browse_groups_path(current_exhibit, group) %>
9
+ </div>
10
+ </div>
11
+ <% if group.searches.count > 1 %>
12
+ <ul class="browse-group-categories-controls p-0 pt-2 pt-md-0 ml-md-auto mb-0 d-flex justify-content-center align-items-end">
13
+ <li class="prev px-1">
14
+ <%= blacklight_icon 'arrow-alt-circle-left' %>
15
+ </li>
16
+ <li class="next px-1">
17
+ <%= blacklight_icon 'arrow-alt-circle-right' %>
18
+ </li>
19
+ </ul>
20
+ <% end %>
21
+ </div>
22
+ <div class="spotlight-flexbox browse-categories categories-<%= [group.searches.count, (@page.display_sidebar? ? 3 : 4)].min %>" data-browse-group-categories-carousel data-sidebar='<%= @page.display_sidebar? %>' data-browse-group-categories-count="<%= group.searches.count %>">
23
+ <% group.searches.published.each_with_index do |search, index| %>
24
+ <div class="box category-1 justify-content-center justify-content-md-start">
25
+ <%= link_to spotlight.exhibit_browse_group_path(current_exhibit, group, search), class: 'justify-content-center' do %>
26
+ <div class="browse-category" style='background-image: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)), url("<%= search.thumbnail.iiif_url if search.thumbnail %>")'>
27
+ <div class="category-caption">
28
+ <p class="category-title">
29
+ <%= search.title %>
30
+ <% if search.subtitle.present? %><span class="category-subtitle"><%= search.subtitle %></span><% end %>
31
+ </p>
32
+
33
+ <% if browse_group_categories_block.display_item_counts? %>
34
+ <span class="item-count"><%= t(:'.items', count: search.count) %></span>
35
+ <% end %>
36
+ </div>
37
+ </div>
38
+ <% end %>
39
+ </div>
40
+ <% end %>
41
+ </div>
42
+ </div>
43
+ <% end %>
44
+ <% end %>
@@ -4,7 +4,13 @@
4
4
  <% uploaded_items_block.files.each do |file| %>
5
5
  <div class="box" data-id="<%= file[:id] %>">
6
6
  <div class="contents">
7
- <img class="img-thumbnail" src='<%= file[:url] %>' alt='' />
7
+ <% if file[:link].present? %>
8
+ <%= link_to file[:link], rel: 'ugc' do %>
9
+ <%= image_tag file[:url], class: 'img-thumbnail', alt: file[:caption] %>
10
+ <% end %>
11
+ <% else %>
12
+ <%= image_tag file[:url], class: 'img-thumbnail', alt: '', role: 'presentation' %>
13
+ <% end %>
8
14
  <% if file[:caption].present? %>
9
15
  <div class="caption">
10
16
  <%= file[:caption] %>
@@ -6,12 +6,12 @@
6
6
  <div class="row">
7
7
  <div class="col-4 text-right">
8
8
  <span class="browse-translations-header">
9
- <%= t :'spotlight.exhibits.translations.browse_categories.default_language_column_label' %>
9
+ <%= t :'.default_language_column_label' %>
10
10
  </span>
11
11
  </div>
12
12
  <div class="col-7">
13
13
  <span class="browse-translations-header">
14
- <%= t :'spotlight.exhibits.translations.browse_categories.translation_column_label', language: t("locales.#{@language}") %>
14
+ <%= t :'.translation_column_label', language: t("locales.#{@language}") %>
15
15
  </span>
16
16
  </div>
17
17
  </div>
@@ -36,12 +36,38 @@
36
36
  </div>
37
37
  <% end %>
38
38
 
39
+ <% subtitle_translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{search.slug}.subtitle", locale: @language) %>
40
+ <div data-translation-progress-item="true" class="row form-group browse-category-subtitle">
41
+ <div class="col-7 offset-4">
42
+ <%= f.fields_for :translations, subtitle_translation do |translation_fields| %>
43
+ <%= button_tag 'type' => 'button', class: 'btn btn-text collapse-toggle collapsed translation-subtitle-toggle', 'data-toggle': 'collapse', 'data-target': "#browse_category_subtitle_#{search.id}", 'aria-expanded': 'false', 'aria-controls': "#browse_category_subtitle_#{search.id}" do %>
44
+ <%= translation_fields.label :value, t(:'.subtitle_label') %>
45
+ <% end %>
46
+ <span class="collapse-chevron">❯</span>
47
+
48
+ <%= translation_fields.hidden_field :key %>
49
+ <%= translation_fields.hidden_field :locale %>
50
+ <div id="browse_category_subtitle_<%= search.id %>" class="card card-body collapse panel-translation">
51
+ <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
52
+ <small class="form-text text-muted"><%= search[:subtitle] %></small>
53
+ </div>
54
+ <% end %>
55
+ </div>
56
+ <div class="col-1">
57
+ <% if subtitle_translation.value.present? %>
58
+ <span data-translation-present="true">
59
+ <%= blacklight_icon('check', classes: 'translation-complete') %>
60
+ </span>
61
+ <% end %>
62
+ </div>
63
+ </div>
64
+
39
65
  <% description_translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{search.slug}.long_description", locale: @language) %>
40
66
  <div data-translation-progress-item="true" class="row form-group browse-category-description">
41
67
  <div class="col-7 offset-4">
42
68
  <%= f.fields_for :translations, description_translation do |translation_fields| %>
43
69
  <%= button_tag 'type' => 'button', class: 'btn btn-text collapse-toggle collapsed translation-description-toggle', 'data-toggle': 'collapse', 'data-target': "#browse_category_description_#{search.id}", 'aria-expanded': 'false', 'aria-controls': "#browse_category_description_#{search.id}" do %>
44
- <%= translation_fields.label :value, t(:'spotlight.exhibits.translations.browse_categories.description_label') %>
70
+ <%= translation_fields.label :value, t(:'.description_label') %>
45
71
  <% end %>
46
72
  <span class="collapse-chevron">❯</span>
47
73
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div class='translation-basic-settings'>
7
7
  <h2 class='translation-subheading'>
8
- <%= t('spotlight.exhibits.translations.general.basic_settings.label') %>
8
+ <%= t('.basic_settings.label') %>
9
9
  </h2>
10
10
 
11
11
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{current_exhibit.slug}.title", locale: @language) %>
@@ -13,7 +13,7 @@
13
13
  <%= translation_fields.hidden_field :key %>
14
14
  <%= translation_fields.hidden_field :locale %>
15
15
  <div data-translation-progress-item='true' class='row form-group translation-form translation-basic-settings-title'>
16
- <%= translation_fields.label :value, t('spotlight.exhibits.translations.general.basic_settings.title'), class: 'col-form-label col-12 col-sm-2' %>
16
+ <%= translation_fields.label :value, t('.basic_settings.title'), class: 'col-form-label col-12 col-sm-2' %>
17
17
  <div class='col-11 col-sm-9 card card-body panel-translation'>
18
18
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
19
19
  <small class="form-text text-muted">
@@ -34,7 +34,7 @@
34
34
  <%= translation_fields.hidden_field :key %>
35
35
  <%= translation_fields.hidden_field :locale %>
36
36
  <div data-translation-progress-item='true' class='row form-group translation-form translation-basic-settings-subtitle'>
37
- <%= translation_fields.label :value, t('spotlight.exhibits.translations.general.basic_settings.subtitle'), class: 'col-form-label col-12 col-sm-2' %>
37
+ <%= translation_fields.label :value, t('.basic_settings.subtitle'), class: 'col-form-label col-12 col-sm-2' %>
38
38
  <div class='col-11 col-sm-9 card card-body panel-translation'>
39
39
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
40
40
  <small class="form-text text-muted">
@@ -55,7 +55,7 @@
55
55
  <%= translation_fields.hidden_field :key %>
56
56
  <%= translation_fields.hidden_field :locale %>
57
57
  <div data-translation-progress-item='true' class='row form-group translation-form translation-basic-settings-description'>
58
- <%= translation_fields.label :value, t('spotlight.exhibits.translations.general.basic_settings.description'), class: 'col-form-label col-12 col-sm-2' %>
58
+ <%= translation_fields.label :value, t('.basic_settings.description'), class: 'col-form-label col-12 col-sm-2' %>
59
59
  <div class='col-11 col-sm-9 card card-body panel-translation'>
60
60
  <%= translation_fields.text_area_without_bootstrap :value, class: 'form-control' %>
61
61
  <small class="form-text text-muted">
@@ -74,7 +74,7 @@
74
74
  </div>
75
75
  <div class='translation-main-menu'>
76
76
  <h2 class='translation-subheading'>
77
- <%= t('spotlight.exhibits.translations.general.main_menu.label') %>
77
+ <%= t('.main_menu.label') %>
78
78
  </h2>
79
79
 
80
80
  <% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "spotlight.curation.nav.home", locale: @language) %>
@@ -82,7 +82,7 @@
82
82
  <%= translation_fields.hidden_field :key %>
83
83
  <%= translation_fields.hidden_field :locale %>
84
84
  <div data-translation-progress-item='true' class='row form-group translation-form translation-main-menu-home'>
85
- <%= translation_fields.label :value, t('spotlight.exhibits.translations.general.main_menu.home'), class: 'col-form-label col-12 col-sm-2' %>
85
+ <%= translation_fields.label :value, t('.main_menu.home'), class: 'col-form-label col-12 col-sm-2' %>
86
86
  <div class='col-11 col-sm-9 card card-body panel-translation'>
87
87
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
88
88
  <small class="form-text text-muted">
@@ -105,7 +105,7 @@
105
105
  <%= translation_fields.hidden_field :key %>
106
106
  <%= translation_fields.hidden_field :locale %>
107
107
  <div data-translation-progress-item='true' class='row form-group translation-form translation-main-menu-<%= navigation.nav_type %>'>
108
- <%= translation_fields.label :value, t("spotlight.exhibits.translations.general.main_menu.#{navigation.nav_type}", default: navigation.default_label), class: 'col-form-label col-12 col-sm-2' %>
108
+ <%= translation_fields.label :value, t(".main_menu.#{navigation.nav_type}", default: navigation.default_label), class: 'col-form-label col-12 col-sm-2' %>
109
109
  <div class='col-11 col-sm-9 card card-body panel-translation'>
110
110
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
111
111
  <small class="form-text text-muted">
@@ -0,0 +1,34 @@
1
+ <div role="tabpanel" class="tab-pane <%= 'active' if @tab == 'groups' %>" id="groups">
2
+ <%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %>
3
+ <% # Add hidden fields for the language and tab so the redirect knows how to come back here %>
4
+ <%= hidden_field_tag :language, @language %>
5
+ <%= hidden_field_tag :tab, 'groups' %>
6
+
7
+ <% current_exhibit.groups.each do |group| %>
8
+ <% title_translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{group.slug}.title", locale: @language) %>
9
+ <%= f.fields_for :translations, title_translation do |translation_fields| %>
10
+ <%= translation_fields.hidden_field :key %>
11
+ <%= translation_fields.hidden_field :locale %>
12
+ <div data-translation-progress-item="true" class="row form-group browse-group-title">
13
+ <%= translation_fields.label :value, group[:title], class: 'col-form-label col-12 col-sm-2' %>
14
+ <div class="col-11 col-sm-9">
15
+ <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
16
+ </div>
17
+ <div class="col-1">
18
+ <% if title_translation.value.present? %>
19
+ <span data-translation-present="true">
20
+ <%= blacklight_icon('check', classes: 'translation-complete') %>
21
+ </span>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+ <% end %>
27
+
28
+ <div class="form-actions">
29
+ <div class="primary-actions">
30
+ <%= f.submit nil, class: 'btn btn-primary' %>
31
+ </div>
32
+ </div>
33
+ <% end %>
34
+ </div>
@@ -0,0 +1,24 @@
1
+ <% if can? :import_translations, Spotlight::Exhibit %>
2
+ <div class="row col-md-12 mb-5">
3
+ <h2><%= t(:'.header') %></h2>
4
+ <p class="instructions"><%= t(:'.description') %></p>
5
+
6
+ <%= bootstrap_form_for current_exhibit, url: spotlight.import_exhibit_translations_path(current_exhibit), html: { class: 'row col-md-12 align-items-center clearfix mb-3', multipart: true } do |f| %>
7
+ <%= f.label :value, t(".import_label"), class: 'col-form-label col-12 col-sm-3 pl-0 translation-import-export-label' %>
8
+
9
+ <div class="input-group col px-0">
10
+ <%= file_field_tag :file, class: 'form-control' %>
11
+ <%= hidden_field_tag :tab, 'import' %>
12
+ <div class="input-group-append">
13
+ <%= f.submit t(:'.import_submit'), class: 'btn btn-primary' %>
14
+ </div>
15
+ </div>
16
+ <% end %>
17
+ <div class="row col-md-12 align-items-center">
18
+ <%= content_tag :span, t(".export_label"), class: 'col-form-label col-12 col-sm-3 pl-0 translation-import-export-label' %>
19
+
20
+ <%= link_to t(:'.export_current_locale', language: t(:"locales.#{@language}")), spotlight.exhibit_translations_path(current_exhibit, format: "yaml", locale: @language), class: 'btn btn-primary mr-3' %>
21
+ <%= link_to t(:'.export_default_locale', language: t(:"locales.#{I18n.default_locale}")), spotlight.exhibit_translations_path(current_exhibit, format: "yaml", locale: I18n.default_locale), class: 'btn btn-primary' %>
22
+ </div>
23
+ </div>
24
+ <% end %>
@@ -32,7 +32,7 @@
32
32
  <% if current_exhibit.custom_fields.any? %>
33
33
  <div class='translation-exhibit-specific-fields'>
34
34
  <h2 class='translation-subheading'>
35
- <%= t('spotlight.exhibits.translations.metadata.exhibit_specific_fields.label') %>
35
+ <%= t('.exhibit_specific_fields.label') %>
36
36
  </h2>
37
37
 
38
38
  <% current_exhibit.custom_fields.each do |custom_field| %>
@@ -22,8 +22,8 @@
22
22
  </p>
23
23
  <% else %>
24
24
  <span class="new-translated-page">
25
- <%= t('spotlight.exhibits.translations.pages.no_translated_page') %>
26
- <%= link_to(t('spotlight.exhibits.translations.pages.new'), polymorphic_path([:clone, current_exhibit, page], language: @language)) %>
25
+ <%= t('.no_translated_page') %>
26
+ <%= link_to(t('.new'), polymorphic_path([:clone, current_exhibit, page], language: @language)) %>
27
27
  <span>
28
28
  <% end %>
29
29
  </td>
@@ -36,11 +36,11 @@
36
36
  </td>
37
37
  <td class="text-center">
38
38
  <% if translated_page %>
39
- <%= link_to(t('spotlight.exhibits.translations.pages.edit'), polymorphic_path([:edit, current_exhibit, translated_page], locale: @language)) %> &middot;
40
- <%= link_to(t('spotlight.exhibits.translations.pages.recreate'), polymorphic_path([:clone, current_exhibit, page], language: @language), data: { confirm: t('spotlight.exhibits.translations.pages.recreate_are_you_sure') }) %>
39
+ <%= link_to(t('.edit'), polymorphic_path([:edit, current_exhibit, translated_page], locale: @language)) %> &middot;
40
+ <%= link_to(t('.recreate'), polymorphic_path([:clone, current_exhibit, page], language: @language), data: { confirm: t('.recreate_are_you_sure') }) %>
41
41
  <% if page.feature_page? || page.about_page? %>
42
42
  &middot;
43
- <%= link_to(t('spotlight.exhibits.translations.pages.destroy'), polymorphic_path([current_exhibit, translated_page], locale: @language), method: :delete, data: { confirm: t('spotlight.exhibits.translations.pages.destroy_are_you_sure') }) %>
43
+ <%= link_to(t('.destroy'), polymorphic_path([current_exhibit, translated_page], locale: @language), method: :delete, data: { confirm: t('.destroy_are_you_sure') }) %>
44
44
  <% end %>
45
45
  <% end %>
46
46
  </td>
@@ -1,10 +1,10 @@
1
1
  <div role="tabpanel" class="tab-pane <%= 'active' if @tab == 'pages' %>" id="pages">
2
- <p class="instructions"><%= t('spotlight.exhibits.translations.pages.help_html') %></p>
2
+ <p class="instructions"><%= t('.help_html') %></p>
3
3
 
4
4
  <%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, :pages]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %>
5
5
  <div class="translation-home-page-settings">
6
6
  <h2 class="translation-subheading">
7
- <%= t('spotlight.exhibits.translations.pages.home_page.label') %>
7
+ <%= t('.home_page.label') %>
8
8
  </h2>
9
9
  <%= render 'pages_table', pages: [current_exhibit.home_page], f: f %>
10
10
  </div>
@@ -12,7 +12,7 @@
12
12
  <% if current_exhibit.feature_pages.any? %>
13
13
  <div class="translation-feature-page-settings">
14
14
  <h2 class="translation-subheading">
15
- <%= t('spotlight.exhibits.translations.pages.feature_pages.label') %>
15
+ <%= t('.feature_pages.label') %>
16
16
  </h2>
17
17
 
18
18
  <%= render 'pages_table', pages: current_exhibit.feature_pages.for_default_locale, f: f %>
@@ -22,7 +22,7 @@
22
22
  <% if current_exhibit.about_pages.any? %>
23
23
  <div class="translation-about-page-settings">
24
24
  <h2 class="translation-subheading">
25
- <%= t('spotlight.exhibits.translations.pages.about_pages.label') %>
25
+ <%= t('.about_pages.label') %>
26
26
  </h2>
27
27
 
28
28
  <%= render 'pages_table', pages: current_exhibit.about_pages.for_default_locale, f: f %>
@@ -1,11 +1,11 @@
1
1
  <table class="table table-striped">
2
2
  <thead>
3
3
  <tr>
4
- <th><%= t('spotlight.exhibits.translations.pages.table_header.last_updated', language: t(:"locales.#{I18n.default_locale}")) %></th>
5
- <th class="text-center"><%= t('spotlight.exhibits.translations.pages.table_header.default_published') %></th>
6
- <th><%= t('spotlight.exhibits.translations.pages.table_header.last_updated', language: t(:"locales.#{@language}")) %></th>
7
- <th class='text-center'><%= t('spotlight.exhibits.translations.pages.table_header.language_published') %></th>
8
- <th class='text-center'><%= t('spotlight.exhibits.translations.pages.table_header.actions') %></th>
4
+ <th><%= t('.header.last_updated', language: t(:"locales.#{I18n.default_locale}")) %></th>
5
+ <th class="text-center"><%= t('.header.default_published') %></th>
6
+ <th><%= t('.header.last_updated', language: t(:"locales.#{@language}")) %></th>
7
+ <th class='text-center'><%= t('.header.language_published') %></th>
8
+ <th class='text-center'><%= t('.header.actions') %></th>
9
9
  </tr>
10
10
  </thead>
11
11
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div class='translation-field-based-search-fields'>
8
8
  <h2 class='translation-subheading'>
9
- <%= t('spotlight.exhibits.translations.search_fields.field_based_search_fields.label') %>
9
+ <%= t('.field_based_search_fields.label') %>
10
10
  </h2>
11
11
 
12
12
  <% current_exhibit.blacklight_config.search_fields.select { |_, config| config.if }.each do |key, search_config| %>
@@ -36,7 +36,7 @@
36
36
 
37
37
  <div class='translation-facet-fields'>
38
38
  <h2 class='translation-subheading'>
39
- <%= t('spotlight.exhibits.translations.search_fields.facet_fields.label') %>
39
+ <%= t('.facet_fields.label') %>
40
40
  </h2>
41
41
 
42
42
  <% current_exhibit.blacklight_config.facet_fields.each do |key, facet_config| %>
@@ -66,7 +66,7 @@
66
66
 
67
67
  <div class='translation-sort-fields'>
68
68
  <h2 class='translation-subheading'>
69
- <%= t('spotlight.exhibits.translations.search_fields.sort_fields.label') %>
69
+ <%= t('.sort_fields.label') %>
70
70
  </h2>
71
71
 
72
72
  <% current_exhibit.blacklight_config.sort_fields.each do |key, sort_config| %>
@@ -3,7 +3,7 @@
3
3
  <% end %>
4
4
 
5
5
  <div class='translation-edit-form'>
6
- <%= curation_page_title t('spotlight.exhibits.translations.title') %>
6
+ <%= curation_page_title t('.title') %>
7
7
 
8
8
  <div class='text-center'>
9
9
  <ul class='nav nav-pills'>
@@ -17,31 +17,38 @@
17
17
  </ul>
18
18
  </div>
19
19
 
20
+ <%= render partial: 'import' %>
21
+
20
22
  <div role="tabpanel">
21
23
  <ul class='nav nav-tabs' role="tablist">
22
24
  <li role="presentation" class="nav-item">
23
25
  <a href='#general' class="nav-link <%= 'active' if @tab.blank? %>" aria-controls="general" role="tab" data-toggle="tab" data-behavior="translation-progress">
24
- <%= t('spotlight.exhibits.translations.general.label') %> <span class="badge"></span>
26
+ <%= t('spotlight.translations.general.label') %> <span class="badge"></span>
25
27
  </a>
26
28
  </li>
27
29
  <li class="nav-item">
28
30
  <a href="#metadata" class="nav-link <%= 'active' if @tab == 'metadata' %>" aria-controls="metadata" role="tab" data-toggle="tab" data-behavior="translation-progress">
29
- <%= t('spotlight.exhibits.translations.metadata.label') %> <span class="badge"></span>
31
+ <%= t('spotlight.translations.metadata.label') %> <span class="badge"></span>
30
32
  </a>
31
33
  </li>
32
34
  <li class="nav-item" >
33
35
  <a href="#search_fields" class="nav-link <%= 'active' if @tab == 'search_fields' %>" aria-controls="search_fields" role="tab" data-toggle="tab" data-behavior="translation-progress">
34
- <%= t('spotlight.exhibits.translations.search_fields.label') %> <span class="badge"></span>
36
+ <%= t('spotlight.translations.search_fields.label') %> <span class="badge"></span>
35
37
  </a>
36
38
  </li>
37
39
  <li class="nav-item">
38
40
  <a href="#browse" class="nav-link <%= 'active' if @tab == 'browse' %>" aria-controls="browse" role="tab" data-toggle="tab" data-behavior="translation-progress">
39
- <%= t('spotlight.exhibits.translations.browse_categories.label') %> <span class="badge"></span>
41
+ <%= t('spotlight.translations.browse_categories.label') %> <span class="badge"></span>
42
+ </a>
43
+ </li>
44
+ <li class="nav-item">
45
+ <a href="#groups" class="nav-link <%= 'active' if @tab == 'groups' %>" aria-controls="groups" role="tab" data-toggle="tab" data-behavior="translation-progress">
46
+ <%= t('spotlight.translations.groups.label') %> <span class="badge"></span>
40
47
  </a>
41
48
  </li>
42
49
  <li class="nav-item">
43
50
  <a href="#pages" class="nav-link <%= 'active' if @tab == 'pages' %>" aria-controls="pages" role="tab" data-toggle="tab" data-behavior="translation-progress">
44
- <%= t('spotlight.exhibits.translations.pages.label') %> <span class="badge"></span>
51
+ <%= t('spotlight.translations.pages.label') %> <span class="badge"></span>
45
52
  </a>
46
53
  </li>
47
54
  </ul>
@@ -52,6 +59,7 @@
52
59
  <%= render 'search_fields' %>
53
60
  <%= render 'browse_categories' %>
54
61
  <%= render 'pages' %>
62
+ <%= render 'groups' %>
55
63
  </div>
56
64
  </div>
57
65
  </div>
@@ -0,0 +1,81 @@
1
+ json.set!(locale) do
2
+ json.set!(current_exhibit.slug) do
3
+ json.title(current_exhibit.translated_title(default: ''))
4
+ json.subtitle(current_exhibit.translated_subtitle(default: ''))
5
+ json.description(current_exhibit.translated_description(default: ''))
6
+ end
7
+
8
+ json.spotlight do
9
+ json.curation do
10
+ json.nav do
11
+ json.home(t(:'spotlight.curation.nav.home', default: ''))
12
+ end
13
+ end
14
+
15
+ json.catalog do
16
+ json.breadcrumb do
17
+ json.index(t(:'spotlight.catalog.breadcrumb.index', default: ''))
18
+ end
19
+ end
20
+ end
21
+
22
+ json.main_navigation do
23
+ current_exhibit.main_navigations.each do |navigation|
24
+ json.set!(navigation.nav_type) do
25
+ json.label(navigation.translated_label(default: navigation.default_label(default: '')))
26
+ end
27
+ end
28
+ end
29
+
30
+ json.blacklight do
31
+ json.search do
32
+ json.fields do
33
+ current_exhibit.blacklight_config.show_fields.each do |key, field_config|
34
+ if locale == I18n.default_locale
35
+ json.set!(key, field_config.label)
36
+ else
37
+ json.set!(key, t(:"blacklight.search.fields.#{key}", default: ''))
38
+ end
39
+ end
40
+
41
+ json.search do
42
+ current_exhibit.blacklight_config.search_fields.select { |_, config| config.if }.each do |key, search_config|
43
+ if locale == I18n.default_locale
44
+ json.set!(key, search_config.label)
45
+ else
46
+ json.set!(key, t(:"blacklight.search.fields.search.#{key}", default: ''))
47
+ end
48
+ end
49
+ end
50
+
51
+ json.sort do
52
+ current_exhibit.blacklight_config.sort_fields.each do |key, sort_config|
53
+ if locale == I18n.default_locale
54
+ json.set!(key, sort_config.label)
55
+ else
56
+ json.set!(key, t(:"blacklight.search.fields.sort.#{key}", default: ''))
57
+ end
58
+ end
59
+ end
60
+
61
+ json.facet do
62
+ current_exhibit.blacklight_config.facet_fields.each do |key, facet_config|
63
+ if locale == I18n.default_locale
64
+ json.set!(key, facet_config.label)
65
+ else
66
+ json.set!(key, t(:"blacklight.search.fields.facet.#{key}", default: ''))
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+
74
+ current_exhibit.searches.each do |search|
75
+ json.set!(search.slug) do
76
+ json.title search.translated_title(default: '')
77
+ json.subtitle search.translated_subtitle(default: '')
78
+ json.long_description search.translated_long_description(default: '')
79
+ end
80
+ end
81
+ end