diff --git a/app/views/answers/update.js.erb b/app/views/answers/update.js.erb index 2290a67..f63943d 100644 --- a/app/views/answers/update.js.erb +++ b/app/views/answers/update.js.erb @@ -22,5 +22,5 @@ $(".progress").html("<%= escape_javascript(render :partial => '/plans/progress', locals: { plan: @plan }) %>"); // partial /sections/progress -$("#section-progress-<%= @section.id %>") +$(".progress-bar-<%= @section.id %>") .html("<%= escape_javascript(render partial: '/sections/progress', locals: { section: @section, plan: @plan }) %>"); \ No newline at end of file diff --git a/app/views/phases/edit.html.erb b/app/views/phases/edit.html.erb index 39c9db9..2a564f8 100644 --- a/app/views/phases/edit.html.erb +++ b/app/views/phases/edit.html.erb @@ -55,12 +55,18 @@ <% sectionid = section.id %>

- <%= render :partial => "/sections/progress", locals: { section: section, plan: @plan } %> +
+ <%= section.title %> + +
+ <%= render :partial => "/sections/progress", locals: { section: section, plan: @plan } %> +
+

-

<%= raw section.description %>

+
<%= raw section.description %>
-
+ diff --git a/app/views/plans/_progress.html.erb b/app/views/plans/_progress.html.erb index 1c17688..db2542a 100644 --- a/app/views/plans/_progress.html.erb +++ b/app/views/plans/_progress.html.erb @@ -4,6 +4,6 @@ %> <% answered = %(#{nanswers}/#{nquestions})%>
- <%= answered -%> <%= _(' answered')%> - +
 
+ <%= answered -%> <%= _(' answered')%>
diff --git a/app/views/sections/_progress.html.erb b/app/views/sections/_progress.html.erb index 7e02d98..02c8d69 100644 --- a/app/views/sections/_progress.html.erb +++ b/app/views/sections/_progress.html.erb @@ -2,11 +2,7 @@ <% num_section_questions = section.questions.size() %> <% num_section_answers = section.num_answered_questions(plan.id) %> -
- <%= section.title %> - - - <%= num_section_answers %> / <%= num_section_questions %> - - -
\ No newline at end of file + + <%= num_section_answers %> / <%= num_section_questions %> + + \ No newline at end of file diff --git a/lib/assets/javascripts/plans.js b/lib/assets/javascripts/plans.js deleted file mode 100644 index 8f0762a..0000000 --- a/lib/assets/javascripts/plans.js +++ /dev/null @@ -1,52 +0,0 @@ -$(document).ready(function() { - /*---------------- - Popup button listeners for when answers are not saved - ------------------*/ - $(".cancel-section-collapse").click(function () { - var section_id = $(this).attr('data-section'); - $("#collapse-" + section_id).collapse("show"); - $('#section-' + section_id + '-collapse-alert').modal("hide"); - }); - - $(".discard-section-collapse").click(function () { - var section_id = $(this).attr('data-section'); - $('#section-' + section_id + '-collapse-alert').modal("hide"); - }); - - $(".save-section-collapse").click(function () { - var section_id = $(this).attr('data-section'); - $("#collapse-" + section_id).find("input[type='submit']").click(); - $('#section-' + section_id + '-collapse-alert').modal("hide"); - }); - /*---------------- - Listener for clicks in any of the right column of question tabs (e.g. Guidances, Notes) - ------------------*/ - $('.right_column_tab_link').click(function(e){ - e.preventDefault(); - // Find current active tab and hide it - var active = $(this).closest('.question_right_column_ul').children().filter('.active'); - active.removeClass('active'); - $(this).closest('.question-area-right-column').find('div.'+active.attr('class')).hide(); - // Select the clicked tab as active and display its content - active = $(this).parent(); - $(this).closest('.question-area-right-column').find('div.'+active.attr('class')).show(); - active.addClass('active'); - }); - /*---------------- - Accordion toggling for displaying/hiding guidances. - TODO moving to lib/assets/javascripts/annotations when partials for guidances are created - ------------------*/ - $('.accordion-guidance-link').on('click', function (e) { - e.stopPropagation(); - e.preventDefault(); - var accordion_body = $($(this).attr("href")); - accordion_body.toggleClass("in"); //adds or removes 'in' class from accordion_body - if(accordion_body.hasClass('in')){ //accordion expanded - $(this).children(".plus-laranja").removeClass("plus-laranja").addClass("minus-laranja"); //display minus - } - else { //accordion collapsed - $(this).children(".minus-laranja").removeClass("minus-laranja").addClass("plus-laranja"); //display plus - } - }); -}); - diff --git a/lib/assets/javascripts/views/phases/edit.js b/lib/assets/javascripts/views/phases/edit.js new file mode 100644 index 0000000..09d74c4 --- /dev/null +++ b/lib/assets/javascripts/views/phases/edit.js @@ -0,0 +1,51 @@ +$(document).ready(function(){ + /*---------------- + Popup button listeners for when answers are not saved + ------------------*/ + $(".cancel-section-collapse").click(function () { + var section_id = $(this).attr('data-section'); + $("#collapse-" + section_id).collapse("show"); + $('#section-' + section_id + '-collapse-alert').modal("hide"); + }); + + $(".discard-section-collapse").click(function () { + var section_id = $(this).attr('data-section'); + $('#section-' + section_id + '-collapse-alert').modal("hide"); + }); + + $(".save-section-collapse").click(function () { + var section_id = $(this).attr('data-section'); + $("#collapse-" + section_id).find("input[type='submit']").click(); + $('#section-' + section_id + '-collapse-alert').modal("hide"); + }); + /*---------------- + Listener for clicks in any of the right column of question tabs (e.g. Guidances, Notes) + ------------------*/ + $('.right_column_tab_link').click(function(e){ + e.preventDefault(); + // Find current active tab and hide it + var active = $(this).closest('.question_right_column_ul').children().filter('.active'); + active.removeClass('active'); + $(this).closest('.question-area-right-column').find('div.'+active.attr('class')).hide(); + // Select the clicked tab as active and display its content + active = $(this).parent(); + $(this).closest('.question-area-right-column').find('div.'+active.attr('class')).show(); + active.addClass('active'); + }); + /*---------------- + Accordion toggling for displaying/hiding guidances. + TODO moving to lib/assets/javascripts/annotations when partials for guidances are created + ------------------*/ + $('.accordion-guidance-link').on('click', function (e) { + e.stopPropagation(); + e.preventDefault(); + var accordion_body = $($(this).attr("href")); + accordion_body.toggleClass("in"); //adds or removes 'in' class from accordion_body + if(accordion_body.hasClass('in')){ //accordion expanded + $(this).children(".plus-laranja").removeClass("plus-laranja").addClass("minus-laranja"); //display minus + } + else { //accordion collapsed + $(this).children(".minus-laranja").removeClass("minus-laranja").addClass("plus-laranja"); //display plus + } + }); +}); \ No newline at end of file diff --git a/lib/assets/javascripts/views/plans/edit.js b/lib/assets/javascripts/views/plans/edit.js deleted file mode 100644 index 9d89af4..0000000 --- a/lib/assets/javascripts/views/plans/edit.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function(){ - -}); \ No newline at end of file diff --git a/lib/assets/stylesheets/dmproadmap/forms.scss b/lib/assets/stylesheets/dmproadmap/forms.scss index 3f9cccc..bfe2220 100644 --- a/lib/assets/stylesheets/dmproadmap/forms.scss +++ b/lib/assets/stylesheets/dmproadmap/forms.scss @@ -724,16 +724,22 @@ padding: 5px; border-radius: 5px; width: 200px; + height: 20px; - .bar { - position: relative; + #questions-progress-title { + position: absolute; + top: 5px; + left: 5px; + z-index: 3; + } + #questions-progress { + position: absolute; + top: 0; left: 0; - - .bar-fill { - height: 100%; - width: 100%; - background-color: $light-grey; - } + height: 98%; + border-radius: 3px; + background-color: $light-grey; + z-index: 1; } } } @@ -769,6 +775,20 @@ } } } + + .answer-unsaved { + position: relative; + right: -205px; + top: 18px; + color: $error-color; + background: $error-background; + padding: 5px 10px; + border-radius: 3px; + } + + .section-description { + width: 60%; + } /* Example Answers */ div.suggested-answer-div {