Skip to content

Commit

Permalink
🐛 Fix Add Child link
Browse files Browse the repository at this point in the history
The links under the Add Child dropdown was not working because the HTML
structure was not correct.  This commit will close the button tag and
then open the ul tag which allows the links to be clickable.

Ref:
  - notch8/palni_palci_knapsack#78
  • Loading branch information
Kirk Wang committed Jun 21, 2024
1 parent 7fff868 commit cfdc1ec
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/views/hyrax/base/_show_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle" type="button" id="dropdown-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<%= t('.attach_child') %>
<ul class="dropdown-menu">
<% presenter.valid_child_concerns.each do |concern| %>
<li class="dropdown-item">
<%= link_to "Attach #{concern.human_readable_type}", polymorphic_path([main_app, :new, :hyrax, :parent, concern.model_name.singular.to_sym], parent_id: presenter.id) %>
</li>
<% end %>
</ul>
</button>
<ul class="dropdown-menu">
<% presenter.valid_child_concerns.each do |concern| %>
<li class="dropdown-item">
<%= link_to "Attach #{concern.human_readable_type}", polymorphic_path([main_app, :new, :hyrax, :parent, concern.model_name.singular.to_sym], parent_id: presenter.id) %>
</li>
<% end %>
</ul>
</div>
<% end %>
<%# OVERRIDE to validate delete permission %>
Expand Down

0 comments on commit cfdc1ec

Please sign in to comment.