blacklight-spotlight 3.0.0.alpha.6 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +55 -1
  4. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -2
  5. data/app/assets/javascripts/spotlight/admin/crop.es6 +11 -0
  6. data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
  7. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +3 -2
  8. data/app/assets/stylesheets/spotlight/_accessibility.scss +8 -0
  9. data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
  10. data/app/assets/stylesheets/spotlight/_curation.scss +9 -16
  11. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +7 -4
  12. data/app/assets/stylesheets/spotlight/_header.scss +1 -1
  13. data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
  14. data/app/assets/stylesheets/spotlight/_nestable.scss +4 -0
  15. data/app/assets/stylesheets/spotlight/_pages.scss +3 -1
  16. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
  17. data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -0
  18. data/app/assets/stylesheets/spotlight/_translations.scss +1 -0
  19. data/app/controllers/concerns/spotlight/base.rb +8 -0
  20. data/app/controllers/spotlight/admin_users_controller.rb +4 -1
  21. data/app/controllers/spotlight/appearances_controller.rb +1 -0
  22. data/app/controllers/spotlight/browse_controller.rb +1 -1
  23. data/app/controllers/spotlight/catalog_controller.rb +2 -2
  24. data/app/controllers/spotlight/exhibits_controller.rb +4 -3
  25. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  26. data/app/controllers/spotlight/pages_controller.rb +1 -5
  27. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  28. data/app/controllers/spotlight/searches_controller.rb +3 -2
  29. data/app/controllers/spotlight/sites_controller.rb +8 -2
  30. data/app/controllers/spotlight/translations_controller.rb +46 -0
  31. data/app/helpers/spotlight/crop_helper.rb +4 -1
  32. data/app/helpers/spotlight/title_helper.rb +12 -2
  33. data/app/jobs/spotlight/add_uploads_from_csv.rb +30 -5
  34. data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
  35. data/app/models/concerns/spotlight/translatables.rb +17 -1
  36. data/app/models/spotlight/about_page.rb +3 -1
  37. data/app/models/spotlight/contact.rb +1 -1
  38. data/app/models/spotlight/custom_field.rb +3 -3
  39. data/app/models/spotlight/exhibit.rb +4 -2
  40. data/app/models/spotlight/feature_page.rb +3 -1
  41. data/app/models/spotlight/featured_image.rb +29 -12
  42. data/app/models/spotlight/home_page.rb +3 -1
  43. data/app/models/spotlight/main_navigation.rb +2 -2
  44. data/app/models/spotlight/masthead.rb +1 -1
  45. data/app/models/spotlight/page.rb +7 -3
  46. data/app/models/spotlight/page_configurations.rb +1 -0
  47. data/app/models/spotlight/page_content.rb +2 -0
  48. data/app/models/spotlight/resources/csv_upload.rb +2 -1
  49. data/app/models/spotlight/resources/iiif_manifest.rb +2 -0
  50. data/app/models/spotlight/resources/upload.rb +1 -1
  51. data/app/models/spotlight/search.rb +5 -1
  52. data/app/models/spotlight/solr_document_sidecar.rb +7 -5
  53. data/app/models/spotlight/temporary_image.rb +8 -0
  54. data/app/services/spotlight/exhibit_import_export_service.rb +454 -0
  55. data/app/services/spotlight/solr_document_builder.rb +1 -0
  56. data/app/values/custom_field_name.rb +1 -0
  57. data/app/views/catalog/_save_search.html.erb +1 -1
  58. data/app/views/layouts/spotlight/spotlight.html.erb +1 -1
  59. data/app/views/shared/_site_sidebar.html.erb +1 -1
  60. data/app/views/spotlight/about_pages/_contact.html.erb +15 -17
  61. data/app/views/spotlight/admin_users/index.html.erb +1 -1
  62. data/app/views/spotlight/appearances/edit.html.erb +1 -23
  63. data/app/views/spotlight/browse/_search.html.erb +3 -2
  64. data/app/views/spotlight/browse/_search_title.html.erb +2 -1
  65. data/app/views/spotlight/exhibits/new.html.erb +1 -1
  66. data/app/views/spotlight/feature_pages/_sidebar.html.erb +9 -5
  67. data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
  68. data/app/views/spotlight/pages/_form.html.erb +2 -2
  69. data/app/views/spotlight/pages/_page.html.erb +19 -35
  70. data/app/views/spotlight/search_configurations/_facets.html.erb +15 -34
  71. data/app/views/spotlight/search_configurations/_search_fields.html.erb +4 -19
  72. data/app/views/spotlight/search_configurations/_sort.html.erb +8 -22
  73. data/app/views/spotlight/searches/_form.html.erb +1 -0
  74. data/app/views/spotlight/searches/_search.html.erb +31 -29
  75. data/app/views/spotlight/shared/_dd3_item.html.erb +56 -0
  76. data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
  77. data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
  78. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
  79. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
  80. data/app/views/spotlight/sites/edit.html.erb +1 -1
  81. data/app/views/spotlight/sites/edit_exhibits.html.erb +1 -1
  82. data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
  83. data/app/views/spotlight/translations/_general.html.erb +7 -7
  84. data/app/views/spotlight/translations/_import.html.erb +24 -0
  85. data/app/views/spotlight/translations/_metadata.html.erb +1 -1
  86. data/app/views/spotlight/translations/_page.html.erb +5 -5
  87. data/app/views/spotlight/translations/_pages.html.erb +4 -4
  88. data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
  89. data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
  90. data/app/views/spotlight/translations/edit.html.erb +8 -6
  91. data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
  92. data/config/i18n-tasks.yml +2 -0
  93. data/config/locales/spotlight.ar.yml +47 -24
  94. data/config/locales/spotlight.en.yml +82 -67
  95. data/config/routes.rb +6 -1
  96. data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
  97. data/lib/generators/spotlight/install_generator.rb +22 -1
  98. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
  99. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +2 -0
  100. data/lib/spotlight/engine.rb +26 -0
  101. data/lib/spotlight/upload_field_config.rb +1 -0
  102. data/lib/spotlight/version.rb +1 -1
  103. data/spec/controllers/spotlight/browse_controller_spec.rb +1 -1
  104. data/spec/controllers/spotlight/home_pages_controller_spec.rb +1 -1
  105. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
  106. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +2 -2
  107. data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
  108. data/spec/examples.txt +1410 -1389
  109. data/spec/factories/featured_images.rb +4 -0
  110. data/spec/features/add_contacts_spec.rb +1 -1
  111. data/spec/features/browse_category_admin_spec.rb +2 -2
  112. data/spec/features/create_exhibit_spec.rb +6 -6
  113. data/spec/features/dashboard_spec.rb +5 -5
  114. data/spec/features/exhibits/administration_spec.rb +3 -3
  115. data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
  116. data/spec/features/exhibits/translation_editing_spec.rb +2 -2
  117. data/spec/features/home_page_spec.rb +9 -0
  118. data/spec/features/javascript/block_controls_spec.rb +2 -0
  119. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
  120. data/spec/features/report_a_problem_spec.rb +5 -4
  121. data/spec/helpers/spotlight/pages_helper_spec.rb +2 -2
  122. data/spec/helpers/spotlight/title_helper_spec.rb +13 -0
  123. data/spec/i18n_spec.rb +0 -2
  124. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
  125. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
  126. data/spec/models/solr_document_spec.rb +2 -3
  127. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
  128. data/spec/models/spotlight/exhibit_spec.rb +9 -1
  129. data/spec/models/spotlight/feature_page_spec.rb +0 -5
  130. data/spec/models/spotlight/featured_image_spec.rb +27 -0
  131. data/spec/models/spotlight/page_spec.rb +6 -1
  132. data/spec/models/spotlight/resources/upload_spec.rb +43 -79
  133. data/spec/models/spotlight/role_spec.rb +2 -2
  134. data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +120 -22
  135. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
  136. data/spec/test_app_templates/Gemfile.extra +0 -3
  137. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +1 -0
  138. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
  139. data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +1 -1
  140. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +9 -10
  141. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
  142. data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
  143. metadata +69 -34
  144. data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
  145. data/app/serializers/spotlight/featured_image_representer.rb +0 -29
  146. data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
  147. data/app/serializers/spotlight/page_representer.rb +0 -33
@@ -0,0 +1,56 @@
1
+ <% main_content = yield %>
2
+ <% additional_options = yield nil, :additional_options %>
3
+ <% additional_content = yield nil, :additional_content %>
4
+ <% card_body = yield nil, :card_body %>
5
+ <% dd3_content_classes = local_assigns[:dd3_content_classes].presence %>
6
+ <% card_data = local_assigns[:card_data].presence || {} %>
7
+ <% enabled_method = local_assigns[:enabled_method].presence || :enabled %>
8
+ <% label_method = local_assigns[:label_method].presence || :label %>
9
+ <% label = local_assigns[:label].presence || field.object.public_send(label_method) %>
10
+ <% default_value = local_assigns[:default_value].presence %>
11
+ <% index = local_assigns[:index].presence %>
12
+ <% card_data[:behavior] ||= 'restore-default' if default_value %>
13
+
14
+ <li class="dd-item" data-id="<%= id.parameterize %>">
15
+ <div class="dd3-content <%= dd3_content_classes %> card d-flex">
16
+ <div class="dd-handle dd3-handle"><%= t :drag %></div>
17
+ <%= content_tag :div, class: "d-flex card-header", data: card_data do %>
18
+ <%= field.hidden_field :id %>
19
+ <% if main_content.present? %>
20
+ <%= main_content %>
21
+ <% else %>
22
+ <div class="flex-grow-1 align-self-center">
23
+ <h3 class="h6 card-title mb-0">
24
+ <%= field.hidden_field :weight, value: index, 'data-property' => 'weight' %>
25
+ <%= field.check_box enabled_method, inline: true, checked: field.object.public_send(enabled_method), hide_label: true, title: label %>
26
+ <span class="d-inline-block w-75" data-in-place-edit-target=".edit-in-place" data-in-place-edit-field-target="[data-edit-field-target='true']">
27
+ <a href="#edit-in-place" class="field-label edit-in-place"><%= label %></a>
28
+ <%= field.hidden_field label_method, value: label, class: 'form-control form-control-sm title-field', data: {:"edit-field-target" => 'true', default_value: default_value } %>
29
+ </span>
30
+ </h3>
31
+ </div>
32
+ <% end %>
33
+
34
+ <% if default_value %>
35
+ <div class="">
36
+ <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn restore-default btn-secondary btn-sm #{'d-none' if label.blank? || label == default_value}" %>
37
+ </div>
38
+ <% end %>
39
+
40
+ <%= content_tag :div, additional_options, class: 'd-flex' if additional_options.present? %>
41
+
42
+
43
+ <% if additional_content.present? %>
44
+ <div class="d-flex">
45
+ <button class="btn btn-link collapse-toggle collapsed" type="button" data-toggle="collapse" data-target="#<%= id.parameterize %>_options" aria-expanded="false" aria-controls="<%= id.parameterize %>_options">
46
+ Options
47
+ </button>
48
+ <span class="collapse-chevron">❯</span>
49
+ </div>
50
+ <% end %>
51
+ <% end %>
52
+ <%= content_tag :div, additional_content, id: "#{id.parameterize}_options", class: 'options collapse' if additional_content.present? %>
53
+ <%= content_tag :div, card_body, class: 'card-body bg-white' if card_body.present? %>
54
+ </div>
55
+ <%= yield nil, :nested_components %>
56
+ </li>
@@ -0,0 +1,4 @@
1
+ <span style="display:none;visibility:hidden;">
2
+ <% honeypot_field_name = Spotlight::Engine.config.spambot_honeypot_email_field %>
3
+ <%= f.email_field honeypot_field_name, label: t(:'spotlight.shared.report_a_problem.honeypot_field_explanation') %>
4
+ </span>
@@ -2,20 +2,17 @@
2
2
  <div class="row justify-content-center">
