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

add extension behavior for FileSet show view partials #6076

Merged
merged 2 commits into from
Jun 15, 2023
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
6 changes: 6 additions & 0 deletions app/presenters/hyrax/file_set_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ def user_can_perform_any_action?
current_ability.can?(:edit, id) || current_ability.can?(:destroy, id) || current_ability.can?(:download, id)
end

##
# @return [Array<String>]
def show_partials
['show_details']
end

private

def link_presenter_class
Expand Down
8 changes: 5 additions & 3 deletions app/views/hyrax/file_sets/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
<%= render 'file_set_title', presenter: @presenter %>
</header>

<%# TODO: render 'show_descriptions' See https://github.com/samvera/hyrax/issues/1481 %>
<%= render 'show_details' %>
<% @presenter.show_partials.each do |partial_path| %>
<%= render partial_path %>
<% end %>
Comment on lines +14 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<% @presenter.show_partials.each do |partial_path| %>
<%= render partial_path %>
<% end %>
<% @presenter.show_partials.each do |partial_path| %>
<%= render partial_path %>
<% end %>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alishaevn i don't think we want to nest indentation here? that will result in the partial HTML content being indented a level too far (since the #each block won't appear in the rendered HTML).


<%= render 'hyrax/users/activity_log', events: @presenter.events %>
</div><!-- /columns second -->
</div> <!-- /.row -->
Expand All @@ -22,4 +24,4 @@
<span class='hide analytics-event' data-category="file-set-in-collection" data-action="file-set-in-collection-view" data-name="<%= collection_id %>" >
<% end %>
<span class='hide analytics-event' data-category="file-set-in-work" data-action="file-set-in-work-view" data-name="<%= @presenter.parent.id %>" >
<span class='hide analytics-event' data-category="file-set" data-action="file-set-view" data-name="<%= @presenter.id %>" >
<span class='hide analytics-event' data-category="file-set" data-action="file-set-view" data-name="<%= @presenter.id %>" >