blacklight-spotlight 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ <p>
2
+ <%= t('spotlight.exhibits.form.uneditable_non_default_language_form.instructions') %>
3
+ </p>
4
+ <%= edit_translations_button %>
5
+ <%= switch_to_default_language_button %>
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Displays a message that this exhibit information cannot be edited in the
5
+ # currently selected language and provides other options.
6
+ class UneditableNonDefaultLanguageComponent < ViewComponent::Base
7
+ def initialize(current_exhibit:, current_language:)
8
+ @current_exhibit = current_exhibit
9
+ @current_language = current_language
10
+ super
11
+ end
12
+
13
+ def edit_translations_button
14
+ link_to I18n.t('spotlight.exhibits.form.uneditable_non_default_language_form.translations'),
15
+ helpers.spotlight.edit_exhibit_translations_path(@current_exhibit, locale: @current_language),
16
+ class: 'btn btn-primary'
17
+ end
18
+
19
+ def switch_to_default_language_button
20
+ link_to I18n.t('spotlight.exhibits.form.uneditable_non_default_language_form.default_language'),
21
+ helpers.spotlight.edit_exhibit_path(@current_exhibit, locale: I18n.default_locale),
22
+ class: 'btn btn-primary'
23
+ end
24
+ end
25
+ end
@@ -226,7 +226,7 @@ module Spotlight
226
226
  redirect_to spotlight.exhibit_root_path(@exhibit) unless has_search_parameters?
227
227
  end
228
228
 
229
- def has_search_parameters? # rubocop:disable Naming/PredicateName
229
+ def has_search_parameters? # rubocop:disable Naming/PredicatePrefix
230
230
  super || params[:browse_category_id].present?
231
231
  end
232
232
 
@@ -52,6 +52,13 @@ module Spotlight
52
52
  translated_page_for(I18n.locale)&.title || super
53
53
  end
54
54
 
55
+ # Returns the title of the page in the default locale regardless of the current locale.
56
+ def default_locale_title
57
+ return self[:title] if I18n.locale == I18n.default_locale || default_locale_page.blank?
58
+
59
+ default_locale_page[:title]
60
+ end
61
+
55
62
  def content_changed!
56
63
  @content = nil
57
64
  end
@@ -43,6 +43,9 @@
43
43
  </svg>
44
44
  <% end %>
45
45
  </span>
46
+ <% unless page.published? %>
47
+ <div class="badge bg-info unpublished align-baseline p-1"><%= t('.unpublished') %></div>
48
+ <% end %>
46
49
  </h4>
47
50
  <%= render Spotlight::EditViewLinksComponent.new(page:, classes:'page-links pt-0') %>
48
51
  </td>
@@ -66,15 +66,20 @@
66
66
  </div>
67
67
 
68
68
  <div role="tabpanel" class="tab-pane" id="main-menu">
69
- <%= field_set_tag do %>
70
- <p class="instructions"><%= t(:'.main_navigation.help') %></p>
71
- <div class="card-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
72
- <ol class="dd-list">
73
- <%= f.fields_for :main_navigations do |label| %>
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, index: label.index, enabled_method: :display } do; end %>
75
- <% end %>
76
- </ol>
77
- </div>
69
+ <%# These fields are translatable and should only be edited here in the default locale %>
70
+ <% if default_language? %>
71
+ <%= field_set_tag do %>
72
+ <p class="instructions"><%= t(:'.main_navigation.help') %></p>
73
+ <div class="card-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
74
+ <ol class="dd-list">
75
+ <%= f.fields_for :main_navigations do |label| %>
76
+ <%= 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, index: label.index, enabled_method: :display } do; end %>
77
+ <% end %>
78
+ </ol>
79
+ </div>
80
+ <% end %>
81
+ <% else %>
82
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale)%>
78
83
  <% end %>
79
84
  </div>
80
85
  </div>
