-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add javascript to limit display of parents to first 3
Uses show more and show less buttons to give users access to the full list of parents with the default to show less.
- Loading branch information
Showing
14 changed files
with
346 additions
and
77 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
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
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
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
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
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
21 changes: 19 additions & 2 deletions
21
app/views/hyrax/collections/_show_parent_collections.html.erb
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
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
43 changes: 30 additions & 13 deletions
43
app/views/hyrax/dashboard/collections/_show_parent_collections.html.erb
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,15 +1,32 @@ | ||
<% if @parent_collections.nil? || @parent_collections.empty? %> | ||
<div class="alert alert-warning" role="alert"><%= t('hyrax.collections.show.no_visible_parent_collections') %></div> | ||
<% if presenter.parent_collection_count <= 0 %> | ||
<div class="alert alert-warning" role="alert"><%= t('hyrax.collections.show.no_visible_parent_collections') %></div> | ||
<% else %> | ||
<div class="media-body"> | ||
<h4 class="media-heading"> | ||
<% @parent_collections.each do |document| %> | ||
<ul> | ||
<li> | ||
<%= link_to document, [hyrax, :dashboard, document], id: "src_copy_link_#{document.id}" %> | ||
</li> | ||
</ul> | ||
<% end %> | ||
</h4> | ||
</div> | ||
<div class="media-body"> | ||
<h4 class="media-heading"> | ||
<div class="less-parent-collections-block" id="less-parent-collections"> | ||
<% presenter.visible_parent_collections.each do |document| %> | ||
<ul> | ||
<li> | ||
<%= link_to document, [hyrax, :dashboard, document], id: "src_copy_link_#{document.id}" %> | ||
</li> | ||
</ul> | ||
<% end %> | ||
<% if presenter.more_parent_collections? %> | ||
<button id="show-more-parent-collections" class="btn show-more-parent-collections-btn"><%= t("hyrax.collections.show.show_more_parent_collections") %></button> | ||
<% end %> | ||
</div> | ||
<% if presenter.more_parent_collections? %> | ||
<div class="more-parent-collections-block" id="more-parent-collections"> | ||
<% presenter.more_parent_collections.each do |document| %> | ||
<ul> | ||
<li> | ||
<%= link_to document, [hyrax, :dashboard, document], id: "src_copy_link_#{document.id}" %> | ||
</li> | ||
</ul> | ||
<button id="show-less-parent-collections" class="btn show-less-parent-collections-btn"><%= t("hyrax.collections.show.show_less_parent_collections") %></button> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</h4> | ||
</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
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
Oops, something went wrong.