3
3
  <% contact_form ||= Spotlight::ContactForm.new current_url: request.original_url %>
4
4
  <%= bootstrap_form_for contact_form, url: spotlight.exhibit_contact_form_path(current_exhibit, contact_form), layout: :horizontal, label_col: 'col-sm-3', control_col: 'col-sm-9', html: { class: 'col-md-offset-2 col-md-8 my-3 '} do |f| %>
5
-
6
5
  <h2><%= t(:'.title') %></h2>
6
+ <div class="alert alert-primary"><%= t('.reporting_from', url: contact_form.current_url) %></div>
7
+ <%= f.text_area :message, rows: 4 %>
7
8
  <%= f.text_field :name %>
8
- <span style="display:none;visibility:hidden;">
9
- <% honeypot_field_name = Spotlight::Engine.config.spambot_honeypot_email_field %>
10
- <%= f.email_field honeypot_field_name, label: t(:'.honeypot_field_explanation') %>
11
- </span>
9
+ <%= render '/spotlight/shared/honeypot_field', f: f %>
12
10
  <%= f.email_field :email %>
13
- <%= f.text_area :message, rows: 7 %>
14
11
  <%= f.hidden_field :current_url %>
15
- <div class="form-actions">
16
- <div class="primary-actions">
17
- <%= link_to t(:'helpers.action.cancel'), '#', class: 'btn-sizing', data: { 'behavior' => 'cancel-link' } %>
18
- <%= f.submit nil, class: 'btn btn-primary' %>
12
+ <div class="form-actions row">
13
+ <div class="col offset-sm-3">
14
+ <%= f.submit nil, class: 'btn btn-primary' %>
15
+ <%= link_to t(:'helpers.action.cancel'), '#', class: 'btn-sizing', data: { 'behavior' => 'cancel-link' } %>
19
16
  </div>
