arclight 1.0.0 → 1.6.2
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/.github/workflows/ruby.yml +22 -15
- data/.gitignore +1 -0
- data/.rubocop.yml +185 -26
- data/.solr_wrapper +2 -1
- data/README.md +4 -8
- data/app/assets/stylesheets/arclight/application.scss +1 -0
- data/app/assets/stylesheets/arclight/build.scss +4 -0
- data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +22 -18
- data/app/assets/stylesheets/arclight/modules/icons.scss +9 -4
- data/app/assets/stylesheets/arclight/modules/layout.scss +23 -14
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +14 -45
- data/app/assets/stylesheets/arclight/modules/search_form.scss +9 -0
- data/app/assets/stylesheets/arclight/modules/search_results.scss +15 -16
- data/app/assets/stylesheets/arclight/modules/truncator.scss +2 -0
- data/app/components/arclight/access_component.rb +1 -1
- data/app/components/arclight/bookmark_component.html.erb +1 -1
- data/app/components/arclight/breadcrumb_component.rb +17 -7
- data/app/components/arclight/breadcrumbs_hierarchy_component.html.erb +2 -2
- data/app/components/arclight/breadcrumbs_hierarchy_component.rb +1 -1
- data/app/components/arclight/collection_context_component.rb +1 -1
- data/app/components/arclight/collection_info_component.rb +1 -1
- data/app/components/arclight/collection_sidebar_component.rb +2 -4
- data/app/components/arclight/document_collection_hierarchy_component.html.erb +8 -4
- data/app/components/arclight/document_component.html.erb +1 -1
- data/app/components/arclight/document_components_hierarchy_component.html.erb +5 -17
- data/app/components/arclight/document_components_hierarchy_component.rb +7 -1
- data/app/components/arclight/document_download_component.rb +1 -1
- data/app/components/arclight/embed_component.rb +2 -2
- data/app/components/arclight/expand_hierarchy_button_component.html.erb +5 -0
- data/app/components/arclight/expand_hierarchy_button_component.rb +16 -0
- data/app/components/arclight/group_component.html.erb +6 -2
- data/app/components/arclight/group_component.rb +1 -1
- data/app/components/arclight/index_metadata_field_component.html.erb +1 -2
- data/app/components/arclight/masthead_component.html.erb +8 -6
- data/app/components/arclight/metadata_section_component.rb +1 -1
- data/app/components/arclight/oembed_viewer_component.rb +1 -1
- data/app/components/arclight/online_content_filter_component.html.erb +1 -1
- data/app/components/arclight/online_content_filter_component.rb +2 -4
- data/app/components/arclight/online_status_indicator_component.rb +1 -1
- data/app/components/arclight/repository_breadcrumb_component.html.erb +1 -1
- data/app/components/arclight/repository_breadcrumb_component.rb +1 -1
- data/app/components/arclight/repository_location_component.html.erb +2 -2
- data/app/components/arclight/search_bar_component.html.erb +3 -1
- data/app/components/arclight/search_bar_component.rb +1 -1
- data/app/components/arclight/search_result_breadcrumbs_component.html.erb +6 -3
- data/app/components/arclight/search_result_title_component.html.erb +5 -3
- data/app/helpers/arclight/ead_format_helpers.rb +87 -0
- data/app/helpers/arclight_helper.rb +11 -0
- data/app/models/arclight/document_downloads.rb +1 -1
- data/app/models/arclight/parent.rb +3 -10
- data/app/models/arclight/parents.rb +6 -4
- data/app/models/concerns/arclight/solr_document.rb +14 -4
- data/app/views/catalog/_document_list.html.erb +8 -0
- data/app/views/catalog/_group.html.erb +1 -1
- data/app/views/shared/_main_menu_links.html.erb +1 -1
- data/arclight.gemspec +1 -2
- data/lib/arclight/normalized_date.rb +5 -10
- data/lib/arclight/normalized_id.rb +4 -2
- data/lib/arclight/repository.rb +1 -1
- data/lib/arclight/traject/ead2_component_config.rb +57 -14
- data/lib/arclight/traject/ead2_config.rb +57 -15
- data/lib/arclight/version.rb +1 -1
- data/lib/generators/arclight/install_generator.rb +41 -4
- data/lib/generators/arclight/templates/arclight.scss +6 -5
- data/lib/generators/arclight/templates/catalog_controller.rb +48 -5
- data/lib/generators/arclight/templates/config/locales/arclight.en.yml +8 -0
- data/lib/generators/arclight/templates/config/repositories.yml +2 -2
- data/package.json +6 -5
- data/solr/conf/schema.xml +13 -7
- data/solr/conf/solrconfig.xml +61 -44
- data/tasks/arclight.rake +9 -2
- data/template.rb +5 -5
- metadata +18 -21
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Original style comes from https://github.com/twbs/bootstrap/blob/v5.3.2/scss/_dropdown.scss#L184
|
|
2
|
+
// via https://github.com/projectblacklight/blacklight/blob/v8.1.0/app/assets/stylesheets/blacklight/_search_form.scss#L25
|
|
3
|
+
.input-group > .search-autocomplete-wrapper {
|
|
4
|
+
ul {
|
|
5
|
+
li {
|
|
6
|
+
white-space: normal;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--al-content-icon-color: #{$secondary};
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.documents-list {
|
|
2
6
|
margin-bottom: $spacer;
|
|
3
7
|
|
|
@@ -35,7 +39,7 @@
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
.al-document-abstract-or-scope {
|
|
38
|
-
margin-bottom: $spacer * .5;
|
|
42
|
+
margin-bottom: $spacer * 0.5;
|
|
39
43
|
max-width: 45em;
|
|
40
44
|
}
|
|
41
45
|
}
|
|
@@ -43,15 +47,12 @@
|
|
|
43
47
|
|
|
44
48
|
article.document {
|
|
45
49
|
.blacklight-icons svg {
|
|
46
|
-
fill:
|
|
47
|
-
}
|
|
48
|
-
.al-online-content-icon .blacklight-icons svg {
|
|
49
|
-
fill: $online-icon-color;
|
|
50
|
+
fill: var(--al-content-icon-color);
|
|
50
51
|
}
|
|
51
52
|
div.breadcrumb-links,
|
|
52
53
|
dd.al-document-abstract-or-scope,
|
|
53
54
|
dd.al-document-creator {
|
|
54
|
-
margin-top: ($spacer * .5);
|
|
55
|
+
margin-top: ($spacer * 0.5);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
form.bookmark-toggle.col-auto {
|
|
@@ -66,12 +67,12 @@ article.document {
|
|
|
66
67
|
|
|
67
68
|
.al-document-abstract-or-scope {
|
|
68
69
|
margin-bottom: 0;
|
|
69
|
-
margin-top: $spacer * .75;
|
|
70
|
+
margin-top: $spacer * 0.75;
|
|
70
71
|
max-width: 45em;
|
|
71
72
|
}
|
|
72
73
|
.al-grouped-repository {
|
|
73
74
|
font-size: $font-size-sm;
|
|
74
|
-
margin-bottom: $spacer * .75;
|
|
75
|
+
margin-bottom: $spacer * 0.75;
|
|
75
76
|
}
|
|
76
77
|
.al-grouped-title-bar {
|
|
77
78
|
background-color: $gray-200;
|
|
@@ -91,7 +92,7 @@ article.document {
|
|
|
91
92
|
.al-grouped-more {
|
|
92
93
|
border-bottom: $default-border-styling;
|
|
93
94
|
margin-bottom: $spacer;
|
|
94
|
-
padding: ($spacer * .5) 0;
|
|
95
|
+
padding: ($spacer * 0.5) 0;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
.document {
|
|
@@ -121,7 +122,6 @@ article.document {
|
|
|
121
122
|
margin-bottom: ($spacer * 3) !important;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
|
|
125
125
|
// Compact Search Results
|
|
126
126
|
.documents-compact {
|
|
127
127
|
margin-bottom: $spacer;
|
|
@@ -147,7 +147,7 @@ article.document {
|
|
|
147
147
|
|
|
148
148
|
.index-document-functions {
|
|
149
149
|
display: flex;
|
|
150
|
-
|
|
150
|
+
justify-content: flex-end !important;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.al-document-container.text-muted {
|
|
@@ -176,13 +176,14 @@ article.document {
|
|
|
176
176
|
|
|
177
177
|
.breadcrumb-links .col {
|
|
178
178
|
flex-basis: auto;
|
|
179
|
-
|
|
179
|
+
}
|
|
180
180
|
|
|
181
181
|
.btn-outline-secondary svg {
|
|
182
182
|
fill: $gray-600;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.btn-outline-secondary:not(:disabled):not(.disabled).active svg,
|
|
185
|
+
.btn-outline-secondary:not(:disabled):not(.disabled).active svg,
|
|
186
|
+
.btn-outline-secondary:hover svg {
|
|
186
187
|
fill: $white;
|
|
187
188
|
}
|
|
188
189
|
|
|
@@ -197,11 +198,10 @@ article.document {
|
|
|
197
198
|
justify-content: flex-end;
|
|
198
199
|
}
|
|
199
200
|
|
|
200
|
-
|
|
201
201
|
.result-type-group {
|
|
202
202
|
order: -1;
|
|
203
203
|
flex-grow: 1;
|
|
204
|
-
&.btn-group
|
|
204
|
+
&.btn-group > .btn {
|
|
205
205
|
flex-grow: 0;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -246,6 +246,5 @@ article.document {
|
|
|
246
246
|
.bookmark-toggle {
|
|
247
247
|
display: none;
|
|
248
248
|
}
|
|
249
|
-
|
|
250
249
|
}
|
|
251
250
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}) do %>
|
|
12
12
|
<div class="checkbox toggle-bookmark">
|
|
13
13
|
<label class="toggle-bookmark" data-checkboxsubmit-target="label">
|
|
14
|
-
<input type="checkbox" class="toggle-bookmark" data-checkboxsubmit-target="checkbox"
|
|
14
|
+
<input type="checkbox" class="toggle-bookmark" data-checkboxsubmit-target="checkbox" <%= 'checked="checked"' if bookmarked? %>>
|
|
15
15
|
<span data-checkboxsubmit-target="span"><%= bookmarked? ? "#{blacklight_icon(:bookmark).html_safe}<span class=\"sr-only visually-hidden\">#{t('blacklight.search.bookmarks.present')}</span>".html_safe : "#{blacklight_icon(:bookmark).html_safe}<span class=\"sr-only visually-hidden\">#{t('blacklight.search.bookmarks.absent')}</span>".html_safe %></span>
|
|
16
16
|
</label>
|
|
17
17
|
</div>
|
|
@@ -8,16 +8,12 @@ module Arclight
|
|
|
8
8
|
@document = document
|
|
9
9
|
@count = count
|
|
10
10
|
@offset = offset
|
|
11
|
-
super
|
|
11
|
+
super()
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def call
|
|
15
|
-
|
|
15
|
+
return unless breadcrumb_links.any?
|
|
16
16
|
|
|
17
|
-
if @count && breadcrumb_links.length > @count
|
|
18
|
-
breadcrumb_links = breadcrumb_links.first(@count)
|
|
19
|
-
breadcrumb_links << tag.li('…'.html_safe, class: 'breadcrumb-item')
|
|
20
|
-
end
|
|
21
17
|
tag.ol class: 'breadcrumb' do
|
|
22
18
|
safe_join(breadcrumb_links)
|
|
23
19
|
end
|
|
@@ -29,12 +25,26 @@ module Arclight
|
|
|
29
25
|
yield build_repository_link
|
|
30
26
|
|
|
31
27
|
@document.parents.each do |parent|
|
|
32
|
-
yield tag.li(class: 'breadcrumb-item') { link_to(parent.label, solr_document_path(parent.
|
|
28
|
+
yield tag.li(class: 'breadcrumb-item') { link_to(parent.label, solr_document_path(parent.id)) }
|
|
33
29
|
end
|
|
34
30
|
end
|
|
35
31
|
|
|
36
32
|
def build_repository_link
|
|
37
33
|
render Arclight::RepositoryBreadcrumbComponent.new(document: @document)
|
|
38
34
|
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def breadcrumb_links
|
|
39
|
+
@breadcrumb_links ||= limit_breadcrumb_links(components.drop(@offset))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def limit_breadcrumb_links(links)
|
|
43
|
+
return links unless @count && links.length > @count
|
|
44
|
+
|
|
45
|
+
limited_links = links.first(@count)
|
|
46
|
+
limited_links << tag.li('…'.html_safe, class: 'breadcrumb-item')
|
|
47
|
+
limited_links
|
|
48
|
+
end
|
|
39
49
|
end
|
|
40
50
|
end
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
<% if collection %>
|
|
10
10
|
<li class="breadcrumb-item breadcrumb-item-2">
|
|
11
11
|
<span aria-hidden="true"><%= blacklight_icon :collection, classes: 'al-collection-content-icon' %></span>
|
|
12
|
-
<span class="breadcrumb-text"><%= link_to collection.label, solr_document_path(collection.
|
|
12
|
+
<span class="breadcrumb-text"><%= link_to collection.label, solr_document_path(collection.id) %></span>
|
|
13
13
|
|
|
14
14
|
<ol class="breadcrumb">
|
|
15
15
|
<% parents_under_collection.each do |parent| %>
|
|
16
16
|
<li class="breadcrumb-item breadcrumb-item-3">
|
|
17
|
-
<span class="breadcrumb-text"><%= link_to parent.label, solr_document_path(parent.
|
|
17
|
+
<span class="breadcrumb-text"><%= link_to parent.label, solr_document_path(parent.id) %></span>
|
|
18
18
|
</li>
|
|
19
19
|
<% end %>
|
|
20
20
|
|
|
@@ -4,7 +4,7 @@ module Arclight
|
|
|
4
4
|
# Render various actions for a collection (e.g. requesting, download links, etc)
|
|
5
5
|
class CollectionContextComponent < ViewComponent::Base
|
|
6
6
|
def initialize(presenter:, download_component:)
|
|
7
|
-
super
|
|
7
|
+
super()
|
|
8
8
|
|
|
9
9
|
@collection = presenter.document.collection
|
|
10
10
|
@download_component = download_component
|
|
@@ -4,7 +4,7 @@ module Arclight
|
|
|
4
4
|
# Draw the links to the collection info in the sidebar
|
|
5
5
|
class CollectionSidebarComponent < ViewComponent::Base
|
|
6
6
|
def initialize(document:, partials:, collection_presenter:)
|
|
7
|
-
super
|
|
7
|
+
super()
|
|
8
8
|
|
|
9
9
|
@document = document
|
|
10
10
|
@partials = Array(partials)
|
|
@@ -29,13 +29,11 @@ module Arclight
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def document_path
|
|
32
|
-
@document_path ||= solr_document_path(
|
|
32
|
+
@document_path ||= solr_document_path(document.root)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def section_anchor(section)
|
|
36
36
|
"##{t("arclight.views.show.sections.#{section}").parameterize}"
|
|
37
37
|
end
|
|
38
|
-
|
|
39
|
-
delegate :normalized_eadid, to: :document
|
|
40
38
|
end
|
|
41
39
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%= content_tag :li,
|
|
2
|
-
id: @document.id,
|
|
2
|
+
id: "#{@document.id}-hierarchy-item",
|
|
3
3
|
data: {
|
|
4
4
|
'document-id': @document.id.to_s.parameterize,
|
|
5
5
|
'document-counter': @counter,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div class="documentHeader" data-document-id="<%= document.id %>">
|
|
11
11
|
<% if document.children? %>
|
|
12
12
|
<%= link_to('',
|
|
13
|
-
"
|
|
13
|
+
"#collapsible-hierarchy-#{document.id}",
|
|
14
14
|
class: "al-toggle-view-children#{ ' collapsed' unless show_expanded?}",
|
|
15
15
|
aria: {
|
|
16
16
|
label: t('arclight.hierarchy.view_all'),
|
|
@@ -24,7 +24,11 @@
|
|
|
24
24
|
%>
|
|
25
25
|
<% end %>
|
|
26
26
|
<div class="index_title document-title-heading" data-turbo="false">
|
|
27
|
-
|
|
27
|
+
<% if current_target? %>
|
|
28
|
+
<%= document.normalized_title %>
|
|
29
|
+
<% else %>
|
|
30
|
+
<%= helpers.link_to_document document, counter: @counter %>
|
|
31
|
+
<% end %>
|
|
28
32
|
<% if document.children? %>
|
|
29
33
|
<span class="badge badge-pill bg-secondary badge-secondary al-number-of-children-badge"><%= document.number_of_children %><span class="sr-only visually-hidden"><%= t(:'arclight.views.index.number_of_components', count: document.number_of_children) %></span></span>
|
|
30
34
|
<% end %>
|
|
@@ -37,7 +41,7 @@
|
|
|
37
41
|
|
|
38
42
|
<%= render Arclight::IndexMetadataFieldComponent.with_collection(@presenter&.field_presenters.select { |field| field.field_config.collection_context }, classes: ['col pl-0 my-0']) %>
|
|
39
43
|
<% if document.number_of_children > 0 %>
|
|
40
|
-
<%= content_tag(:div, id: "
|
|
44
|
+
<%= content_tag(:div, id: "collapsible-hierarchy-#{document.id}",
|
|
41
45
|
class: "collapse al-collection-context-collapsible al-hierarchy-level-#{document.component_level} #{'show' if show_expanded?}"
|
|
42
46
|
) do %>
|
|
43
47
|
<%= render Arclight::DocumentComponentsHierarchyComponent.new(document: @document, target_index: target_index) %>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<% elsif document.children? %>
|
|
33
33
|
<div id="contents">
|
|
34
34
|
<h2 class="al-show-sub-heading"><%= t 'arclight.views.show.contents' %></h2>
|
|
35
|
-
<%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, per_page: 50) %>
|
|
35
|
+
<%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}-document", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, key: '-document', per_page: 50) %>
|
|
36
36
|
</div>
|
|
37
37
|
<% end %>
|
|
38
38
|
|
|
@@ -2,31 +2,19 @@
|
|
|
2
2
|
<%# render the hierarchy as: outer (left) window ... window ... because our current document hierarchy is so far down the list it'd be buried %>
|
|
3
3
|
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-left", loading: 'lazy', src: hierarchy_path(limit: @left_outer_window, key: '-left') %>
|
|
4
4
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-gap" do %>
|
|
5
|
-
|
|
6
|
-
<li>
|
|
7
|
-
<%= link_to t('arclight.views.show.expand'), hierarchy_path(offset: @left_outer_window, limit: @target_index - @left_outer_window - (@window / 2), key: '-gap'), class: 'btn btn-secondary btn-sm' %>
|
|
8
|
-
</li>
|
|
9
|
-
</ul>
|
|
5
|
+
<%= render expand_hierarchy_component.new(path: hierarchy_path(offset: @left_outer_window, limit: @target_index - @left_outer_window - (@window / 2), key: '-gap')) %>
|
|
10
6
|
<% end %>
|
|
11
7
|
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-window", src: hierarchy_path(offset: @target_index - (@window / 2), limit: @window, key: '-window') %>
|
|
12
8
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>
|
|
13
|
-
|
|
14
|
-
<li>
|
|
15
|
-
<%= link_to t('arclight.views.show.expand'), hierarchy_path(offset: @target_index + (@window / 2), key: '-right'), class: 'btn btn-secondary btn-sm' %>
|
|
16
|
-
</li>
|
|
17
|
-
</ul>
|
|
9
|
+
<%= render expand_hierarchy_component.new(path: hierarchy_path(offset: @target_index + (@window / 2), key: '-right')) %>
|
|
18
10
|
<% end %>
|
|
19
11
|
<% elsif paginate? %>
|
|
20
12
|
<%# render the first N documents, and let the user expand the remaining if desired %>
|
|
21
|
-
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap) %>
|
|
13
|
+
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap, key: '-sidebar') %>
|
|
22
14
|
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>
|
|
23
|
-
|
|
24
|
-
<li>
|
|
25
|
-
<%= link_to t('arclight.views.show.expand'), hierarchy_path(offset: @maximum_left_gap, key: '-right'), class: 'btn btn-secondary btn-sm' %>
|
|
26
|
-
</li>
|
|
27
|
-
</ul>
|
|
15
|
+
<%= render expand_hierarchy_component.new(path: hierarchy_path(offset: @maximum_left_gap, key: '-right')) %>
|
|
28
16
|
<% end %>
|
|
29
17
|
<% else %>
|
|
30
18
|
<%# there aren't enough to bother paginating, so load them all at once %>
|
|
31
|
-
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path %>
|
|
19
|
+
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(key: '-sidebar') %>
|
|
32
20
|
<% end %>
|
|
@@ -6,7 +6,7 @@ module Arclight
|
|
|
6
6
|
class DocumentComponentsHierarchyComponent < ViewComponent::Base
|
|
7
7
|
# rubocop:disable Metrics/ParameterLists
|
|
8
8
|
def initialize(document: nil, target_index: -1, minimum_pagination_size: 20, left_outer_window: 3, maximum_left_gap: 10, window: 10)
|
|
9
|
-
super
|
|
9
|
+
super()
|
|
10
10
|
|
|
11
11
|
@document = document
|
|
12
12
|
@target_index = target_index&.to_i || -1
|
|
@@ -24,5 +24,11 @@ module Arclight
|
|
|
24
24
|
def hierarchy_path(**kwargs)
|
|
25
25
|
helpers.hierarchy_solr_document_path(id: @document.id, hierarchy: true, nest_path: params[:nest_path], **kwargs)
|
|
26
26
|
end
|
|
27
|
+
|
|
28
|
+
def expand_hierarchy_component
|
|
29
|
+
blacklight_config.show.expand_hierarchy_component || Arclight::ExpandHierarchyButtonComponent
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
delegate :blacklight_config, to: :helpers
|
|
27
33
|
end
|
|
28
34
|
end
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Arclight
|
|
4
4
|
# Render digital object links for a document
|
|
5
5
|
class EmbedComponent < ViewComponent::Base
|
|
6
|
-
def initialize(document:, presenter:, **kwargs)
|
|
7
|
-
super
|
|
6
|
+
def initialize(document:, presenter:, **kwargs) # rubocop:disable Lint/UnusedMethodArgument
|
|
7
|
+
super()
|
|
8
8
|
|
|
9
9
|
@document = document
|
|
10
10
|
@presenter = presenter
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Arclight
|
|
4
|
+
# Component for rendering an expand button in the hierarchy view
|
|
5
|
+
class ExpandHierarchyButtonComponent < Blacklight::Component
|
|
6
|
+
def initialize(path:, classes: 'btn btn-secondary btn-sm')
|
|
7
|
+
super()
|
|
8
|
+
@path = path
|
|
9
|
+
@classes = classes
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def expand_link
|
|
13
|
+
link_to t('arclight.views.show.expand'), @path, class: @classes
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
<% end %>
|
|
9
9
|
<h3><%= helpers.link_to_document document %></h3>
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
<% document.extent.each do |extent| %>
|
|
11
|
+
<%= tag.span extent, class: 'al-document-extent badge' unless compact? %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<dl>
|
|
14
|
+
<%= render Arclight::IndexMetadataFieldComponent.with_collection(presenter.field_presenters.select { |field| !compact? || field.field_config.compact }) %>
|
|
15
|
+
</dl>
|
|
12
16
|
</div>
|
|
13
17
|
</div>
|
|
14
18
|
</div>
|
|
@@ -17,7 +17,7 @@ module Arclight
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def search_within_collection_url
|
|
20
|
-
search_catalog_path(helpers.search_without_group.
|
|
20
|
+
search_catalog_path(helpers.search_without_group.deep_merge(f: { collection: [document.collection_name] }))
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
<%= tag.dd(class: @classes + ['truncator'], data: { controller: 'arclight-truncate' }) do %>
|
|
5
5
|
<%= tag.div @field.render, class: 'content', data: { arclight_truncate_target: 'content' } %>
|
|
6
6
|
<%= button_tag(type: :button, class: 'btn btn-sm btn-link px-0',
|
|
7
|
-
data: { action: 'click->arclight-truncate#trigger' }
|
|
8
|
-
aria: { hidden: true }) do %>
|
|
7
|
+
data: { action: 'click->arclight-truncate#trigger' }) do %>
|
|
9
8
|
<%= tag.span t('arclight.truncation.view_more'), class: 'view-more' %>
|
|
10
9
|
<%= tag.span t('arclight.truncation.view_less'), class: 'view-less' %>
|
|
11
10
|
<%= tag.span(class: 'icon') %>
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
<div class="container">
|
|
3
3
|
<div class="row align-items-center">
|
|
4
4
|
<div class="col-md-8" >
|
|
5
|
-
<
|
|
5
|
+
<div class="h1 my-4 text-center text-md-start"><%= heading %></div>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
<div class="col-md-4">
|
|
9
|
+
<nav class="navbar navbar-expand d-flex justify-content-md-end justify-content-center" aria-label="browse">
|
|
10
|
+
<ul class="navbar-nav">
|
|
11
|
+
<%= render 'shared/main_menu_links' %>
|
|
12
|
+
</ul>
|
|
13
|
+
</nav>
|
|
14
|
+
</div>
|
|
13
15
|
</div>
|
|
14
16
|
</div>
|
|
15
17
|
</div>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<%= t('arclight.views.show.online_content.title') %>
|
|
8
8
|
</h2>
|
|
9
9
|
</div>
|
|
10
|
-
<div class="
|
|
10
|
+
<div class="ms-3 ms-xl-5">
|
|
11
11
|
<div><%= t('arclight.views.show.online_content.description') %></div>
|
|
12
12
|
<%= link_to t('arclight.views.show.online_content.link_text'), helpers.search_action_path(f: { collection: [collection_name], access: ['online'] }) %>
|
|
13
13
|
</div>
|
|
@@ -5,15 +5,13 @@ module Arclight
|
|
|
5
5
|
class OnlineContentFilterComponent < Blacklight::Component
|
|
6
6
|
def initialize(document:)
|
|
7
7
|
@document = document
|
|
8
|
-
super
|
|
8
|
+
super()
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def render?
|
|
12
12
|
@document.collection? && @document.online_content?
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
@document.collection_name
|
|
17
|
-
end
|
|
15
|
+
delegate :collection_name, to: :@document
|
|
18
16
|
end
|
|
19
17
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%= render(@layout.new(field: @field)) do |component| %>
|
|
2
|
-
<% component.
|
|
2
|
+
<% component.with_label do %>
|
|
3
3
|
<%= label %>
|
|
4
4
|
<% end %>
|
|
5
|
-
<% component.
|
|
5
|
+
<% component.with_value do %>
|
|
6
6
|
<div class='al-in-person-repository-name'>
|
|
7
7
|
<% if repository.thumbnail_url %>
|
|
8
8
|
<%= image_tag repository.thumbnail_url, alt: '', class: 'img-fluid float-left' %>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<%= render(Blacklight::SearchBarComponent.new(
|
|
2
2
|
**@kwargs,
|
|
3
|
-
params: @params.merge(f: (@params[:f] || {}).except(:collection))
|
|
3
|
+
params: @params.merge(f: (@params[:f] || {}).except(:collection)),
|
|
4
|
+
q: @q,
|
|
5
|
+
search_field: @search_field)) do |c| %>
|
|
4
6
|
|
|
5
7
|
<% c.with_before_input_group do %>
|
|
6
8
|
<div class="input-group within-collection-dropdown">
|
|
@@ -25,7 +25,7 @@ module Arclight
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def collection_name
|
|
28
|
-
@collection_name ||= Array(@params.dig(:f, :collection)).first ||
|
|
28
|
+
@collection_name ||= Array(@params.dig(:f, :collection)).reject(&:empty?).first ||
|
|
29
29
|
helpers.current_context_document&.collection_name
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<header class="documentHeader row" data-document-id="<%= @document.id %>">
|
|
2
2
|
<h3 class="index_title document-title-heading col">
|
|
3
3
|
<%= helpers.link_to_document @document, counter: @counter %>
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
<% @document.extent.each do |extent| %>
|
|
5
|
+
<%= tag.span extent, class: 'al-document-extent badge' unless compact? %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<%= tag.span class: 'al-document-container text-muted' do %>
|
|
6
8
|
<%= @document.containers.join(', ') %>
|
|
7
9
|
<% end if @document.containers.present? %>
|
|
8
10
|
</h3>
|
|
@@ -10,4 +12,4 @@
|
|
|
10
12
|
<% actions.each do |action| %>
|
|
11
13
|
<%= action %>
|
|
12
14
|
<% end %>
|
|
13
|
-
</header>
|
|
15
|
+
</header>
|