cleaned up progress bar display logic #47

This commit is contained in:
Mark Moser 2016-08-08 11:56:42 -05:00
parent e6358beec8
commit ac1c618a74
3 changed files with 23 additions and 26 deletions

View File

@ -11,26 +11,28 @@
</head>
<body>
<div class="layout">
<% if content_for?(:category) %>
<header <%= raw("class=\"no-progressbar\"") if content_for?(:summary) %>>
<div class="page-title slash-left">
<header <%= "class=\"no-progressbar\"" unless content_for?(:progress) %>>
<div class="page-title slash-left">
<% if content_for?(:category) %>
<div>Section: <%= yield(:category) %></div>
</div>
</header>
<% else %>
<header class="no-progressbar">
<div class="page-title slash-left">
<% else %>
<div>Perficient Digital Skills Assessment</div>
</div>
</header>
<% end %>
<% end %>
</div>
</header>
<%= yield %>
<% if content_for?(:progress) %>
<div class="progress ignore-margin">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= yield :progress %>"
aria-valuemin="0" aria-valuemax="100" style="width: <%= yield :progress %>%">
<span><%= yield :progress %>%</span>
</div>
</div>
<% end %>
</div>
<%= render partial: 'layouts/footer' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

View File

@ -1,8 +1,8 @@
<%
content_for :title, "Skills Assessment"
content_for :category, @question.category
content_for :summary, true if @status.on_summary
content_for :footer_title, "Skills Assessment"
content_for :progress, @status.progress.to_s
%>
<%= form_for(@answer, url: post_answer_path(@answer.id), html:{method: :post, id: 'answer-form', data: {qid: @question.question_id}}) do |form| %>
@ -37,12 +37,3 @@
<% end %>
</main>
<% end %>
<% unless @status.on_summary %>
<div class="progress ignore-margin">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= @status.progress %>"
aria-valuemin="0" aria-valuemax="100" style="width: <%= @status.progress %>%">
<span><%= @status.progress %>%</span>
</div>
</div>
<% end %>

View File

@ -1,3 +1,9 @@
<%
content_for :title, "Skills Assessment"
content_for :footer_title, "Skills Assessment"
content_for :progress, @status.progress.to_s
%>
<main class="summary_tpl">
<h2 class="prft-heading">Almost done!</h2>
<p>
@ -42,6 +48,4 @@
<% else %>
<div class="error">Sorry, you must answer all questions before you can submit.</div>
<% end %>
</main>