@@ -1,8 +1,8 @@
1
1
  <%= bootstrap_form_for @exhibit, url: ((spotlight.exhibit_path(@exhibit) if @exhibit.persisted?) || spotlight.exhibits_path), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10', html: {class: "row"} do |f| %>
2
2
  <div class="col-md-12">
3
3
  <%= f.text_field :title, disabled: !default_language?, help: !default_language? ? t('.uneditable_non_default_language') : '' %>
4
- <%= f.text_field :subtitle %>
5
- <%= f.text_area :description %>
4
+ <%= f.text_field :subtitle, disabled: !default_language?, help: !default_language? ? t('.uneditable_non_default_language') : '' %>
5
+ <%= f.text_area :description, disabled: !default_language?, help: !default_language? ? t('.uneditable_non_default_language') : '' %>
6
6
  <%= render Spotlight::TagListFormComponent.new(form: f) %>
7
7
  <%= f.form_group(:contact_emails, label: { text: nil, class: nil, for: 'exhibit_contact_email_0' }, class: 'form-group mb-3', help: nil) do %>
8
8
  <%= f.fields_for :contact_emails do |contact| %>
@@ -3,59 +3,59 @@
3
3
  <% end %>
4
4
 
5
5
  <%= configuration_page_title %>
6
- <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_metadata_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
7
- <h2><%= t(:'.order_header') %></h2>
6
+ <%# These fields are translatable and should only be edited here in the default locale %>
7
+ <% if default_language? %>
8
+ <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_metadata_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
9
+ <h2><%= t(:'.order_header') %></h2>
8
10
 
9
- <p class="instructions"><%= t :'.instructions' %></p>
11
+ <p class="instructions"><%= t :'.instructions' %></p>
10
12
 
11
- <table id="nested-fields" class="metadata-configuration table table-striped dd-table">
12
- <thead>
13
- <tr>
14
- <th class="w-50"><%= t :'.field.label' %></th>
15
- <th class="text-center">
16
- <div>
17
- <%= t :'.view.show' %>
18
- </div>
19
- <div class="text-center">
20
- <%= label_tag 'item_details', class: 'select-label' do %>
21
- <%= select_deselect_action(t :'.view.select_id') %>
22
- <%= t(:'.select_all') %>
23
- <% end %>
24
- </div>
25
- </th>
26
- <% available_view_fields.keys.each do |type| %>
13
+ <table id="nested-fields" class="metadata-configuration table table-striped dd-table">
14
+ <thead>
15
+ <tr>
16
+ <th class="w-50"><%= t :'.field.label' %></th>
27
17
  <th class="text-center">
28
- <div>
29
- <%= t :".view.#{type}", default: t("blacklight.search.view.#{type}", default: type.to_s.humanize.titleize) %>
18
+ <div>
19
+ <%= t :'.view.show' %>
30
20
  </div>
31
21
  <div class="text-center">
32
- <%= label_tag t(:'.deselect_all') + type.to_s, class: 'select-label' do %>
33
- <%= select_deselect_action(t(:'.deselect_all') + type.to_s) %>
34
- <%= t(:'.select_all') %>
35
- <% end %>
22
+ <%= label_tag 'item_details', class: 'select-label' do %>
23
+ <%= select_deselect_action(t :'.view.select_id') %>
24
+ <%= t(:'.select_all') %>
25
+ <% end %>
36
26
  </div>
37
27
  </th>
