Newer
Older
dmpopidor / app / views / plans / _progress.html.erb
@briri briri on 14 Oct 2019 429 bytes fixed issue with progress bar totals
<%# locals: { plan, current_phase } %>
<%
  nanswers = plan.num_answered_questions(current_phase)
  nquestions = current_phase.num_questions()
  value=(nanswers.to_f/nquestions*100).round(2)
%>
<div class="progress-bar" role="progressbar"
  aria-valuenow="<%= value %>"
  aria-valuemin="0" aria-valuemax="100"
  style="min-width: 7em; width: <%= "#{value}%" %>;">
    <%= "#{nanswers}/#{nquestions} #{_('answered')}" %>
</div>