diff --git a/app/views/answers/_new_edit.html.erb b/app/views/answers/_new_edit.html.erb index 9fec108..862bc70 100644 --- a/app/views/answers/_new_edit.html.erb +++ b/app/views/answers/_new_edit.html.erb @@ -19,23 +19,7 @@ <% else %> <%= f.label raw(question.text), for: :text, class: "no-colon" %> <% end %> - - - <% if !readonly && question.annotations.where(type: Annotation.types[:example_answer]).any? %> - <% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %> - <% if annotation.text.present? %> -
- - <%="#{annotation.org.abbreviation} "%> <%=_('Example of answer')%> - - -
-

<%= raw annotation.text %>

-
-
- <% end %> - <% end %> - + <% if question.option_based? %> <% options = question.question_options.by_number %> <% if q_format.checkbox? %> @@ -96,6 +80,22 @@ <% end %> <% end %> + + <% if !readonly && question.annotations.where(type: Annotation.types[:example_answer]).any? %> + <% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %> + <% if annotation.text.present? %> +
+ + <%="#{annotation.org.abbreviation} "%> <%=_('example answer')%> + + +
+

<%= raw annotation.text %>

+
+
+ <% end %> + <% end %> +
diff --git a/app/views/notes/_add.html.erb b/app/views/notes/_add.html.erb index 2817b90..104525e 100644 --- a/app/views/notes/_add.html.erb +++ b/app/views/notes/_add.html.erb @@ -16,9 +16,9 @@ <%= f.hidden_field :plan_id, value: plan_id %>
- <%= label_tag "#{questionid}new_note_text", _('Share note with collaborators') %> + <%= label_tag "#{questionid}new_note_text", _('Add comments to share with collaborators') %> <%= text_area_tag "#{questionid}new_note_text", nil, class: "tinymce" %> <%= tinymce :content_css => asset_path('application.css') %> - +
<% end %> diff --git a/app/views/notes/_list.html.erb b/app/views/notes/_list.html.erb index daf6a20..071dfb8 100644 --- a/app/views/notes/_list.html.erb +++ b/app/views/notes/_list.html.erb @@ -1,14 +1,7 @@ - -<% if notes.count > 1 then%> - <% style_to_add = "height:150px; overflow-y:auto;" %> -<%else%> - <% style_to_add = "" %> -<%end%> -
-
+
<% notes.each do |note|%> @@ -23,10 +16,10 @@ <% if note.archived %> <% if note.archived_by == current_user.id %> - <%= _('Note removed by you')%> + <%= _('Comment removed by you')%> <% else %> <% archived_by_user = User.find(note.archived_by) %> - <%= _('Note removed by')%> <%= archived_by_user.name %> + <%= _('Comment removed by')%> <%= archived_by_user.name %> <%end%> <%else%> diff --git a/app/views/notes/_view.html.erb b/app/views/notes/_view.html.erb index 0610f0c..efe24d2 100644 --- a/app/views/notes/_view.html.erb +++ b/app/views/notes/_view.html.erb @@ -4,7 +4,7 @@
    -
  • <%= _('Noted by:')%>

  • +
  • <%= _('Comment from:')%>

  • <%= user.name%> (<%= l note.updated_at, format: :custom %>)
  • <%= raw note.text %>