28
+ <% available_view_fields.keys.each do |type| %>
29
+ <th class="text-center">
30
+ <div>
31
+ <%= t :".view.#{type}", default: t("blacklight.search.view.#{type}", default: type.to_s.humanize.titleize) %>
32
+ </div>
33
+ <div class="text-center">
34
+ <%= label_tag t(:'.deselect_all') + type.to_s, class: 'select-label' do %>
35
+ <%= select_deselect_action(t(:'.deselect_all') + type.to_s) %>
36
+ <%= t(:'.select_all') %>
37
+ <% end %>
38
+ </div>
39
+ </th>
40
+ <% end %>
41
+ <th class="text-center"><%= t :'.type_label' %></th>
42
+ </tr>
43
+ </thead>
44
+ <tbody class="metadata_fields dd dd-list" data-behavior="nestable" data-max-depth="1" data-list-node-name="tbody" data-item-node-name="tr" data-expand-btn-HTML=" " data-collapse-btn-HTML=" ">
45
+ <%= f.fields_for :index_fields do |idxf| %>
46
+ <% @blacklight_configuration.blacklight_config.index_fields.select { |k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) }.each do |key, config| %>
47
+ <%= render partial: 'metadata_field', locals: { key: key, config: config, f: idxf } %>
48
+ <% end %>
38
49
  <% end %>
39
- <th class="text-center"><%= t :'.type_label' %></th>
40
- </tr>
41
- </thead>
42
- <tbody class="metadata_fields dd dd-list" data-behavior="nestable" data-max-depth="1" data-list-node-name="tbody" data-item-node-name="tr" data-expand-btn-HTML=" " data-collapse-btn-HTML=" ">
43
- <%= f.fields_for :index_fields do |idxf| %>
44
- <% @blacklight_configuration.blacklight_config.index_fields.select { |k, v| blacklight_configuration_context.evaluate_if_unless_configuration(v.original) }.each do |key, config| %>
45
- <%= render partial: 'metadata_field', locals: { key: key, config: config, f: idxf } %>
46
- <% end %>
47
- <% end %>
48
- </tbody>
49
- </table>
50
+ </tbody>
51
+ </table>
50
52
 
51
- <div class="form-actions">
52
- <div class="primary-actions">
53
- <%= f.submit nil, class: 'btn btn-primary' %>
53
+ <div class="form-actions">
54
+ <div class="primary-actions">
55
+ <%= f.submit nil, class: 'btn btn-primary' %>
56
+ </div>
54
57
  </div>
55
- </div>
56
- <% end %>
57
-
58
-
58
+ <% end %>
59
59
  <h2 class="mt-4"><%= t(:'.exhibit_specific.header') %></h2>
60
60
  <p class="instructions"><%= t(:'.exhibit_specific.instructions') %></p>
61
61
 
@@ -80,4 +80,7 @@
80
80
  </table>
81
81
 
82
82
 
83
- <%= exhibit_create_link Spotlight::CustomField.new, class: 'btn btn-primary' %>
83
+ <%= exhibit_create_link Spotlight::CustomField.new, class: 'btn btn-primary' %>
84
+ <% else %>
85
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale) %>
86
+ <% end %>
@@ -1,33 +1,38 @@
1
1
  <%= curation_page_title t(:"spotlight.pages.index.#{page_collection_name}.header") %>
2
- <%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, page_collection_name.to_sym]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %>
2
+ <%# These fields are translatable and should only be edited here in the default locale %>
3
+ <% if default_language? %>
4
+ <%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, page_collection_name.to_sym]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %>
3
5
 
