Skip to content

Commit

Permalink
add conditional classes to callout
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Mar 27, 2024
1 parent d4a4114 commit 8f09fd6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/views/decidim/consultations/question_votes/_callout.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<div class="callout alert">
<% total_published_questions = current_question.consultation.questions.published.count %>
<% voted_questions = current_question.consultation.questions.published.joins(:votes).count %>
<% alert_class = total_published_questions != voted_questions ? 'alert' : 'success' %>

<div class="callout <%= alert_class %>">
<p>
Has repost
<span><%= current_question.consultation.questions.published.joins(:votes).count %></span>
de <span><%= current_question.consultation.questions.published.count %></span> preguntes.
<a class="" data-open="exampleModal1">Revisa el resum de la teva votació aqui</a>
<span><%= voted_questions %></span>
de <span><%= total_published_questions %></span> preguntes.
<a class="" data-open="exampleModal1">Revisa el resum de la teva votació aqui</a>
</p>
</div>

Expand Down

0 comments on commit 8f09fd6

Please sign in to comment.