Skip to content

Commit

Permalink
Fix issues with duplicate item ids between the collection sidebar and…
Browse files Browse the repository at this point in the history
… the collection contents display.
  • Loading branch information
lfarrell committed Dec 5, 2023
1 parent 7c1cc18 commit 33a952a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_tag :li,
id: @document.id,
id: "#{@document.id}-hierarchy-item",
data: {
'document-id': @document.id.to_s.parameterize,
'document-counter': @counter,
Expand Down
2 changes: 1 addition & 1 deletion app/components/arclight/document_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<% elsif document.children? %>
<div id="contents">
<h2 class="al-show-sub-heading"><%= t 'arclight.views.show.contents' %></h2>
<%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, per_page: 50) %>
<%= 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) %>
</div>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<% end %>
<% elsif paginate? %>
<%# render the first N documents, and let the user expand the remaining if desired %>
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap) %>
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap, key: '-sidebar') %>
<%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>
<ul>
<li>
Expand All @@ -28,5 +28,5 @@
<% end %>
<% else %>
<%# there aren't enough to bother paginating, so load them all at once %>
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path %>
<%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(key: '-sidebar') %>
<% end %>

0 comments on commit 33a952a

Please sign in to comment.