blacklight-spotlight 3.0.0.alpha.3 → 3.0.0.alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/blacklight/highlight_off.svg +1 -0
- data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +3 -3
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +19 -23
- data/app/assets/stylesheets/spotlight/_browse.scss +22 -13
- data/app/assets/stylesheets/spotlight/_catalog.scss +2 -2
- data/app/assets/stylesheets/spotlight/_curation.scss +5 -3
- data/app/assets/stylesheets/spotlight/_exhibits_index.scss +14 -1
- data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +5 -5
- data/app/assets/stylesheets/spotlight/_header.scss +14 -6
- data/app/assets/stylesheets/spotlight/_multi_image_selector.scss +1 -1
- data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +3 -3
- data/app/assets/stylesheets/spotlight/_pages.scss +23 -16
- data/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss +3 -4
- data/app/assets/stylesheets/spotlight/_slideshow_block.scss +1 -0
- data/app/assets/stylesheets/spotlight/_spotlight.scss +0 -1
- data/app/assets/stylesheets/spotlight/_translations.scss +6 -6
- data/app/assets/stylesheets/spotlight/_utilities.scss +4 -0
- data/app/controllers/spotlight/translations_controller.rb +9 -1
- data/app/helpers/spotlight/pages_helper.rb +2 -1
- data/app/models/spotlight/field_metadata.rb +1 -2
- data/app/views/shared/_masthead.html.erb +13 -11
- data/app/views/spotlight/about_pages/_contact.html.erb +3 -3
- data/app/views/spotlight/about_pages/_contact_properties.html.erb +1 -1
- data/app/views/spotlight/admin_users/index.html.erb +77 -71
- data/app/views/spotlight/browse/_search_box.html.erb +1 -1
- data/app/views/spotlight/browse/show.html.erb +23 -26
- data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
- data/app/views/spotlight/catalog/_index_compact_default.html.erb +2 -2
- data/app/views/spotlight/contacts/_form.html.erb +1 -1
- data/app/views/spotlight/custom_fields/_form.html.erb +2 -2
- data/app/views/spotlight/custom_fields/form_group/_text.html.erb +2 -2
- data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +2 -2
- data/app/views/spotlight/custom_search_fields/_form.html.erb +1 -1
- data/app/views/spotlight/dashboards/_page.html.erb +4 -4
- data/app/views/spotlight/exhibits/_exhibit_card_back.html.erb +2 -2
- data/app/views/spotlight/feature_pages/_header.html.erb +2 -2
- data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
- data/app/views/spotlight/pages/_form.html.erb +1 -1
- data/app/views/spotlight/pages/_page.html.erb +3 -3
- data/app/views/spotlight/roles/index.html.erb +2 -2
- data/app/views/spotlight/search_configurations/_facet_metadata.html.erb +0 -5
- data/app/views/spotlight/search_configurations/_facets.html.erb +3 -3
- data/app/views/spotlight/search_configurations/_search_fields.html.erb +2 -2
- data/app/views/spotlight/searches/_form.html.erb +2 -2
- data/app/views/spotlight/shared/_report_a_problem.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_quote_block.html.erb +4 -4
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +1 -1
- data/app/views/spotlight/translations/_search_fields.html.erb +1 -1
- data/app/views/spotlight/translations/edit.html.erb +1 -1
- data/lib/generators/spotlight/install_generator.rb +6 -2
- data/lib/generators/spotlight/templates/config/initializers/oembed.rb +4 -0
- data/lib/spotlight/engine.rb +0 -5
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/translations_controller_spec.rb +8 -0
- data/spec/examples.txt +6 -7
- data/spec/features/javascript/search_config_admin_spec.rb +1 -1
- data/spec/helpers/spotlight/pages_helper_spec.rb +6 -0
- data/spec/models/spotlight/field_metadata_spec.rb +0 -7
- data/spec/test_app_templates/Gemfile.extra +0 -1
- data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +0 -1
- data/vendor/assets/stylesheets/sir-trevor/_variables.scss +0 -8
- data/vendor/assets/stylesheets/sir-trevor/block-controls.scss +0 -4
- metadata +4 -6
- data/app/assets/images/blacklight/remove_circle_outline.svg +0 -1
- data/app/views/spotlight/browse/_sort_and_per_page.html.erb +0 -5
- data/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb +0 -12
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= bootstrap_form_for @custom_field.new_record? ? [current_exhibit, @custom_field] : [@custom_field.exhibit, @custom_field], layout: :horizontal, label_col: 'col-md-3', control_col: 'col-sm-
|
1
|
+
<%= bootstrap_form_for @custom_field.new_record? ? [current_exhibit, @custom_field] : [@custom_field.exhibit, @custom_field], layout: :horizontal, label_col: 'col-md-3', control_col: 'col-sm-9', html: {class: 'col-md-9', id: 'edit-search'} do |f| %>
|
2
2
|
|
3
3
|
<%= f.text_field :label %>
|
4
4
|
<%= f.text_area :short_description %>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
<div class="form-actions">
|
17
17
|
<div class="primary-actions">
|
18
|
-
<%= link_to t(:"cancel"), edit_exhibit_metadata_configuration_path(current_exhibit)
|
18
|
+
<%= link_to t(:"cancel"), edit_exhibit_metadata_configuration_path(current_exhibit) %>
|
19
19
|
<%= f.submit nil, class: 'btn btn-primary' %>
|
20
20
|
</div>
|
21
21
|
</div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<div class="form-group <%= "row" if inline %>">
|
7
7
|
<% Array(value || '').each_with_index do |v, index| %>
|
8
|
-
<%= f.label field.slug, field.label, namespace: "f#{index}", class: "
|
8
|
+
<%= f.label field.slug, field.label, namespace: "f#{index}", class: "col-form-label #{label_col if inline} #{'sr-only' if index > 0}" %>
|
9
9
|
<div class="mb-3 <%= control_col if inline %>">
|
10
10
|
<%= f.text_area_without_bootstrap field.slug, namespace: "f#{index}",multiple: field.is_multiple?, value: v, class: "form-control field-#{field.slug}", readonly: field.readonly_field? %>
|
11
11
|
</div>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
<% if field.is_multiple? && !field.readonly_field? %>
|
15
15
|
<%= content_tag :template, id: "spotlight-field-template-#{field.slug}" do %>
|
16
|
-
<%= f.label field.slug, field.label, class: "
|
16
|
+
<%= f.label field.slug, field.label, class: "col-form-label #{label_col if inline} sr-only" %>
|
17
17
|
<div class="mb-3 <%= "#{offset_col} #{control_col}" if inline %>">
|
18
18
|
<%= f.text_area_without_bootstrap field.slug, multiple: field.is_multiple?, value: nil, class: "form-control field-#{field.slug}" %>
|
19
19
|
</div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<div class="form-group <%= "row" if inline %>">
|
7
7
|
<% Array(value || '').each_with_index do |v, index| %>
|
8
|
-
<%= f.label field.slug, field.label, namespace: "f#{index}", class: "
|
8
|
+
<%= f.label field.slug, field.label, namespace: "f#{index}", class: "col-form-label #{label_col if inline} #{'sr-only' if index > 0}" %>
|
9
9
|
<div class="mb-3 <%= control_col if inline %>">
|
10
10
|
<%= f.text_field_without_bootstrap field.slug, namespace: "f#{index}", multiple: field.is_multiple?, value: v, class: "form-control field-#{field.slug}", readonly: field.readonly_field? %>
|
11
11
|
</div>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
<% if field.is_multiple? && !field.readonly_field? %>
|
15
15
|
<%= content_tag :template, id: "spotlight-field-template-#{field.slug}" do %>
|
16
|
-
<%= f.label field.slug, field.label, class: "
|
16
|
+
<%= f.label field.slug, field.label, class: "col-form-label #{label_col if inline} sr-only" %>
|
17
17
|
<div class="mb-3 <%= "#{offset_col} #{control_col}" if inline %>">
|
18
18
|
<%= f.text_field_without_bootstrap field.slug, multiple: field.is_multiple?, value: nil, class: "form-control field-#{field.slug}" %>
|
19
19
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<div class="form-actions">
|
8
8
|
<div class="primary-actions">
|
9
|
-
<%= link_to t(:"cancel"), edit_exhibit_search_configuration_path(current_exhibit)
|
9
|
+
<%= link_to t(:"cancel"), edit_exhibit_search_configuration_path(current_exhibit) %>
|
10
10
|
<%= f.submit nil, class: 'btn btn-primary' %>
|
11
11
|
</div>
|
12
12
|
</div>
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<h4 class="h5 mb-0"><%= page.title %></h4>
|
4
4
|
<div class="page-links pt-0">
|
5
5
|
<% if page.is_a?(Spotlight::HomePage) %>
|
6
|
-
<%= link_to action_default_value(page, :view), current_exhibit
|
7
|
-
<%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit),
|
6
|
+
<%= link_to action_default_value(page, :view), current_exhibit %> ·
|
7
|
+
<%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit), data: { turbolinks: false } %>
|
8
8
|
<% else %>
|
9
|
-
<%= exhibit_view_link page
|
10
|
-
<%= exhibit_edit_link page,
|
9
|
+
<%= exhibit_view_link page %> ·
|
10
|
+
<%= exhibit_edit_link page, data: { turbolinks: false } %>
|
11
11
|
<% end %>
|
12
12
|
</div>
|
13
13
|
</td>
|
@@ -11,8 +11,8 @@
|
|
11
11
|
<p class="description">
|
12
12
|
<%= truncated_description = exhibit.description.truncate(168, omission: '', separator: ' ') %>
|
13
13
|
<% if exhibit.description.length > 168 %>
|
14
|
-
<%= content_tag(:span,"…".html_safe, class: "d-sm-
|
15
|
-
<span class="d-sm-none d-
|
14
|
+
<%= content_tag(:span,"…".html_safe, class: "d-none d-sm-inline d-xl-none") %>
|
15
|
+
<span class="d-inline d-sm-none d-xl-inline">
|
16
16
|
<%= exhibit.description.slice(truncated_description.length, exhibit.description.length) %>
|
17
17
|
</span>
|
18
18
|
<% end %>
|
@@ -12,8 +12,8 @@
|
|
12
12
|
</h3>
|
13
13
|
</div>
|
14
14
|
<div class="page-links">
|
15
|
-
<%= exhibit_view_link page, exhibit_root_path(page.exhibit)
|
16
|
-
<%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit),
|
15
|
+
<%= exhibit_view_link page, exhibit_root_path(page.exhibit) %> ·
|
16
|
+
<%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit), data: { turbolinks: false } %>
|
17
17
|
</div>
|
18
18
|
</div>
|
19
19
|
</div>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<td>
|
56
56
|
<div class="field-label"><%= field.label %></div>
|
57
57
|
<div class="actions">
|
58
|
-
<%= exhibit_edit_link field
|
59
|
-
<%= exhibit_delete_link field
|
58
|
+
<%= exhibit_edit_link field %> ·
|
59
|
+
<%= exhibit_delete_link field %>
|
60
60
|
</div>
|
61
61
|
</td>
|
62
62
|
<td class="field-description">
|
@@ -61,7 +61,7 @@
|
|
61
61
|
|
62
62
|
<div class="form-actions">
|
63
63
|
<div class="primary-actions">
|
64
|
-
<%= link_to(t('cancel'), :back,
|
64
|
+
<%= link_to(t('cancel'), :back, data: (@page.lock && @page.lock.current_session? ? { lock: url_for([spotlight, @page.exhibit, @page.lock]) } : {})) %>
|
65
65
|
<%= f.submit class: 'btn btn-primary' %>
|
66
66
|
</div>
|
67
67
|
</div>
|
@@ -18,9 +18,9 @@
|
|
18
18
|
</div>
|
19
19
|
|
20
20
|
<div class="page-links">
|
21
|
-
<%= exhibit_view_link page
|
22
|
-
<%= exhibit_edit_link page,
|
23
|
-
<%= exhibit_delete_link page
|
21
|
+
<%= exhibit_view_link page %> ·
|
22
|
+
<%= exhibit_edit_link page, data: { turbolinks: false } %> ·
|
23
|
+
<%= exhibit_delete_link page %>
|
24
24
|
</div>
|
25
25
|
<%- if page.feature_page? -%>
|
26
26
|
<%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<td></td>
|
19
19
|
<td colspan=2>
|
20
20
|
<div class="form-actions d-flex justify-content-end">
|
21
|
-
<%= cancel_link r.object, '#', class: 'btn
|
21
|
+
<%= cancel_link r.object, '#', class: 'btn-sizing', data: {behavior: 'cancel-edit' } %>
|
22
22
|
<%=f.submit nil, class: 'btn btn-primary'%>
|
23
23
|
</div>
|
24
24
|
</td>
|
@@ -43,7 +43,7 @@
|
|
43
43
|
</td>
|
44
44
|
<td colspan=2>
|
45
45
|
<div class="form-actions d-flex justify-content-end">
|
46
|
-
<%= cancel_link r.object, '#', class: 'btn
|
46
|
+
<%= cancel_link r.object, '#', class: 'btn-sizing', data: {behavior: 'cancel-edit' } %>
|
47
47
|
<%=f.submit nil, class: 'btn btn-primary'%>
|
48
48
|
</div>
|
49
49
|
</td>
|
@@ -6,9 +6,4 @@
|
|
6
6
|
<% else %>
|
7
7
|
<%= content_tag :span, t(:'.value_count', count: metadata[:value_count]) %>
|
8
8
|
<% end %>
|
9
|
-
<% if metadata[:terms].any? %>
|
10
|
-
<%= content_tag("span", class: 'btn-with-tooltip', data: {container: 'body', toggle: 'tooltip', placement: 'top', title: metadata[:terms].join(" • ")}) do %>
|
11
|
-
<%= blacklight_icon('info') %>
|
12
|
-
<% end %>
|
13
|
-
<% end %>
|
14
9
|
<% end %>
|
@@ -21,13 +21,13 @@
|
|
21
21
|
</h3>
|
22
22
|
</div>
|
23
23
|
<div class="d-flex">
|
24
|
-
<div class="facet-metadata">
|
24
|
+
<div class="facet-metadata mr-3">
|
25
25
|
<%= render partial: 'facet_metadata', locals: { metadata: metadata } %>
|
26
26
|
</div>
|
27
27
|
<div class="">
|
28
|
-
<
|
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
29
|
Options
|
30
|
-
</
|
30
|
+
</button>
|
31
31
|
<span class="collapse-chevron">❯</span>
|
32
32
|
</div>
|
33
33
|
</div>
|
@@ -63,8 +63,8 @@
|
|
63
63
|
<td>
|
64
64
|
<div class="field-label"><%= field.label %></div>
|
65
65
|
<div class="actions">
|
66
|
-
<%= exhibit_edit_link field
|
67
|
-
<%= exhibit_delete_link field
|
66
|
+
<%= exhibit_edit_link field %> ·
|
67
|
+
<%= exhibit_delete_link field %>
|
68
68
|
</div>
|
69
69
|
</td>
|
70
70
|
<td class="field-description">
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<% end %>
|
41
41
|
<% unless @search.query_params.blank? %>
|
42
42
|
<div class="form-group row">
|
43
|
-
<label class="col-md-2 col-sm-2 form-
|
43
|
+
<label class="col-md-2 col-sm-2 col-form-label"><%= t(:".query_params") %></label>
|
44
44
|
<div class="col-md-7 col-sm-7">
|
45
45
|
<div class="appliedParams card card-body bg-light d-block">
|
46
46
|
<%= render_constraints(@search.query_params) %>
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
<div class="form-actions">
|
70
70
|
<div class="primary-actions">
|
71
|
-
<%= cancel_link @search,exhibit_searches_path(@exhibit), class: 'btn
|
71
|
+
<%= cancel_link @search,exhibit_searches_path(@exhibit), class: 'btn-sizing' %>
|
72
72
|
<%= f.submit nil, class: 'btn btn-primary' %>
|
73
73
|
</div>
|
74
74
|
</div>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%= f.hidden_field :current_url %>
|
15
15
|
<div class="form-actions">
|
16
16
|
<div class="primary-actions">
|
17
|
-
<%= link_to t(:'helpers.action.cancel'), '#', class: 'btn
|
17
|
+
<%= link_to t(:'helpers.action.cancel'), '#', class: 'btn-sizing', data: { 'behavior' => 'cancel-link' } %>
|
18
18
|
<%= f.submit nil, class: 'btn btn-primary' %>
|
19
19
|
</div>
|
20
20
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="content-block item-text row d-block">
|
1
|
+
<div class="content-block item-text row d-block clearfix">
|
2
2
|
<div class="<%= 'col-md-6' if oembed_block.text? %> col-12 <%= oembed_block.content_align == 'right' ? 'float-right' : 'float-left' %> oembed-block">
|
3
3
|
<%= render_oembed_tag oembed_block.url %>
|
4
4
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="st__content-block st__content-block--quote">
|
2
2
|
<div class="quote">
|
3
|
-
<blockquote>
|
3
|
+
<blockquote class="blockquote">
|
4
4
|
<div class="quote__content">
|
5
5
|
<% if quote_block.format == :html %>
|
6
6
|
<%= sir_trevor_format quote_block.text, format: quote_block.format %>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
</div>
|
11
11
|
|
12
12
|
<% if quote_block.cite.present? %>
|
13
|
-
<
|
14
|
-
<cite class="quote__cite-text"
|
15
|
-
</
|
13
|
+
<footer class="quote__cite blockquote-footer">
|
14
|
+
<cite class="quote__cite-text"><%= quote_block.cite %></cite>
|
15
|
+
</footer>
|
16
16
|
<% end %>
|
17
17
|
</blockquote>
|
18
18
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% solr_documents_block.with_solr_helper(self) %>
|
2
2
|
|
3
|
-
<div class="content-block items-block row d-block">
|
3
|
+
<div class="content-block items-block row d-block clearfix">
|
4
4
|
<% if solr_documents_block.documents? %>
|
5
5
|
|
6
6
|
<div class="items-col spotlight-flexbox <%= solr_documents_block.text? ? "col-md-6" : "col-md-12" %> <%= solr_documents_block.content_align == 'right' ? 'float-right' : 'float-left' %>">
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% solr_documents_embed_block.with_solr_helper(self) %>
|
2
2
|
|
3
|
-
<div class="content-block items-block row d-block">
|
3
|
+
<div class="content-block items-block row d-block clearfix">
|
4
4
|
|
5
5
|
<% if solr_documents_embed_block.documents? %>
|
6
6
|
<div class="items-col <%= solr_documents_embed_block.text? ? "col-md-6" : "col-md-12" %> <%= solr_documents_embed_block.content_align == 'right' ? 'float-right' : 'float-left' %>">
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% solr_documents_grid_block.with_solr_helper(self) %>
|
2
|
-
<div class="content-block item-grid-block row d-block">
|
2
|
+
<div class="content-block item-grid-block row d-block clearfix">
|
3
3
|
<div class="items-col align-content-start justify-content-between flex-wrap <%= solr_documents_grid_block.text? ? 'col-md-9' : 'col-md-12' %> <%= solr_documents_grid_block.content_align == 'right' ? 'float-right' : 'float-left' %>">
|
4
4
|
<% if solr_documents_grid_block.documents? %>
|
5
5
|
<% solr_documents_grid_block.each_document.each_with_index do |(block_options, document), index| %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="content-block item-text row d-block">
|
1
|
+
<div class="content-block item-text row d-block clearfix">
|
2
2
|
<div class="items-col spotlight-flexbox <%= 'col-md-6' if uploaded_items_block.text? %> col-12 <%= uploaded_items_block.content_align == 'right' ? 'float-right' : 'float-left' %> uploaded-items-block">
|
3
3
|
<% if uploaded_items_block.files.present? %>
|
4
4
|
<% uploaded_items_block.files.each do |file| %>
|
@@ -74,7 +74,7 @@
|
|
74
74
|
<%= f.fields_for :translations, translation do |translation_fields| %>
|
75
75
|
<%= translation_fields.hidden_field :key %>
|
76
76
|
<%= translation_fields.hidden_field :locale %>
|
77
|
-
<div data-translation-progress-item='true' class='form-group translation-form'>
|
77
|
+
<div data-translation-progress-item='true' class='row form-group translation-form'>
|
78
78
|
<%= translation_fields.label :value, t("spotlight.search.fields.sort.#{key}", locale: I18n.default_locale), class: 'col-form-label col-12 col-sm-2' %>
|
79
79
|
<div class='col-11 col-sm-9 card card-body panel-translation'>
|
80
80
|
<%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= curation_page_title t('spotlight.exhibits.translations.title') %>
|
7
7
|
|
8
8
|
<div class='text-center'>
|
9
|
-
<ul class='nav nav-pills
|
9
|
+
<ul class='nav nav-pills'>
|
10
10
|
<% current_exhibit.available_locales.each do |language| %>
|
11
11
|
<li role="presentation" class="nav-item">
|
12
12
|
<%= link_to spotlight.edit_exhibit_translations_path(current_exhibit, language: language), class: "nav-link #{'active' if @language == language}" do %>
|
@@ -64,7 +64,9 @@ module Spotlight
|
|
64
64
|
|
65
65
|
def add_helper
|
66
66
|
copy_file 'spotlight_helper.rb', 'app/helpers/spotlight_helper.rb'
|
67
|
-
|
67
|
+
inject_into_file 'app/helpers/application_helper.rb', after: 'module ApplicationHelper' do
|
68
|
+
"\n include SpotlightHelper"
|
69
|
+
end
|
68
70
|
end
|
69
71
|
|
70
72
|
def add_model_mixin
|
@@ -107,8 +109,10 @@ module Spotlight
|
|
107
109
|
end
|
108
110
|
|
109
111
|
def add_oembed
|
110
|
-
gem 'blacklight-oembed', '
|
112
|
+
gem 'blacklight-oembed', '~> 1.0'
|
113
|
+
Bundler.with_clean_env { run 'bundle install' }
|
111
114
|
generate 'blacklight_oembed:install'
|
115
|
+
copy_file 'config/initializers/oembed.rb'
|
112
116
|
end
|
113
117
|
|
114
118
|
def add_mailer_defaults
|
data/lib/spotlight/engine.rb
CHANGED
@@ -53,15 +53,10 @@ module Spotlight
|
|
53
53
|
require 'cancan'
|
54
54
|
require 'bootstrap_form'
|
55
55
|
require 'acts-as-taggable-on'
|
56
|
-
require 'oembed'
|
57
56
|
|
58
57
|
Mime::Type.register 'application/solr+json', :solr_json
|
59
58
|
end
|
60
59
|
|
61
|
-
initializer 'oembed.initialize' do
|
62
|
-
OEmbed::Providers.register_all
|
63
|
-
end
|
64
|
-
|
65
60
|
initializer 'spotlight.factories', after: 'factory_bot.set_factory_paths' do
|
66
61
|
FactoryBot.definition_file_paths << File.expand_path('../../spec/factories', __dir__) if defined?(FactoryBot)
|
67
62
|
end
|
data/lib/spotlight/version.rb
CHANGED
@@ -23,6 +23,14 @@ describe Spotlight::TranslationsController do
|
|
23
23
|
expect(response).to render_template(:edit)
|
24
24
|
expect(response).to be_successful
|
25
25
|
end
|
26
|
+
|
27
|
+
it 'shows the breadcrumbs' do
|
28
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', exhibit)
|
29
|
+
expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit))
|
30
|
+
expect(controller).to receive(:add_breadcrumb).with('Translations')
|
31
|
+
get :edit, params: { exhibit_id: exhibit }
|
32
|
+
expect(response).to be_successful
|
33
|
+
end
|
26
34
|
end
|
27
35
|
end
|
28
36
|
|
data/spec/examples.txt
CHANGED
@@ -920,10 +920,9 @@ example_id
|
|
920
920
|
./spec/models/spotlight/featured_image_spec.rb[1:2:3] | passed | 0.00887 seconds |
|
921
921
|
./spec/models/spotlight/featured_image_spec.rb[1:3:1] | passed | 0.0062 seconds |
|
922
922
|
./spec/models/spotlight/featured_image_spec.rb[1:3:2] | passed | 0.00653 seconds |
|
923
|
-
./spec/models/spotlight/field_metadata_spec.rb[1:1:1] | passed | 0.
|
924
|
-
./spec/models/spotlight/field_metadata_spec.rb[1:1:2] | passed | 0.
|
925
|
-
./spec/models/spotlight/field_metadata_spec.rb[1:1:3]
|
926
|
-
./spec/models/spotlight/field_metadata_spec.rb[1:1:4:1] | passed | 0.03324 seconds |
|
923
|
+
./spec/models/spotlight/field_metadata_spec.rb[1:1:1] | passed | 0.67522 seconds |
|
924
|
+
./spec/models/spotlight/field_metadata_spec.rb[1:1:2] | passed | 0.04106 seconds |
|
925
|
+
./spec/models/spotlight/field_metadata_spec.rb[1:1:3:1] | passed | 0.04338 seconds |
|
927
926
|
./spec/models/spotlight/filter_spec.rb[1:1:1] | passed | 0.00736 seconds |
|
928
927
|
./spec/models/spotlight/filter_spec.rb[1:2:1] | passed | 0.01274 seconds |
|
929
928
|
./spec/models/spotlight/home_page_spec.rb[1:1] | passed | 0.0074 seconds |
|
@@ -1335,9 +1334,9 @@ example_id
|
|
1335
1334
|
./spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb[1:1] | passed | 0.02178 seconds |
|
1336
1335
|
./spec/views/spotlight/resources/new.html.erb_spec.rb[1:1] | passed | 0.04266 seconds |
|
1337
1336
|
./spec/views/spotlight/roles/index.html.erb_spec.rb[1:1] | passed | 0.28461 seconds |
|
1338
|
-
./spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb[1:1:1] | passed | 0.
|
1339
|
-
./spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb[1:2:1] | passed | 0.
|
1340
|
-
./spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb[1:3:1] | passed | 0.
|
1337
|
+
./spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb[1:1:1] | passed | 0.0101 seconds |
|
1338
|
+
./spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb[1:2:1] | passed | 0.3658 seconds |
|
1339
|
+
./spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb[1:3:1] | passed | 0.01568 seconds |
|
1341
1340
|
./spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb[1:1] | passed | 0.14315 seconds |
|
1342
1341
|
./spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb[1:2] | passed | 0.07287 seconds |
|
1343
1342
|
./spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb[1:3] | passed | 0.05832 seconds |
|
@@ -74,7 +74,7 @@ describe 'Search Configuration Administration', js: true do
|
|
74
74
|
click_link 'Facets'
|
75
75
|
|
76
76
|
within '.facet-config-genre_ssim' do
|
77
|
-
|
77
|
+
click_button 'Options'
|
78
78
|
expect(find(:css, '#blacklight_configuration_facet_fields_genre_ssim_sort_count')).to be_checked
|
79
79
|
|
80
80
|
choose 'Value'
|
@@ -121,4 +121,10 @@ describe Spotlight::PagesHelper, type: :helper do
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
124
|
+
|
125
|
+
describe '#render_contact_email_address' do
|
126
|
+
it 'adds soft breaks in appropriate places' do
|
127
|
+
expect(helper.render_contact_email_address('local.part@example.com')).to have_css 'wbr', count: 3, visible: false
|
128
|
+
end
|
129
|
+
end
|
124
130
|
end
|
@@ -48,17 +48,10 @@ describe Spotlight::FieldMetadata do
|
|
48
48
|
expect(subject.field('some_key')[:value_count]).to eq 3
|
49
49
|
end
|
50
50
|
|
51
|
-
it 'gets a list of top terms' do
|
52
|
-
expect(subject.field('a')[:terms]).to match_array %w[a b c]
|
53
|
-
expect(subject.field('b')[:terms]).to match_array %w[b]
|
54
|
-
expect(subject.field('some_key')[:terms]).to match_array [7, 8, 9]
|
55
|
-
end
|
56
|
-
|
57
51
|
context 'for a missing field' do
|
58
52
|
it 'has reasonable default values' do
|
59
53
|
expect(subject.field('d')[:document_count]).to eq 0
|
60
54
|
expect(subject.field('d')[:value_count]).to eq 0
|
61
|
-
expect(subject.field('d')[:terms]).to be_empty
|
62
55
|
end
|
63
56
|
end
|
64
57
|
end
|