blacklight-spotlight 3.0.0.alpha.9 → 3.0.0.alpha.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) 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 +5 -0
  6. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +3 -2
  7. data/app/assets/stylesheets/spotlight/_accessibility.scss +1 -1
  8. data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
  9. data/app/assets/stylesheets/spotlight/_curation.scss +6 -0
  10. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +3 -0
  11. data/app/assets/stylesheets/spotlight/_header.scss +1 -1
  12. data/app/assets/stylesheets/spotlight/_translations.scss +1 -0
  13. data/app/controllers/spotlight/appearances_controller.rb +1 -0
  14. data/app/controllers/spotlight/browse_controller.rb +1 -1
  15. data/app/controllers/spotlight/exhibits_controller.rb +2 -3
  16. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  17. data/app/controllers/spotlight/pages_controller.rb +1 -1
  18. data/app/controllers/spotlight/searches_controller.rb +3 -2
  19. data/app/controllers/spotlight/translations_controller.rb +46 -0
  20. data/app/helpers/spotlight/crop_helper.rb +4 -1
  21. data/app/models/concerns/spotlight/translatables.rb +17 -1
  22. data/app/models/spotlight/about_page.rb +3 -1
  23. data/app/models/spotlight/exhibit.rb +4 -2
  24. data/app/models/spotlight/feature_page.rb +3 -1
  25. data/app/models/spotlight/featured_image.rb +29 -12
  26. data/app/models/spotlight/home_page.rb +3 -1
  27. data/app/models/spotlight/main_navigation.rb +2 -2
  28. data/app/models/spotlight/masthead.rb +1 -1
  29. data/app/models/spotlight/page.rb +5 -1
  30. data/app/models/spotlight/search.rb +5 -1
  31. data/app/models/spotlight/solr_document_sidecar.rb +7 -5
  32. data/app/models/spotlight/temporary_image.rb +8 -0
  33. data/app/services/spotlight/exhibit_import_export_service.rb +454 -0
  34. data/app/views/catalog/_save_search.html.erb +1 -1
  35. data/app/views/spotlight/browse/_search.html.erb +3 -2
  36. data/app/views/spotlight/browse/_search_title.html.erb +2 -1
  37. data/app/views/spotlight/pages/_form.html.erb +1 -1
  38. data/app/views/spotlight/searches/_form.html.erb +1 -0
  39. data/app/views/spotlight/searches/_search.html.erb +1 -0
  40. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
  41. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
  42. data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
  43. data/app/views/spotlight/translations/_general.html.erb +7 -7
  44. data/app/views/spotlight/translations/_import.html.erb +24 -0
  45. data/app/views/spotlight/translations/_metadata.html.erb +1 -1
  46. data/app/views/spotlight/translations/_page.html.erb +5 -5
  47. data/app/views/spotlight/translations/_pages.html.erb +4 -4
  48. data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
  49. data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
  50. data/app/views/spotlight/translations/edit.html.erb +8 -6
  51. data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
  52. data/config/locales/spotlight.ar.yml +43 -24
  53. data/config/locales/spotlight.en.yml +65 -53
  54. data/config/routes.rb +6 -1
  55. data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
  56. data/lib/spotlight/engine.rb +20 -0
  57. data/lib/spotlight/version.rb +1 -1
  58. data/spec/controllers/spotlight/home_pages_controller_spec.rb +1 -1
  59. data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
  60. data/spec/factories/featured_images.rb +4 -0
  61. data/spec/features/exhibits/translation_editing_spec.rb +2 -2
  62. data/spec/features/home_page_spec.rb +9 -0
  63. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
  64. data/spec/i18n_spec.rb +0 -2
  65. data/spec/models/spotlight/exhibit_spec.rb +9 -1
  66. data/spec/models/spotlight/featured_image_spec.rb +28 -0
  67. data/spec/models/spotlight/page_spec.rb +6 -1
  68. data/spec/models/spotlight/resources/upload_spec.rb +43 -79
  69. data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +108 -22
  70. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
  71. metadata +14 -11
  72. data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
  73. data/app/serializers/spotlight/featured_image_representer.rb +0 -29
  74. data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
  75. data/app/serializers/spotlight/page_representer.rb +0 -33