diff --git a/app/views/notes/create.js.erb b/app/views/notes/create.js.erb index 4cd1b85..532ce25 100644 --- a/app/views/notes/create.js.erb +++ b/app/views/notes/create.js.erb @@ -1,7 +1,7 @@ // rewrite the number of notes heading e.g. Notes(3) <% noteslabel = "#notes_number_#{@question.id}" %> -$("<%=noteslabel%>").html("Notes (<%= @num_notes %>)"); +$("<%=noteslabel%>").html("Comments (<%= @num_notes %>)"); // need to remove the existing tinymce editor otherwise tinymce.remove(".tinymce"); diff --git a/app/views/phases/_DELETE_note.html.erb b/app/views/phases/_DELETE_note.html.erb deleted file mode 100644 index b38f3dd..0000000 --- a/app/views/phases/_DELETE_note.html.erb +++ /dev/null @@ -1,30 +0,0 @@ - <% if answer.present? && answer.notes.any? %> - <% notes = answer.notes.all.to_a.sort! {|x,y| y.updated_at <=> x.updated_at } %> - <% questionid = question.id %> - <%= hidden_field_tag :question_id, questionid, class: "question_id" %> - - -
- <%= link_to _('Add note'), - "#question-form-#{questionid}", - class: "btn btn-primary add_comment_button", - onclick: "add_note_button(#{questionid})", - role: "button" - %> -
- -
- - - <%= render :partial => "/notes/list", locals: {question_id: question.id, notes: notes, plan: plan} %> - - -
- - - - <% else%> - <%= render :partial => "/notes/add", locals: {answer: answer, question: question, plan_id: plan.id }%> - <% end%> diff --git a/app/views/phases/_guidance_section.html.erb b/app/views/phases/_guidance_section.html.erb index b4fb5ff..46f58de 100644 --- a/app/views/phases/_guidance_section.html.erb +++ b/app/views/phases/_guidance_section.html.erb @@ -20,13 +20,8 @@
  • " role="tab" aria-controls="comment-question-area-<%= question.id %>"> - <% if comments.length > 0 %> - <%= _('Notes') %> - <% else %> - <%= _('Share note') %> - <% end %> + <%= _('Comments') %><%= answer.notes.length > 0 ? " (#{answer.notes.length})" : "" %>
  • @@ -83,8 +78,8 @@
    - <%= link_to _('Add note'), "#question-form-#{questionid}", - class: "btn btn-primary add_comment_button", + <%= link_to _('Add a Comment'), "#question-form-#{questionid}", + class: "link-as-button add_comment_button right", onclick: "add_note_button(#{questionid})", role: "button" %>
    diff --git a/app/views/phases/_note.html.erb b/app/views/phases/_note.html.erb new file mode 100644 index 0000000..2a9b194 --- /dev/null +++ b/app/views/phases/_note.html.erb @@ -0,0 +1,30 @@ + <% if answer.present? && answer.notes.any? %> + <% notes = answer.notes.all.to_a.sort! {|x,y| y.updated_at <=> x.updated_at } %> + <% questionid = question.id %> + <%= hidden_field_tag :question_id, questionid, class: "question_id" %> + + +
    + <%= link_to _('Add a comment'), + "#question-form-#{questionid}", + class: "link-as-button add_comment_button right", + onclick: "add_note_button(#{questionid})", + role: "button" + %> +
    + +
    + + + <%= render :partial => "/notes/list", locals: {question_id: question.id, notes: notes, plan: plan} %> + + +
    + + + + <% else%> + <%= render :partial => "/notes/add", locals: {answer: answer, question: question, plan_id: plan.id }%> + <% end%> diff --git a/app/views/sections/_progress.html.erb b/app/views/sections/_progress.html.erb index 3dee038..7e02d98 100644 --- a/app/views/sections/_progress.html.erb +++ b/app/views/sections/_progress.html.erb @@ -2,9 +2,11 @@ <% 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 +
    + <%= section.title %> + + + <%= num_section_answers %> / <%= num_section_questions %> + + +
    \ No newline at end of file diff --git a/lib/assets/stylesheets/dmproadmap/forms.scss b/lib/assets/stylesheets/dmproadmap/forms.scss index d8acc85..3f9cccc 100644 --- a/lib/assets/stylesheets/dmproadmap/forms.scss +++ b/lib/assets/stylesheets/dmproadmap/forms.scss @@ -743,22 +743,29 @@ h2 { font-size: 18px; - .section-status { - position: absolute; - top: 5px; - left: 0; + .section-title { + color: $white; + background-color: $primary-color; width: 55%; - text-align: right; - font-size: 16px; + height: 100%; + padding: 0 0 10px 10px; + margin-bottom: -10px; - .fa { - font-size: 14px; + .section-status { position: absolute; - top: 3px; - right: -19px; - } - .fa-check-circle { - color: $notice-background; + top: 10px; + left: 0; + width: 55%; + text-align: right; + font-size: 16px; + + .fa { + font-size: 14px; + position: absolute; + top: 5px; + right: -19px; + color: $white; + } } } } @@ -766,8 +773,7 @@ /* Example Answers */ div.suggested-answer-div { width: 80%; - margin-top: 20px; - margin-left: 15px; + margin: 10px 15px; border: 0.5px solid $light-grey; border-radius: 3px; padding: 5px 15px; @@ -797,10 +803,38 @@ width: 84%; } - .guidance_tab h3 { - font-size: 16px; - .fa { - font-size: 14px; + .guidance_tab { + h3 { + font-size: 16px; + .fa { + font-size: 14px; + } + } + .tab-panel { + min-height: auto; + } + } + + .comment-area { + .div-table-content { + max-height: 200px; + overflow-y: auto; + border-bottom: 1px solid $primary-color; + + .dmp_table { + margin-top: 40px; + border: none; + border-top: 1px solid $primary-color; + + tr { + border-bottom: 1px solid $light-grey; + } + } + } + .view_comment_class { + ul { + padding-left: 0; + } } } }