Skip to content

Commit

Permalink
Add the answer to the project page
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed Feb 8, 2024
1 parent 69be09f commit 5d347cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/views/decidim/budgets/projects/_project_answer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<%
linked_plans = project.linked_resources(:plans, "included_plans")
answers = linked_plans.map { |plan| translated_attribute(plan.answer) }.select { |answer| strip_tags(answer).strip.present? }
%>

<% if answers.any? %>
<div class="banner bg-silver-medium-light">
<div class="banner__content">
<h2 class="h3">Ehdotuksen vastaus</h2>

<% answers.each do |answer| %>
<%== answer %>
<% end %>
</div>
</div>
<% end %>
2 changes: 2 additions & 0 deletions app/views/decidim/budgets/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ edit_link(
<% end %>

<%= linked_resources_for project, :plans, "included_plans" %>

<%= render partial: "project_answer", locals: { project: project } %>
</div>

<div class="resource__details">
Expand Down

0 comments on commit 5d347cf

Please sign in to comment.