4
- <%= render partial: 'header', locals: {f: f} %>
5
- <h2 class="mt-4"><%= t :'.pages_header' %></h2>
6
- <p class="instructions"><%= t :'.instructions' %></p>
7
- <div class="panel-group dd <%= page_collection_name %>_admin" id="nested-pages" data-behavior="nestable" <%= nestable_data_attributes(page_collection_name).html_safe %> >
8
- <ol class="dd-list">
9
- <%= f.fields_for page_collection_name do |p| %>
10
- <%- if p.object.about_page? || p.object.top_level_page? -%>
11
- <%= render partial: 'page', locals: {f: p, parent_form: f} %>
12
- <%- end -%>
13
- <% end %>
14
- </ol>
15
- </div>
16
- <div class="form-actions float-end">
17
- <div class="primary-actions">
18
- <%= button_tag action_label(page_collection_name, :update_all), class: "btn btn-primary", disabled: disable_save_pages_button? %>
6
+ <%= render partial: 'header', locals: {f: f} %>
7
+ <h2 class="mt-4"><%= t :'.pages_header' %></h2>
8
+ <p class="instructions"><%= t :'.instructions' %></p>
9
+ <div class="panel-group dd <%= page_collection_name %>_admin" id="nested-pages" data-behavior="nestable" <%= nestable_data_attributes(page_collection_name).html_safe %> >
10
+ <ol class="dd-list">
11
+ <%= f.fields_for page_collection_name do |p| %>
12
+ <%- if p.object.about_page? || p.object.top_level_page? -%>
13
+ <%= render partial: 'page', locals: {f: p, parent_form: f} %>
14
+ <%- end -%>
15
+ <% end %>
16
+ </ol>
17
+ </div>
18
+ <div class="form-actions float-end">
19
+ <div class="primary-actions">
20
+ <%= button_tag action_label(page_collection_name, :update_all), class: "btn btn-primary", disabled: disable_save_pages_button? %>
21
+ </div>
19
22
  </div>
20
- </div>
21
- <%- end -%>
22
- <div>
23
- <%= form_for @page, url: spotlight.polymorphic_path([@exhibit, page_collection_name.to_sym]), html: {class: "expanded-add-button"} do |f|%>
24
- <a href='#add-new' class="btn btn-primary" data-turbo="false" data-turbolinks="false" data-expanded-add-button="true" data-field-target="[data-title-field]">
25
- <%= t(:'.new_page') %> <%= blacklight_icon('chevron_right') %>
26
- <span data-title-field="true" class="input-field">
27
- <%= f.text_field(:title) %>
28
- <%= f.submit t(:'.save'), data: {behavior: "save"} %>
29
- <%= f.submit t(:'.cancel'), data: {behavior: "cancel"} %>
30
- </span>
31
- </a>
32
23
  <%- end -%>
33
- </div>
24
+ <div>
25
+ <%= form_for @page, url: spotlight.polymorphic_path([@exhibit, page_collection_name.to_sym]), html: {class: "expanded-add-button"} do |f|%>
26
+ <a href='#add-new' class="btn btn-primary" data-turbo="false" data-turbolinks="false" data-expanded-add-button="true" data-field-target="[data-title-field]">
27
+ <%= t(:'.new_page') %> <%= blacklight_icon('chevron_right') %>
28
+ <span data-title-field="true" class="input-field">
29
+ <%= f.text_field(:title) %>
30
+ <%= f.submit t(:'.save'), data: {behavior: "save"} %>
31
+ <%= f.submit t(:'.cancel'), data: {behavior: "cancel"} %>
32
+ </span>
33
+ </a>
34
+ <%- end -%>
35
+ </div>
36
+ <% else %>
37
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale)%>
38
+ <% end %>
@@ -3,45 +3,51 @@
3
3
  <% end %>
4
4
 
5
5
  <%= configuration_page_title %>
6
- <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_search_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
7
-
8
- <div role="tabpanel">
9
- <ul class="nav nav-tabs" role="tablist">
10
- <li role="presentation" class="nav-item">
11
- <a href="#options" aria-controls="options" role="tab" data-bs-toggle="tab" class="nav-link active"><%= t(:'.tab.options') %></a>
12
- </li>
13
- <li role="presentation" class="nav-item">
14
- <a href="#facets" aria-controls="facets" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.facets') %></a>
15
- </li>
16
- <li role="presentation" class="nav-item">
17
- <a href="#results" aria-controls="results" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.results') %></a>
18
- </li>
19
- </ul>
20
- <div class="tab-content">
21
- <div role="tabpanel" class="tab-pane active" id="options">
22
- <%= render 'search_fields', f: f %>
23
- </div>
24
-
25
- <div role="tabpanel" class="tab-pane" id="facets">
26
- <%= render 'facets', f: f %>
27
- </div>
28
6
 
