Skip to content

Commit

Permalink
fix linking the correct amendmentd
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed May 17, 2024
1 parent 1d1c81a commit f5c56bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/decidim/decidim_awesome/amendments/_modal.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<%= t("decidim.decidim_awesome.amendments.modal.explanation_html",
proposal_link: present(@proposal).proposal_path + "#comments") %>

<% if current_component.current_settings&.amendments_visibility == "all" %>
<% emendations = @proposal.emendations.not_hidden.where(decidim_amendments: { state: Decidim::Amendment.states["evaluating"] }) %>
<% if current_component.current_settings&.amendments_visibility == "all" && emendations %>
<%= t("decidim.decidim_awesome.amendments.modal.current_amendment_html",
amendment_link: present(@proposal.amendment.emendation).proposal_path) %>
amendment_link: present(emendations&.first).proposal_path) %>
<% end %>
</div>
</div>
Expand Down

0 comments on commit f5c56bd

Please sign in to comment.