From ac1c618a747e71a1ca2dd8238a297c9ce187dead Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Mon, 8 Aug 2016 11:56:42 -0500 Subject: [PATCH] cleaned up progress bar display logic #47 --- app/views/layouts/application.html.erb | 30 ++++++++++++++------------ app/views/quiz/question.html.erb | 11 +--------- app/views/quiz/summary.html.erb | 8 +++++-- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3805059..52e97f8 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,26 +11,28 @@
- <% if content_for?(:category) %> -
> -
+
> +
+ <% if content_for?(:category) %>
Section: <%= yield(:category) %>
-
-
- - <% else %> - -
-
+ <% else %>
Perficient Digital Skills Assessment
-
-
- - <% end %> + <% end %> +
+
<%= yield %> + <% if content_for?(:progress) %> +
+
+ <%= yield :progress %>% +
+
+ <% end %> +
<%= render partial: 'layouts/footer' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> diff --git a/app/views/quiz/question.html.erb b/app/views/quiz/question.html.erb index 9337177..4b175d3 100644 --- a/app/views/quiz/question.html.erb +++ b/app/views/quiz/question.html.erb @@ -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 %> <% end %> - -<% unless @status.on_summary %> -
-
- <%= @status.progress %>% -
-
-<% end %> diff --git a/app/views/quiz/summary.html.erb b/app/views/quiz/summary.html.erb index 46558b8..8e44fbc 100644 --- a/app/views/quiz/summary.html.erb +++ b/app/views/quiz/summary.html.erb @@ -1,3 +1,9 @@ +<% + content_for :title, "Skills Assessment" + content_for :footer_title, "Skills Assessment" + content_for :progress, @status.progress.to_s +%> +

Almost done!

@@ -42,6 +48,4 @@ <% else %>

Sorry, you must answer all questions before you can submit.
<% end %> - -