20
17
  </div>
21
18
  <% end %>
@@ -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? %>
@@ -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] %>
@@ -1,4 +1,4 @@
1
- <%= page_title(t('.section'), t('.page_title')) %>
1
+ <%= page_title(t('.page_title')) %>
2
2
  <div role="tabpanel">
3
3
  <%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %>
4
4
  <ul class="nav nav-tabs" role="tablist">
@@ -1,4 +1,4 @@
1
- <%= page_title(t('.section'), t('.page_title')) %>
1
+ <%= page_title(t('.page_title')) %>
2
2
  <%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %>
3
3
  <p class="instructions"><%= t :'.instructions' %></p>
4
4
  <table class="table table-striped dd-table">
@@ -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,24 @@
1
+ <% if can? :import_translations, Spotlight::Exhibit %>
2
+ <div class="row col-md-12 mb-4">
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 clearfix mb-3', multipart: true } do |f| %>
7
+ <%= f.label :value, t(".import_label"), class: 'col-form-label col-12 col-sm-3 text-right' %>
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">
18
+ <%= content_tag :span, t(".export_label"), class: 'col-form-label col-12 col-sm-3 text-right' %>
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,33 @@
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>
40
42
  </a>
41
43
  </li>
42
44
  <li class="nav-item">
43
45
  <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>
46
+ <%= t('spotlight.translations.pages.label') %> <span class="badge"></span>
45
47
  </a>
46
48
  </li>
47
49
  </ul>
@@ -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