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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +55 -1
- data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -2
- data/app/assets/javascripts/spotlight/admin/crop.es6 +11 -0
- data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
- data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +3 -2
- data/app/assets/stylesheets/spotlight/_accessibility.scss +8 -0
- data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
- data/app/assets/stylesheets/spotlight/_curation.scss +9 -16
- data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +7 -4
- data/app/assets/stylesheets/spotlight/_header.scss +1 -1
- data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
- data/app/assets/stylesheets/spotlight/_nestable.scss +4 -0
- data/app/assets/stylesheets/spotlight/_pages.scss +3 -1
- data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
- data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -0
- data/app/assets/stylesheets/spotlight/_translations.scss +1 -0
- data/app/controllers/concerns/spotlight/base.rb +8 -0
- data/app/controllers/spotlight/admin_users_controller.rb +4 -1
- data/app/controllers/spotlight/appearances_controller.rb +1 -0
- data/app/controllers/spotlight/browse_controller.rb +1 -1
- data/app/controllers/spotlight/catalog_controller.rb +2 -2
- data/app/controllers/spotlight/exhibits_controller.rb +4 -3
- data/app/controllers/spotlight/featured_images_controller.rb +1 -1
- data/app/controllers/spotlight/pages_controller.rb +1 -5
- data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
- data/app/controllers/spotlight/searches_controller.rb +3 -2
- data/app/controllers/spotlight/sites_controller.rb +8 -2
- data/app/controllers/spotlight/translations_controller.rb +46 -0
- data/app/helpers/spotlight/crop_helper.rb +4 -1
- data/app/helpers/spotlight/title_helper.rb +12 -2
- data/app/jobs/spotlight/add_uploads_from_csv.rb +30 -5
- data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
- data/app/models/concerns/spotlight/translatables.rb +17 -1
- data/app/models/spotlight/about_page.rb +3 -1
- data/app/models/spotlight/contact.rb +1 -1
- data/app/models/spotlight/custom_field.rb +3 -3
- data/app/models/spotlight/exhibit.rb +4 -2
- data/app/models/spotlight/feature_page.rb +3 -1
- data/app/models/spotlight/featured_image.rb +29 -12
- data/app/models/spotlight/home_page.rb +3 -1
- data/app/models/spotlight/main_navigation.rb +2 -2
- data/app/models/spotlight/masthead.rb +1 -1
- data/app/models/spotlight/page.rb +7 -3
- data/app/models/spotlight/page_configurations.rb +1 -0
- data/app/models/spotlight/page_content.rb +2 -0
- data/app/models/spotlight/resources/csv_upload.rb +2 -1
- data/app/models/spotlight/resources/iiif_manifest.rb +2 -0
- data/app/models/spotlight/resources/upload.rb +1 -1
- data/app/models/spotlight/search.rb +5 -1
- data/app/models/spotlight/solr_document_sidecar.rb +7 -5
- data/app/models/spotlight/temporary_image.rb +8 -0
- data/app/services/spotlight/exhibit_import_export_service.rb +454 -0
- data/app/services/spotlight/solr_document_builder.rb +1 -0
- data/app/values/custom_field_name.rb +1 -0
- data/app/views/catalog/_save_search.html.erb +1 -1
- data/app/views/layouts/spotlight/spotlight.html.erb +1 -1
- data/app/views/shared/_site_sidebar.html.erb +1 -1
- data/app/views/spotlight/about_pages/_contact.html.erb +15 -17
- data/app/views/spotlight/admin_users/index.html.erb +1 -1
- data/app/views/spotlight/appearances/edit.html.erb +1 -23
- data/app/views/spotlight/browse/_search.html.erb +3 -2
- data/app/views/spotlight/browse/_search_title.html.erb +2 -1
- data/app/views/spotlight/exhibits/new.html.erb +1 -1
- data/app/views/spotlight/feature_pages/_sidebar.html.erb +9 -5
- data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
- data/app/views/spotlight/pages/_form.html.erb +2 -2
- data/app/views/spotlight/pages/_page.html.erb +19 -35
- data/app/views/spotlight/search_configurations/_facets.html.erb +15 -34
- data/app/views/spotlight/search_configurations/_search_fields.html.erb +4 -19
- data/app/views/spotlight/search_configurations/_sort.html.erb +8 -22
- data/app/views/spotlight/searches/_form.html.erb +1 -0
- data/app/views/spotlight/searches/_search.html.erb +31 -29
- data/app/views/spotlight/shared/_dd3_item.html.erb +56 -0
- data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
- data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
- data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
- data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
- data/app/views/spotlight/sites/edit.html.erb +1 -1
- data/app/views/spotlight/sites/edit_exhibits.html.erb +1 -1
- data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
- data/app/views/spotlight/translations/_general.html.erb +7 -7
- data/app/views/spotlight/translations/_import.html.erb +24 -0
- data/app/views/spotlight/translations/_metadata.html.erb +1 -1
- data/app/views/spotlight/translations/_page.html.erb +5 -5
- data/app/views/spotlight/translations/_pages.html.erb +4 -4
- data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
- data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
- data/app/views/spotlight/translations/edit.html.erb +8 -6
- data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
- data/config/i18n-tasks.yml +2 -0
- data/config/locales/spotlight.ar.yml +47 -24
- data/config/locales/spotlight.en.yml +82 -67
- data/config/routes.rb +6 -1
- data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
- data/lib/generators/spotlight/install_generator.rb +22 -1
- data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +2 -0
- data/lib/spotlight/engine.rb +26 -0
- data/lib/spotlight/upload_field_config.rb +1 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/browse_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/resources/upload_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
- data/spec/examples.txt +1410 -1389
- data/spec/factories/featured_images.rb +4 -0
- data/spec/features/add_contacts_spec.rb +1 -1
- data/spec/features/browse_category_admin_spec.rb +2 -2
- data/spec/features/create_exhibit_spec.rb +6 -6
- data/spec/features/dashboard_spec.rb +5 -5
- data/spec/features/exhibits/administration_spec.rb +3 -3
- data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
- data/spec/features/exhibits/translation_editing_spec.rb +2 -2
- data/spec/features/home_page_spec.rb +9 -0
- data/spec/features/javascript/block_controls_spec.rb +2 -0
- data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
- data/spec/features/report_a_problem_spec.rb +5 -4
- data/spec/helpers/spotlight/pages_helper_spec.rb +2 -2
- data/spec/helpers/spotlight/title_helper_spec.rb +13 -0
- data/spec/i18n_spec.rb +0 -2
- data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
- data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
- data/spec/models/solr_document_spec.rb +2 -3
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
- data/spec/models/spotlight/exhibit_spec.rb +9 -1
- data/spec/models/spotlight/feature_page_spec.rb +0 -5
- data/spec/models/spotlight/featured_image_spec.rb +27 -0
- data/spec/models/spotlight/page_spec.rb +6 -1
- data/spec/models/spotlight/resources/upload_spec.rb +43 -79
- data/spec/models/spotlight/role_spec.rb +2 -2
- data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +120 -22
- data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
- data/spec/test_app_templates/Gemfile.extra +0 -3
- data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +1 -0
- data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +9 -10
- data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
- data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
- metadata +69 -34
- data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
- data/app/serializers/spotlight/featured_image_representer.rb +0 -29
- data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
- 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.
|
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">
|
@@ -14,6 +14,6 @@
|
|
14
14
|
</ul>
|
15
15
|
|
16
16
|
<ul class="nav sidenav nav-pills nav-stacked">
|
17
|
-
<li class="nav-item"><%= link_to t(:'spotlight.
|
17
|
+
<li class="nav-item"><%= link_to t(:'spotlight.exhibits.new.page_title'), spotlight.new_exhibit_path, class: 'btn btn-outline-secondary btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
|
18
18
|
</ul>
|
19
19
|
<% end %>
|
@@ -1,18 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<div class="
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<%= f.hidden_field :id %>
|
9
|
-
<%= f.hidden_field :weight, data: {property: "weight"} %>
|
10
|
-
<%= render partial: "contact_properties", locals: {contact: f.object} %>
|
11
|
-
</div>
|
12
|
-
<div class="contact-links page-links">
|
13
|
-
<%= exhibit_edit_link f.object %> ·
|
14
|
-
<%= exhibit_delete_link f.object %>
|
15
|
-
</div>
|
1
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: f.object.id.to_s, field: f, enabled_method: :show_in_sidebar, label_method: :name } do |_, section| %>
|
2
|
+
<% case section when nil %>
|
3
|
+
<div class="d-flex flex-grow-1">
|
4
|
+
<%= f.check_box :show_in_sidebar, hide_label: true, inline: true %>
|
5
|
+
<%= f.hidden_field :id %>
|
6
|
+
<%= f.hidden_field :weight, data: {property: "weight"} %>
|
7
|
+
<%= render partial: "contact_properties", locals: {contact: f.object} %>
|
16
8
|
</div>
|
17
|
-
|
18
|
-
|
9
|
+
<% when :additional_options %>
|
10
|
+
<div class="contact-links page-links">
|
11
|
+
<%= exhibit_edit_link f.object %> ·
|
12
|
+
<%= exhibit_delete_link f.object %>
|
13
|
+
</div>
|
14
|
+
<% else %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= page_title(t('.
|
1
|
+
<%= page_title(t('.page_title')) %>
|
2
2
|
<%= bootstrap_form_for Spotlight::Engine.user_class.new, html: { class: 'admin-users' }, url: spotlight.admin_users_path do |f| %>
|
3
3
|
<div class="mb-4">
|
4
4
|
<h3 class="instructions"><%= t :'.instructions' %></h3>
|
@@ -71,29 +71,7 @@
|
|
71
71
|
<div class="card-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
|
72
72
|
<ol class="dd-list">
|
73
73
|
<%= f.fields_for :main_navigations do |label| %>
|
74
|
-
|
75
|
-
<div class="card d-flex dd3-content">
|
76
|
-
<div class="dd-handle dd3-handle"><%= t :drag %></div>
|
77
|
-
<div class="card-body d-flex" data-behavior="restore-default">
|
78
|
-
<%= label.hidden_field :id %>
|
79
|
-
<div class="flex-grow-1 py-2">
|
80
|
-
<h3 class="card-title h6 mb-0">
|
81
|
-
<span class='publish-control h6'>
|
82
|
-
<%= label.check_box_without_bootstrap :display %>
|
83
|
-
</span>
|
84
|
-
<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']">
|
85
|
-
<a href="#edit-in-place" class="field-label edit-in-place"><%= label.object.label_or_default %></a>
|
86
|
-
<%= label.hidden_field :label, data: {:"default-value" => label.object.default_label, :"edit-field-target" => 'true'} %>
|
87
|
-
</span>
|
88
|
-
</h3>
|
89
|
-
</div>
|
90
|
-
<div class="">
|
91
|
-
<%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn restore-default btn-secondary btn-sm float-right #{'d-none' if label.object.label.blank? || label.object.label == label.object.default_label}" %>
|
92
|
-
</div>
|
93
|
-
<%= label.hidden_field :weight, data: {property: "weight"} %>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
</li>
|
74
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: label.object.nav_type, field: label, label: label.object.label_or_default, default_value: label.object.default_label, enabled_method: :display } do; end %>
|
97
75
|
<% end %>
|
98
76
|
</ol>
|
99
77
|
</div>
|
@@ -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
|
-
|
9
|
-
|
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
|
-
|
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>
|
@@ -3,11 +3,15 @@
|
|
3
3
|
<% @exhibit.feature_pages.for_locale.published.at_top_level.each do |feature_section| %>
|
4
4
|
<li class="<%= 'active' if current_page? [spotlight, @exhibit, feature_section] %>">
|
5
5
|
<h2 class="h6"><%= link_to_unless_current feature_section.title, [spotlight, @exhibit, feature_section] %></h2>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
<% child_pages = feature_section.child_pages.published %>
|
7
|
+
|
8
|
+
<% if child_pages.any? %>
|
9
|
+
<ol class="subsection">
|
10
|
+
<% child_pages.each do |page| %>
|
11
|
+
<li class="<%= 'active' if current_page? [spotlight, @exhibit, page] %>"><%= link_to_unless_current page.title, [spotlight, @exhibit, page] %></li>
|
12
|
+
<% end %>
|
13
|
+
</ol>
|
14
|
+
<% end %>
|
11
15
|
</li>
|
12
16
|
<% end %>
|
13
17
|
</ol>
|
@@ -1,3 +1,12 @@
|
|
1
1
|
<p><%= t :".title" %></p>
|
2
2
|
|
3
3
|
<p><%= t :".body", count: @number, title: @exhibit.title %></p>
|
4
|
+
|
5
|
+
<% if @errors.length > 0 %>
|
6
|
+
<p><%= t :".errors", default: :'spotlight.catalog.reindex_progress_panel.error' %></p>
|
7
|
+
<ul>
|
8
|
+
<% @errors.each do |index, message| %>
|
9
|
+
<li><%= t :'.error', index: index, message: message.to_sentence %>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
<% end %>
|
@@ -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">
|
@@ -40,7 +40,7 @@
|
|
40
40
|
</div>
|
41
41
|
<div class="form-group">
|
42
42
|
<%= f.label :content, class: 'sr-only' %>
|
43
|
-
<%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types':
|
43
|
+
<%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types': SirTrevorRails::Block.custom_block_types } %>
|
44
44
|
</div>
|
45
45
|
</div>
|
46
46
|
|
@@ -1,40 +1,24 @@
|
|
1
1
|
<% page = f.object %>
|
2
|
-
|
3
|
-
|
4
|
-
<div class="
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<%= f.hidden_field :weight, data: {property: "weight"} %>
|
9
|
-
<h3 class="h6 card-title">
|
10
|
-
<span class="publish-control">
|
11
|
-
<%= f.check_box :published, inline: true, hide_label: true %>
|
12
|
-
</span>
|
13
|
-
<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']">
|
14
|
-
<a href="#edit-in-place" class="field-label edit-in-place"><%= page.title %></a>
|
15
|
-
<%= f.hidden_field :title, value: page.title , class: 'form-control form-control-sm title-field', data: {:"edit-field-target" => 'true'} %>
|
16
|
-
</span>
|
17
|
-
</h3>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<div class="page-links">
|
21
|
-
<%= exhibit_view_link page %> ·
|
22
|
-
<%= exhibit_edit_link page, data: { turbolinks: false } %> ·
|
23
|
-
<%= exhibit_delete_link page %>
|
24
|
-
</div>
|
25
|
-
<%- if page.feature_page? -%>
|
26
|
-
<%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %>
|
27
|
-
<% end %>
|
2
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: page.id.to_s, field: f, label: page.title, label_method: :title, enabled_method: :published } do |_, section| %>
|
3
|
+
<% case section when :additional_options %>
|
4
|
+
<div class="page-links">
|
5
|
+
<%= exhibit_view_link page %> ·
|
6
|
+
<%= exhibit_edit_link page, data: { turbolinks: false } %> ·
|
7
|
+
<%= exhibit_delete_link page %>
|
28
8
|
</div>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
9
|
+
<%- if page.feature_page? -%>
|
10
|
+
<%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %>
|
11
|
+
<% end %>
|
12
|
+
<% when :nested_components %>
|
13
|
+
<% if page.feature_page? and page.child_pages.present? %>
|
14
|
+
<ol class="dd-list">
|
15
|
+
<% page.child_pages.each do |child_page| %>
|
16
|
+
<%= parent_form.fields_for page_collection_name, child_page do |p| %>
|
17
|
+
<%= render partial: 'page', locals: {f: p, parent_form: parent_form} %>
|
18
|
+
<% end %>
|
36
19
|
<% end %>
|
37
|
-
|
38
|
-
|
20
|
+
</ol>
|
21
|
+
<% end %>
|
39
22
|
<% end %>
|
23
|
+
<% end %>
|
40
24
|
</li>
|
@@ -5,43 +5,24 @@
|
|
5
5
|
<% @blacklight_configuration.blacklight_config.facet_fields.select { |k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) }.each do |key, config| %>
|
6
6
|
<% metadata = @field_metadata.field(key) %>
|
7
7
|
<% next unless metadata[:document_count] > 0 || config.custom_field %>
|
8
|
-
|
9
|
-
<%=
|
10
|
-
|
11
|
-
<div class="
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<%= facet.hidden_field :weight, 'data-property' => 'weight' %>
|
16
|
-
<%= facet.check_box :show, inline: true, checked: config.show, hide_label: true, title: key %>
|
17
|
-
<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']">
|
18
|
-
<a href="#edit-in-place" class="field-label edit-in-place"><%= facet_field_label(key) %></a>
|
19
|
-
<%= facet.hidden_field :label, value: facet_field_label(key), class: 'form-control form-control-sm', data: {:"edit-field-target" => 'true'} %>
|
20
|
-
</span>
|
21
|
-
</h3>
|
22
|
-
</div>
|
23
|
-
<div class="d-flex">
|
24
|
-
<div class="facet-metadata mr-3">
|
25
|
-
<%= render partial: 'facet_metadata', locals: { metadata: metadata } %>
|
26
|
-
</div>
|
27
|
-
<div class="">
|
28
|
-
<button class="btn btn-link collapse-toggle collapsed" type="button" data-toggle="collapse" data-target="#<%= key.parameterize %>_facet_options" aria-expanded="false" aria-controls="<%= key.parameterize %>_facet_options">
|
29
|
-
Options
|
30
|
-
</button>
|
31
|
-
<span class="collapse-chevron">❯</span>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
</div>
|
35
|
-
<div id="<%= key.parameterize %>_facet_options" class="options collapse mt-2">
|
36
|
-
<%= facet.form_group :terms, label_col: 'col-md-2 offset-md-1', label: { text: t(:'.sort_by.label') } do %>
|
37
|
-
<%= facet.radio_button :sort, 'count', label: t(:'.sort_by.count'), checked: (config.sort.to_s == 'count' || config.sort.nil?) %>
|
38
|
-
<%= facet.radio_button :sort, 'index', label: t(:'.sort_by.index'), checked: (config.sort.to_s == 'index') %>
|
8
|
+
<%= idxf.fields_for key, config do |facet| %>
|
9
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: key, field: facet, dd3_content_classes: "facet-config-#{key.parameterize} page" , enabled_method: :show, label_method: :label, label: facet_field_label(key) } do |_, section| %>
|
10
|
+
<% case section when :additional_content %>
|
11
|
+
<div class="mt-2">
|
12
|
+
<%= facet.form_group :terms, label_col: 'col-md-2 offset-md-1', label: { text: t(:'spotlight.search_configurations.facets.sort_by.label') } do %>
|
13
|
+
<%= facet.radio_button :sort, 'count', label: t(:'spotlight.search_configurations.facets.sort_by.count'), checked: (config.sort.to_s == 'count' || config.sort.nil?) %>
|
14
|
+
<%= facet.radio_button :sort, 'index', label: t(:'spotlight.search_configurations.facets.sort_by.index'), checked: (config.sort.to_s == 'index') %>
|
39
15
|
<% end %>
|
40
16
|
</div>
|
41
|
-
|
17
|
+
<% when :additional_options %>
|
18
|
+
<div class="facet-metadata mr-3">
|
19
|
+
<%= render partial: 'facet_metadata', locals: { metadata: metadata } %>
|
20
|
+
</div>
|
21
|
+
<% else %>
|
22
|
+
<% end %>
|
42
23
|
<% end %>
|
43
|
-
|
44
|
-
<% end
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
45
26
|
<% end %>
|
46
27
|
</ol>
|
47
28
|
</div>
|
@@ -31,25 +31,10 @@
|
|
31
31
|
<div class="panel-group dd search_fields_admin col-sm-7" id="nested-search-fields" data-behavior="nestable" data-max-depth="1">
|
32
32
|
<ol class="dd-list">
|
33
33
|
<% @blacklight_configuration.blacklight_config.search_fields.select { |_k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) && v.include_in_simple_select != false }.except(default_field.key).each_with_index do |(k, config), index| %>
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<div class="flex-grow-1">
|
39
|
-
<h3 class="h6 card-title">
|
40
|
-
<%= vt.fields_for k, config do |field| %>
|
41
|
-
<%= field.hidden_field :weight, value: index, data: {property: "weight"} %>
|
42
|
-
<%= field.check_box :enabled, inline: true, checked: config.enabled, hide_label: true, title: k %>
|
43
|
-
<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']">
|
44
|
-
<a href="#edit-in-place" class="field-label edit-in-place"><%= config.label %></a>
|
45
|
-
<%= field.hidden_field :label, class: 'form-control form-control-sm', data: {:"edit-field-target" => "true"} %>
|
46
|
-
</span>
|
47
|
-
<% end %>
|
48
|
-
</h3>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
</li>
|
34
|
+
<%= vt.fields_for k, config do |field| %>
|
35
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: k, index: index, field: field } do %>
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
53
38
|
<% end %>
|
54
39
|
</ol>
|
55
40
|
</div>
|
@@ -28,28 +28,14 @@
|
|
28
28
|
<div class="panel-group dd sort_fields_admin col-10" id="nested-sort-fields" data-behavior="nestable" data-max-depth="1">
|
29
29
|
<ol class="dd-list">
|
30
30
|
<% @blacklight_configuration.blacklight_config.sort_fields.select { |k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) }.except(default_field.key).each_with_index do |(k, config), index| %>
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
<%= field.check_box :enabled, inline: true, checked: config.enabled, hide_label: true, title: k %>
|
40
|
-
<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']">
|
41
|
-
<a href="#edit-in-place" class="field-label edit-in-place"><%= config.label %></a>
|
42
|
-
<%= field.hidden_field :label, class: 'form-control form-control-sm', data: {:"edit-field-target" => "true"} %>
|
43
|
-
</span>
|
44
|
-
<% end %>
|
45
|
-
</h3>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
<div class="card-body bg-white">
|
49
|
-
<p class="card-text"><%= translate_sort_fields(config) %></p>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
</li>
|
31
|
+
|
32
|
+
<%= vt.fields_for k, config do |field| %>
|
33
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: k, index: index, field: field, card_data: { behavior: 'restore-default' }, label: config.label } do |_, section| %>
|
34
|
+
<% case section when :card_body %>
|
35
|
+
<p class="card-text"><%= translate_sort_fields(config) %></p>
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
53
39
|
<% end %>
|
54
40
|
</ol>
|
55
41
|
</div>
|
@@ -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') %>
|
@@ -1,36 +1,38 @@
|
|
1
1
|
<% search = f.object %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: search.id.to_s, field: f, dd3_content_classes: "search" , enabled_method: :published, label_method: :title, label: search.title } do |_, section| %>
|
3
|
+
<% case section when nil %>
|
4
|
+
<div class="d-flex flex-grow-1">
|
5
|
+
<div>
|
6
|
+
<%= f.check_box :published, inline: true, hide_label: true %>
|
7
|
+
</div>
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
<div class="pic">
|
10
|
+
<%= image_tag(search.thumbnail_image_url || 'spotlight/default_browse_thumbnail.jpg', class: 'img-thumbnail') %>
|
11
|
+
</div>
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<div class="flex-grow-1 mx-2 main">
|
14
|
+
<h4 class="card-title h6 mb-0">
|
15
|
+
<%= search.title %>
|
16
|
+
<% if search.subtitle.present? %><span class="subtitle"><%= search.subtitle %></span><% end %>
|
17
|
+
</h4>
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
</div>
|
19
|
+
<div class="card-text">
|
20
|
+
<div class="count"><%= t :'spotlight.searches.search.item_count', count: search.count %></div>
|
21
|
+
<div class="actions"><%= exhibit_view_link(search) %> • <%= exhibit_edit_link(search) %> • <%= exhibit_delete_link(search) %></div>
|
22
|
+
<%= f.hidden_field :id %>
|
23
|
+
<%= f.hidden_field :weight, data: {property: "weight"} %>
|
24
24
|
</div>
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
</div>
|
26
|
+
<% when :additional_options %>
|
27
|
+
<div class="flex-grow-1 mx-2 description">
|
28
|
+
<div class="card-text">
|
29
|
+
<% if search.long_description.present? %>
|
30
|
+
<%= truncate(search.long_description, length: 89) %>
|
31
|
+
<% else %>
|
32
|
+
<span class="missing-description"><%= t(:'spotlight.searches.search.missing_description_html', link: (link_to action_label(search, :edit_long), [spotlight, :edit, search.exhibit, search])) %></span>
|
33
|
+
<% end %>
|
33
34
|
</div>
|
34
35
|
</div>
|
35
|
-
|
36
|
-
|
36
|
+
<% else %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|