blacklight-spotlight 5.0.0 → 5.0.1
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
- data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
- data/app/components/spotlight/blocks/heading_block_component.erb +2 -0
- data/app/components/spotlight/blocks/heading_block_component.rb +36 -0
- data/app/controllers/concerns/spotlight/catalog.rb +1 -1
- data/app/controllers/concerns/spotlight/controller.rb +1 -1
- data/app/controllers/spotlight/browse_controller.rb +2 -2
- data/app/controllers/spotlight/searches_controller.rb +2 -1
- data/app/models/sir_trevor_rails/blocks/displayable.rb +2 -1
- data/app/models/spotlight/lock.rb +1 -1
- data/app/views/spotlight/about_pages/_contact.html.erb +1 -1
- data/app/views/spotlight/pages/_page.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_facets.html.erb +1 -1
- data/app/views/spotlight/searches/_group.html.erb +1 -1
- data/app/views/spotlight/searches/_search.html.erb +1 -1
- data/app/views/spotlight/tags/_tag.html.erb +1 -1
- data/lib/spotlight/version.rb +1 -1
- metadata +5 -3
@@ -0,0 +1,36 @@
|
|
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
|
@@ -34,7 +34,7 @@ module Spotlight
|
|
34
34
|
# rubocop:enable Metrics/MethodLength
|
35
35
|
|
36
36
|
def render_curator_actions?
|
37
|
-
|
37
|
+
current_exhibit && can?(:curate, current_exhibit) &&
|
38
38
|
!(params[:controller] == 'spotlight/catalog' && params[:action] == 'admin')
|
39
39
|
end
|
40
40
|
end
|
@@ -73,7 +73,7 @@ module Spotlight
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def attach_search_breadcrumb
|
76
|
-
add_breadcrumb(@search.full_title,
|
76
|
+
add_breadcrumb(@search.full_title, @group.present? ? exhibit_browse_group_path(@exhibit, @group, @search) : exhibit_browse_path(@exhibit, @search))
|
77
77
|
end
|
78
78
|
|
79
79
|
def _prefixes
|
@@ -89,7 +89,7 @@ module Spotlight
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def resource_masthead?
|
92
|
-
@search&.masthead
|
92
|
+
@search&.masthead&.display?
|
93
93
|
end
|
94
94
|
|
95
95
|
# This is overidden for the browse controller context from where it is defined in a helper
|
@@ -35,7 +35,8 @@ module Spotlight
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def create
|
38
|
-
|
38
|
+
params_to_exclude = :title unless @search.new_record?
|
39
|
+
@search.assign_attributes(search_params.except(params_to_exclude))
|
39
40
|
@search.query_params = query_params
|
40
41
|
|
41
42
|
if @search.save
|
@@ -1,4 +1,4 @@
|
|
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| %>
|
1
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: f.object.id.to_s, field: f, index: f.index, enabled_method: :show_in_sidebar, label_method: :name } do |_, section| %>
|
2
2
|
<% case section when nil %>
|
3
3
|
<div class="d-flex flex-grow-1">
|
4
4
|
<%= f.check_box :show_in_sidebar, hide_label: true, inline: true %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% page = f.object %>
|
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| %>
|
2
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: page.id.to_s, index: f.index, field: f, label: page.title, label_method: :title, enabled_method: :published } do |_, section| %>
|
3
3
|
<% case section when :additional_options %>
|
4
4
|
<%= render Spotlight::EditViewLinksComponent.new(page:, delete_link: true) %>
|
5
5
|
<%- if page.feature_page? -%>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<% metadata = @field_metadata.field(key) %>
|
7
7
|
<% next unless metadata[:document_count] > 0 || config.custom_field %>
|
8
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| %>
|
9
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: key, field: facet, index: facet.index, dd3_content_classes: "facet-config-#{key.parameterize} page" , enabled_method: :show, label_method: :label, label: facet_field_label(key) } do |_, section| %>
|
10
10
|
<% case section when :additional_content %>
|
11
11
|
<div class="mt-2">
|
12
12
|
<%= facet.form_group :terms, label_col: 'col-md-2 offset-md-1', label: { text: t(:'spotlight.search_configurations.facets.sort_by.label') } do %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% group = f.object %>
|
2
|
-
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: group.id.to_s, field: f, dd3_content_classes: "group" , enabled_method: :published, label_method: :title, label: group.title } do |_, section| %>
|
2
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: group.id.to_s, index: f.index, field: f, dd3_content_classes: "group" , enabled_method: :published, label_method: :title, label: group.title } do |_, section| %>
|
3
3
|
<% case section when nil %>
|
4
4
|
<div class="d-flex flex-grow-1">
|
5
5
|
<div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% search = f.object %>
|
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| %>
|
2
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: search.id.to_s, field: f, index: f.index, dd3_content_classes: "search" , enabled_method: :published, label_method: :title, label: search.title } do |_, section| %>
|
3
3
|
<% case section when nil %>
|
4
4
|
<div class="d-flex flex-grow-1">
|
5
5
|
<div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% tag = f.object %>
|
2
2
|
|
3
|
-
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: tag.id.to_s, field: f, dd3_content_classes: "tag" , enabled_method: :present?, label_method: :name, label: tag.name } do |_, section| %>
|
3
|
+
<%= render layout: 'spotlight/shared/dd3_item', locals: { id: tag.id.to_s, field: f, index: f.index, dd3_content_classes: "tag" , enabled_method: :present?, label_method: :name, label: tag.name } do |_, section| %>
|
4
4
|
<% case section when nil %>
|
5
5
|
<div class="d-flex flex-grow-1">
|
6
6
|
<div class="flex-grow-1 mx-2 main">
|
data/lib/spotlight/version.rb
CHANGED
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.
|
4
|
+
version: 5.0.1
|
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-
|
14
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activejob-status
|
@@ -865,6 +865,8 @@ 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
|
868
870
|
- app/components/spotlight/breadcrumbs_component.html.erb
|
869
871
|
- app/components/spotlight/breadcrumbs_component.rb
|
870
872
|
- app/components/spotlight/bulk_action_component.html.erb
|
@@ -1546,7 +1548,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1546
1548
|
- !ruby/object:Gem::Version
|
1547
1549
|
version: '0'
|
1548
1550
|
requirements: []
|
1549
|
-
rubygems_version: 3.5.
|
1551
|
+
rubygems_version: 3.5.11
|
1550
1552
|
signing_key:
|
1551
1553
|
specification_version: 4
|
1552
1554
|
summary: Enable librarians, curators, and others who are responsible for digital collections
|