@@ -12,7 +12,7 @@
12
12
  <div class="modal-body">
13
13
  <%= f.text_field :title, label: t(:'spotlight.saved_search.title') %>
14
14
  <%= label_tag :id, t(:'spotlight.saved_search.id'), class: 'col-form-label' %>
15
- <%= select_tag :id, options_for_select(current_exhibit.searches.map { |s| [s.title, s.id] }), include_blank: true, class: 'form-control' %>
15
+ <%= select_tag :id, options_for_select(current_exhibit.searches.map { |s| [s.full_title, s.id] }), include_blank: true, class: 'form-control' %>
16
16
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:qt, :page, :utf8)) %>
17
17
  </div>
18
18
  <div class="modal-footer d-flex flex-row-reverse justify-content-start">
@@ -5,8 +5,9 @@
5
5
  <%= image_tag(search.thumbnail_image_url || 'spotlight/default_browse_thumbnail.jpg', class: 'img-responsive', alt: '') %>
6
6
  <div class="text-overlay">
7
7
  <h2 class="browse-category-title">
8
- <%= search.title%>
9
- <small><%= t :'spotlight.browse.search.item_count', count: search.count %></small>
8
+ <span class="title"><%= search.title%></span>
9
+ <% if search.subtitle.present? %><span class="category-subtitle"><%= search.subtitle %></span><% end %>
10
+ <small class="item-count"><%= t :'spotlight.browse.search.item_count', count: search.count %></small>
10
11
  </h2>
11
12
  </div>
12
13
  </div>
@@ -1,2 +1,3 @@
1
- <%= search.title %>
1
+ <span class="title"><%= search.title %></span>
2
+ <% if search.subtitle.present? %><span class="subtitle"><%= search.subtitle %></span><% end %>
2
3
  <small class="item-count"><%= t :'spotlight.browse.search.item_count', count: params[:browse_q] ? parent_search_count: search.count %></small>
@@ -2,7 +2,7 @@
2
2
  # TODO: the "if @page.persisted?" business below could possibly be done w/ some clever polymorphic routing.
3
3
  # Leaving as-is for now since technically you can't get to the new page form anyway.
4
4
  %>
5
- <%= bootstrap_form_for([spotlight, @page.exhibit, @page], role: 'form', html: { data: configurations_for_current_page.merge('form-observer': true)}) do |f| %>
5
+ <%= bootstrap_form_for(@page, url: url_for([spotlight, @page.exhibit, @page, format: nil]), role: 'form', html: { data: configurations_for_current_page.merge('form-observer': true)}) do |f| %>
6
6
  <%= render @page.lock if @page.lock and not @page.lock.stale? and not @page.lock.current_session? %>
7
7
  <% if @page.errors.any? %>
8
8
  <div id="error_explanation">
@@ -29,6 +29,7 @@
29
29
  <div class="tab-content">
30
30
  <div role="tabpanel" class="tab-pane active" id="search-description">
31
31
  <%= f.text_field :title, control_col: "col-sm-5" %>
32
+ <%= f.text_field :subtitle, control_col: "col-sm-5" %>
32
33
  <%= f.text_area :long_description, rows: 5 %>
33
34
  <%= f.form_group :search_box, label: { text: t(:'.search_box.label'), class: 'pt-0' }, help: t(:'.search_box.help_block') do %>
34
35
  <%= f.check_box :search_box, label: t(:'.search_box.checkbox_label') %>
@@ -13,6 +13,7 @@
13
13
  <div class="flex-grow-1 mx-2 main">
14
14
  <h4 class="card-title h6 mb-0">
15
15
  <%= search.title %>
16
+ <% if search.subtitle.present? %><span class="subtitle"><%= search.subtitle %></span><% end %>
16
17
  </h4>
17
18
 
18
19
  <div class="card-text">
@@ -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] %>
@@ -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