29
- <div role="tabpanel" class="tab-pane" id="results">
30
- <%= field_set_tag do %>
31
- <%= render 'document_index_view_types', f: f %>
32
- <%= render 'default_per_page', f: f %>
33
- <% end %>
7
+ <%# These fields are translatable and should only be edited here in the default locale %>
8
+ <% if default_language? %>
9
+ <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_search_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %>
10
+
11
+ <div role="tabpanel">
12
+ <ul class="nav nav-tabs" role="tablist">
13
+ <li role="presentation" class="nav-item">
14
+ <a href="#options" aria-controls="options" role="tab" data-bs-toggle="tab" class="nav-link active"><%= t(:'.tab.options') %></a>
15
+ </li>
16
+ <li role="presentation" class="nav-item">
17
+ <a href="#facets" aria-controls="facets" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.facets') %></a>
18
+ </li>
19
+ <li role="presentation" class="nav-item">
20
+ <a href="#results" aria-controls="results" role="tab" data-bs-toggle="tab" class="nav-link"><%= t(:'.tab.results') %></a>
21
+ </li>
22
+ </ul>
23
+ <div class="tab-content">
24
+ <div role="tabpanel" class="tab-pane active" id="options">
25
+ <%= render 'search_fields', f: f %>
26
+ </div>
27
+
28
+ <div role="tabpanel" class="tab-pane" id="facets">
29
+ <%= render 'facets', f: f %>
30
+ </div>
31
+
32
+ <div role="tabpanel" class="tab-pane" id="results">
33
+ <%= field_set_tag do %>
34
+ <%= render 'document_index_view_types', f: f %>
35
+ <%= render 'default_per_page', f: f %>
36
+ <% end %>
37
+
38
+ <%= render 'sort', f: f %>
39
+ </div>
34
40
 
35
- <%= render 'sort', f: f %>
36
41
  </div>
37
-
38
42
  </div>
39
- </div>
40
43
 
41
- <div class="form-actions">
42
- <div class="primary-actions">
43
- <%= f.submit nil, class: 'btn btn-primary' %>
44
+ <div class="form-actions">
45
+ <div class="primary-actions">
46
+ <%= f.submit nil, class: 'btn btn-primary' %>
47
+ </div>
44
48
  </div>
45
- </div>
46
49
 
50
+ <% end %>
51
+ <% else %>
52
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale)%>
47
53
  <% end %>
@@ -4,14 +4,14 @@
4
4
 
5
5
  <%= curation_page_title %>
6
6
 
7
- <% if @searches.empty? %>
7
+ <% if @searches.empty? && default_language? %>
8
8
  <%= t :'.no_saved_searches' %>
9
9
  <% unless @exhibit.searchable? %>
10
10
  <p class="instructions alert-warning">
11
11
  <%= t(:'.not_searchable_html', href: link_to(t(:'spotlight.configuration.sidebar.search_configuration'), spotlight.edit_exhibit_search_configuration_path(@exhibit))) %>
12
12
  </p>
13
13
  <% end %>
14
- <% else %>
14
+ <% elsif default_language? %>
15
15
  <div role="tabpanel">
16
16
  <ul class="nav nav-tabs" role="tablist">
17
17
  <li role="presentation" class="nav-item">
@@ -74,4 +74,6 @@
74
74
  </div>
75
75
  </div>
76
76
  </div>
77
+ <% else %>
78
+ <%= render Spotlight::UneditableNonDefaultLanguageComponent.new(current_exhibit:, current_language: I18n.locale) %>
77
79
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <% translated_page = page.translated_page_for(@language) %>
2
2
  <tr data-translation-progress-item="true">
3
3
  <td>
