-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor sidebar component and combine secondary portions
This refactors the sidebar component to make it easier to determine what is being rendered in each of the two sections and to render it without accidentally duplicating the divider elements. It also ensures that items that should be grouped together in the second section are displayed in a single box, as noted in #1437. Fixes #1437
- Loading branch information
1 parent
42e61f7
commit 5fb83a5
Showing
3 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<div class="mt-3 bg-fog-light component-container rounded"> | ||
<h2 class="h4">Also available at</h2> | ||
<ul class="list-unstyled"> | ||
<% also_available_links.each do |label, url| %> | ||
<li><%= link_to label, url %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<h2 class="h4">Also available at</h2> | ||
<ul class="list-unstyled"> | ||
<% also_available_links.each do |label, url| %> | ||
<li><%= link_to label, url %></li> | ||
<% end %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
<% filtered_components = components.map{|component | render component }.uniq.compact_blank %> | ||
<% tools = render_show_tools %> | ||
<% if filtered_components.any? || tools.present? %> | ||
<% filtered_components = filter_components(components) %> | ||
<% if filtered_components.any? %> | ||
<div class="bg-fog-light component-container rounded"> | ||
<%= filtered_components.join('<hr style="border-top: dotted 1px;" />').html_safe if filtered_components.any? %> | ||
<% if filtered_components.any? && tools.present? %> | ||
<hr style="border-top: dotted 1px;" /> | ||
<% end %> | ||
<%= tools %> | ||
<%= safe_join filtered_components, separator %> | ||
</div> | ||
<% end %> | ||
|
||
<%= render AlsoAvailableComponent.new(document:) %> | ||
|
||
<div class="mt-4"> | ||
<%= render Blacklight::Document::MoreLikeThisComponent.new(document:) %> | ||
</div> | ||
<% filtered_components = filter_components(secondary_components) %> | ||
<% if filtered_components.any? %> | ||
<div class="bg-fog-light component-container rounded mt-4"> | ||
<%= safe_join filtered_components, separator %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters