Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix modal functionality for collection public show #1819

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app/views/hyrax/collections/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
<% unless @presenter.total_viewable_items.blank? %>
<div class="hyc-bugs">
<div class="hyc-item-count">
<b><%= @presenter.total_viewable_items %></b>
<%= pluralize(@presenter.total_viewable_items, t('.item_count')) %></div>

<% unless @presenter.creator.blank? %>
<div class="hyc-created-by">Created by: <%= @presenter.creator.first %></div>
<% end %>
Expand All @@ -51,7 +49,17 @@
</div>
<%# OVERRIDE here to add admin actions buttons to show page %>
<div class='show-actions-container'>
<%= render "hyrax/dashboard/collections/show_actions", presenter: @presenter %>
<% id = @presenter.id %>
<section class="collection-title-row-wrapper"
data-source="show"
data-id="<%= id %>"
data-colls-hash="<%= available_parent_collections_data(collection: @presenter) %>"
data-post-url="<%= hyrax.dashboard_create_nest_collection_within_path(id) %>"
data-post-delete-url="<%= hyrax.dashboard_collection_path(id) %>">
<div class="collection-title-row-content">
<%= render 'hyrax/dashboard/collections/show_actions', presenter: @presenter %>
</div>
</section>
</div>
<%# end OVERRIDE %>
<div class="row hyc-body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class: 'btn btn-primary' %>
<% end %>
<% if presenter.collection_type_is_nestable? && presenter.user_can_nest_collection? %>
<%= render 'hyrax/my/collections/modal_add_to_collection', source: 'show' %>
<!-- The user should have deposit access to the parent and read access to the child (the collection we are already showing, so no test is necessary). -->
<%= button_tag '',
class: 'btn btn-primary add-to-collection',
Expand Down