cleaned up progress bar display logic #47
This commit is contained in:
parent
e6358beec8
commit
ac1c618a74
@ -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' %>
|
||||
|
@ -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 %>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user