4
- <%= link_to page.title, polymorphic_path([spotlight, current_exhibit, page]) %>
4
+ <%= link_to page.default_locale_title, polymorphic_path([spotlight, current_exhibit, page], locale: I18n.default_locale) %>
5
5
  <p class="<%= 'default-page-outdated' if page.updated_after? translated_page %>">
6
6
  <%= l(page.updated_at, format: :long) %>
7
7
  </p>
@@ -200,6 +200,7 @@ en:
200
200
  has_alt_text: Items with alt text
201
201
  page_title: Page title
202
202
  total_items: Of the items displayed via widgets, <b>%{has_alt_text} of %{total_alt_items}</b> have entered alt text (or a checked decorative box).
203
+ unpublished: Unpublished
203
204
  header: Accessibility
204
205
  admin_users:
205
206
  create:
@@ -575,6 +576,10 @@ en:
575
576
  published:
576
577
  help_block: ''
577
578
  uneditable_non_default_language: This field is not editable in the current language. Switch to the default language to edit it.
579
+ uneditable_non_default_language_form:
580
+ default_language: Switch to default language
581
+ instructions: Please use the translations editor or switch to the default language to make configuration changes.
582
+ translations: Edit translations
578
583
  groups:
579
584
  all: All
580
585
  import:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '5.0.1'
4
+ VERSION = '5.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2025-04-24 00:00:00.000000000 Z
14
+ date: 2025-06-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -865,8 +865,6 @@ files:
865
865
  - app/components/spotlight/analytics/aggregation_component.rb
866
866
  - app/components/spotlight/analytics/dashboard_component.html.erb
867
867
  - app/components/spotlight/analytics/dashboard_component.rb
868
- - app/components/spotlight/blocks/heading_block_component.erb
869
- - app/components/spotlight/blocks/heading_block_component.rb
870
868
  - app/components/spotlight/breadcrumbs_component.html.erb
871
869
  - app/components/spotlight/breadcrumbs_component.rb
872
870
  - app/components/spotlight/bulk_action_component.html.erb
@@ -899,6 +897,8 @@ files:
899
897
  - app/components/spotlight/title_component.rb
900
898
  - app/components/spotlight/translations/subheading_component.html.erb
901
899
  - app/components/spotlight/translations/subheading_component.rb
900
+ - app/components/spotlight/uneditable_non_default_language_component.html.erb
901
+ - app/components/spotlight/uneditable_non_default_language_component.rb
902
902
  - app/controllers/concerns/spotlight/base.rb
903
903
  - app/controllers/concerns/spotlight/catalog.rb
904
904
  - app/controllers/concerns/spotlight/config.rb
@@ -1548,7 +1548,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1548
1548
  - !ruby/object:Gem::Version
1549
1549
  version: '0'
1550
1550
  requirements: []
1551
- rubygems_version: 3.5.11
1551
+ rubygems_version: 3.5.9
1552
1552
  signing_key:
1553
1553
  specification_version: 4
1554
1554
  summary: Enable librarians, curators, and others who are responsible for digital collections
@@ -1,2 +0,0 @@
1
- <p>I am in the component</p>
2
- <%= content_tag heading_tag, text %>
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spotlight
4
- module Blocks
5
- # Sir Trevor Heading Block
6
- class HeadingBlockComponent < ViewComponent::Base
7
- def initialize(heading_block:)
8
- @heading_block = heading_block
9
- super
10
- end
11
-
12
- attr_reader :heading_block
13
-
14
- delegate :level, to: :heading_block
15
- delegate :format, to: :heading_block
16
- delegate :text, to: :heading_block
17
-
18
- def heading_tag
19
- return "h#{level}" if html? && valid_level?
20
-
21
- # h2 was Spotlight's default heading tag for 10+ years.
22
- 'h2'
23
- end
24
-
25
- private
26
-
27
- def valid_level?
28
- level.to_i.between?(1, 6)
29
- end
30
-
31
- def html?
32
- heading_block.format.to_s == 'html'
33
- end
34
- end
35
- end
36
- end