-
-
<% if (user_signed_in? && current_user.can_org_admin? && ( action_name.include? "admin_" ) ) %>
<% if current_user.can_modify_templates? %>
- <% if namespace == "templates" then %>
-
- - <% else %> -
- - <% end %> - <%= link_to t("org_admin.template_label"), admin_index_template_path(current_user.org_id) %> +
- > + <%= link_to _('Templates'), admin_index_template_path(current_user.org_id) %> <% end %> <% if current_user.can_modify_guidance? %> - <% if namespace == "guidances" then %> -
- - <% else %> -
- - <% end %> - <%= link_to t("org_admin.guidance_label"), admin_index_guidance_path(current_user.org_id)%> +
- > + <%= link_to _('Guidance'), admin_index_guidance_path(current_user.org_id) %> <% end %> <% if current_user.can_modify_org_details? %> - <% if namespace == "orgs" then %> -
- - <% else %> -
- - <% end %> - <%= link_to t("org_admin.org_details_label"), admin_show_org_path(current_user.org_id)%> +
- > + <%= link_to _('Organisation details'), admin_show_org_path(current_user.org_id) %> <% end %> <% if current_user.can_grant_permissions? %> - <% if current_path == "/org/admin/users/admin_index" || current_path == "/org/admin/users/admin_api_update" then %> -
- - <% else %> -
- - <% end %> - <%= link_to t("org_admin.user_list_label"), "/org/admin/users/admin_index", class: "main_nav_last_li"%> +
- > + <%= link_to _('Users'), admin_index_users_path, class: 'main_nav_last_li' %> <% end %> <% else %> <% if user_signed_in? %> - - <% if (namespace == "projects" || namespace == "plans") && current_path != "/projects/new" then %> -
- - <% else %> -
- - <% end %> - <%= link_to t("helpers.view_plans_label"), projects_path %> +
- > + <%= link_to _('View plans'), plans_path %> - - <% if current_path == "/projects/new" then %> -
- - <% else %> -
- - <% end %> - <%= link_to t("helpers.create_plan_label"), new_project_path %> +
- > + <%= link_to _('Create plan'), new_plan_path %> - <% else %> - <% if current_path == "/" then %> -
- - <% else %> -
- - <% end %> - <%= link_to t("helpers.home"), root_path %> +
- > + <%= link_to _('Home'), root_path %> <% end %> - <% if current_path == "/about_us" then %> -
- - <% else %> -
- - <% end %> - <%= t("helpers.about_us_label") %> +
- > + <%= link_to _('About'), about_us_path %> - <% if current_path == "/roadmap" then %> -
- - <% else %> -
- - <% end %> - <%= t("helpers.roadmap_label") %> +
- > + <%= link_to _('Future plans'), roadmap_path %> - <% if current_path == "/help" then %> -
- - <% else %> -
- - <% end %> - <%= t("helpers.help_label") %> +
- > + <%= link_to _('Help'), help_path %> - - <% if current_path == "/plans/public_plans" then %> -
- - <% else %> -
- - <% end %> - <%= t("helpers.public_plans_label") %> +
- > + <%= link_to _('Public DMPs'), public_plans_path %> -
-
- <%= t('helpers.change_language')%>
+ <%= _('Change language') %>
-
- <% Language.all.order('name ASC').each do |language|%>
- <% if I18n.locale == language.abbreviation %>
-
- - <% else %> -
- - <% end %> - <%= link_to language.name, {locale: language.abbreviation}, class: 'main_nav lang-dropdown-link'%> - + <% FastGettext.default_available_locales.sort.each do |l| %> +
- > + <%= link_to l, {locale: l}, class: 'main_nav lang-dropdown-link'%> + <% end %>
diff --git a/app/views/layouts/_signin_signout.html.erb b/app/views/layouts/_signin_signout.html.erb
index f4a8b59..e975dc6 100644
--- a/app/views/layouts/_signin_signout.html.erb
+++ b/app/views/layouts/_signin_signout.html.erb
@@ -3,25 +3,25 @@
-
- <%= t("helpers.signed_in")%>
+ <%= _('Signed in as ')%>
<%= current_user.name %>
-
-
- <%= link_to t("helpers.edit_profile"), edit_user_registration_path, class: "signIn_dropdown_link" %> +
- <%= link_to _('Edit profile'), edit_user_registration_path, class: "signIn_dropdown_link" %> <% if current_user.can_super_admin? %> -
- <%= link_to t("helpers.admin_area"), "/admin", class: "signIn_dropdown_link" %> +
- <%= link_to _('Super admin area'), "/admin", class: "signIn_dropdown_link" %> <% end %> <% if current_user.can_org_admin? && !current_user.org_id.nil? %> -
- <%= link_to t("org_admin.admin_area"), admin_index_template_path(current_user.org_id), class: "signIn_dropdown_link" %> +
- <%= link_to _("Admin area"), admin_index_template_path(current_user.org_id), class: "signIn_dropdown_link" %> <% end %> -
- <%= link_to t("helpers.sign_out"), destroy_user_session_path, method: :delete, class: "signIn_dropdown_link" %> +
- <%= link_to _('Sign out'), destroy_user_session_path, method: :delete, class: "signIn_dropdown_link" %>
<% else %>
-
<% unless controller_name == "home" && action_name == "index" then %>
- <%= t("helpers.sign_in")%> /
- <%= t("helpers.sign_up")%>
+ <%= _('Sign in')%> /
+ <%= _('Sign up')%>
<% else %>
<%= raw " " %>
<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index c598adc..e8a3467 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
-
<%= t('tool_title', application_name: Rails.configuration.branding[:application][:name])%> +<%= _('%{application_name}') % { :application_name => Rails.configuration.branding[:application][:name] } %> <%= favicon_link_tag "favicon.ico" %> + + +<% new_note = Note.new + if !answer.nil? + answerid = answer["id"] + else + answerid = answer_obj.id + end +%> + +<%= form_for :new_note, + :url => {:controller => :notes, :action => :create }, + :html=>{:method=>:post, :id => "new_note_form_#{answerid}", :class => "add_note_form"} do |f| %> + <%= f.hidden_field :user_id, :value => current_user.id %> + <%= f.hidden_field :answer_id, :value => answerid %> + <%= f.hidden_field :question_id, :value => question["id"] %> + <%= f.hidden_field :plan_id, :value => plan_data["id"] %> + + <%= text_area_tag("#{answerid}new_note_text".to_sym, "" , class: "tinymce") %> +
+ + ++ <%= f.submit t("helpers.submit.save"), :class => "btn btn-primary new_comment_submit_button" %> ++ +<%end%> diff --git a/app/views/phases/_answer_form.html.erb b/app/views/phases/_answer_form.html.erb new file mode 100644 index 0000000..74ae43a --- /dev/null +++ b/app/views/phases/_answer_form.html.erb @@ -0,0 +1,223 @@ + + ++ + <% + q_format = question["question_format"] + answer = nil + answer_obj = nil + if question.has_key?("answers") + answer = question["answers"].first + answer_obj = Answer.find(answer["id"]) + else + answer_obj = Answer.new + end + question_obj = Question.find(question["id"]) + %> + ++ +-unsaved" class="label label-inverse answer-unsaved" style="display:none;"><%= t("helpers.unsaved") %> + + +" class="question-form"> + <%= semantic_form_for answer_obj, :url => {:controller => :answers, :action => :update }, :html=>{:method=>:put}, :remote => true do |f| %> + <%= f.inputs do %> + <%= f.input :plan_id, :as => :hidden, :input_html => { :value => @plan_data["id"] } %> + <%= f.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %> + <%= f.input :question_id, :as => :hidden, :input_html => { :value => question["id"], :class => "question_id" } %> + + + + <%= raw question["text"] %> + + + <% if question.has_key?("suggested_answer") && question["suggested_answer"]["text"].present? %> + <% suggested_answer = question["suggested_answer"] %> ++ + <% if answer.nil? || !answer.has_key?("created_at") || answer["created_at"].nil? %> + -status" class="label label-warning answer-status"><%= t("helpers.notanswered") %> + <% else %> + -status" class="label label-info answer-status"><%= t("helpers.answered_by")%><%= answer_obj.created_at %><%= t("helpers.answered_by_part2")%><%= answer_obj.user.name %> + <% end %> ++ + <% if suggested_answer["is_example"] then %> + <%= t("org_admin.questions.example_answer_label")%> + <%else%> + <%= t("org_admin.questions.suggested_answer_label")%> + <%end%> + + ++ <% end %> + + + <% if [ @checkbox, @multi, @radio, @dropdown ].include?( q_format["id"] ) %> + <% options = question.options.order("number") %> + + + <% if q_format.id == @checkbox %> + <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, :input_html => { :id => "options-#{question.id}" } %> + <% elsif q_format.id == @multi %> + <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true , :id => "options-#{question.id}" } %> + <% elsif q_format.id == @radio %> ++++ <%= raw suggested_answer["text"] %> +
+-
+ <% options.each do |op| %>
+
- + <% if answer.option_ids[0] == op.id then%> + <%= f.radio_button :option_ids, op.id, :checked => true, id: "answer_option_ids_#{op.id}"%> + <%else%> + <%= f.radio_button :option_ids, op.id, :checked => false, id: "answer_option_ids_#{op.id}"%> + <% end %> + <%= raw op.text %> + <% end %> +
- " class="saving-message" style="display:none;"><%= t("helpers.saving")%>
+ <% end %> + <% end %> ++ ++ + +<% if last_question_id == question["id"] then %> + +<% else %> + +<% end %> diff --git a/app/views/phases/_answer_form_ro.html.erb b/app/views/phases/_answer_form_ro.html.erb new file mode 100644 index 0000000..64a0fb0 --- /dev/null +++ b/app/views/phases/_answer_form_ro.html.erb @@ -0,0 +1,248 @@ + +<% answer = @plan.answer(question.id) %> + +" class="question_right_column_nav"> + <% comments = answer_obj.notes.all %> + <%= hidden_field_tag :question_id, question["id"], :class => "question_id" %> ++ + + +-
+ <% if (!question["guidance"].nil? && question["guidance"] != "") || question.has_key?("theme_guidance") then %>
+
+ <% css_style_comment_div = "display: none;"%>
+ <% css_style_guidance_div = ""%>
+
- + <%= link_to t("helpers.guidance_accordion_label"), "#", :class => "guidance_accordion_button" %> + +
- + <% if comments.count > 0 then%> + <% comments_label_with_count = "#{t("helpers.comment_accordion_label")} (#{comments.count})"%> + <%= link_to comments_label_with_count , "#", :class => "comments_accordion_button" %> + <%else%> + <%= link_to t("helpers.add_comment_accordion_label"), "#", :class => "comments_accordion_button" %> + <%end%> + + <%else%> + + <% css_style_comment_div = ""%> + <% css_style_guidance_div = "display: none;"%> +
-
+ <% if comments.count > 0 then%>
+ <% comments_label_with_count = "#{t("helpers.comment_accordion_label")} (#{comments.count})"%>
+
<%= comments_label_with_count %>
+ <%else%> +<%= t("helpers.add_comment_accordion_label") %>
+ <%end%> +
+ <%end%>
+
" style="<%= css_style_guidance_div%>" > ++ + +-guidance"> + + + <% if question["guidance"].present? %> +++ + + + + ++ <% end %> + + + + <% gnum = 0 %> + <% if question.has_key?("theme_guidance") %> + <% question["theme_guidance"].each_key do |theme| %> + <% question["theme_guidance"][theme].each do |guidance| %> + <% + orgname = guidance["org"] + gnum = gnum + 1 + text = guidance["text"] + %> + +" class="guidance-accordion-body collapse"> ++ +<%= raw question["guidance"] %>++ + + + + ++ <% end %> + <% end %> + <% end %> + +" class="guidance-accordion-body collapse"> ++<%= raw text %>+" style="<%= css_style_comment_div%>"> + <%= render :partial => "note", locals: {question: question, answer_obj: answer_obj, answer: answer, plan: plan, plan_data: plan_data}%> ++ ++ + <% q_format = question.question_format%> + + <% if readonly != "always" then %> ++ + + +> + <%= semantic_form_for answer, :url => {:controller => :answers, :action => :create }, :html=>{:method=>:post}, :remote => true do |f| %> + <%= f.inputs do %> + <%= f.input :plan_id, :as => :hidden %> + <%= f.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %> + <%= f.input :question_id, :as => :hidden, :input_html => { :class => "question_id" } %> + + + + <%= raw question.text %> + + + <% suggested_answer = question.suggested_answers.where(org_id: @plan.template.org_id).first %> + <% if suggested_answer.present? %> ++ <% end %> + ++ + <% if suggested_answer.is_example? then %> + <%= t("org_admin.questions.example_answer_label")%> + <%else%> + <%= t("org_admin.questions.suggested_answer_label")%> + <%end%> + ++ <% end %> + + + <% if q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") || q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown") then%> + <% options = question.options.order("number") %> + + <% if q_format.title == t("helpers.checkbox") then %> + <% if readonly then %> + <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, input_html => { :disabled => true, :id => "options-#{question.id}" } %> + <% else %> + <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, :input_html => { :id => "options-#{question.id}" } %> + <% end %> + + <% elsif q_format.title == t("helpers.multi_select_box") then %> + <% if readonly then %> + <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true, :disabled => true , :id => "options-#{question.id}" } %> + <% else %> + <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true , :id => "options-#{question.id}" } %> + <% end %> + + <% elsif q_format.title == t("helpers.radio_buttons") then%> ++++ <%= raw suggested_answer.text %> +
+-
+ <% options.each do |op| %>
+
- + <% if answer.option_ids[0] == op.id then%> + <% if readonly then %> + <%= f.radio_button :option_ids, op.id, :checked => true, disabled: true, id: "answer_option_ids_#{op.id}"%> + <% else %> + <%= f.radio_button :option_ids, op.id, :checked => true, id: "answer_option_ids_#{op.id}"%> + <% end %> + <%else%> + <% if readonly then %> + <%= f.radio_button :option_ids, op.id, :checked => false, disabled: true, id: "answer_option_ids_#{op.id}"%> + <% else %> + <%= f.radio_button :option_ids, op.id, :checked => false, id: "answer_option_ids_#{op.id}"%> + <% end %> + <% end %> + <%= op.text %> + <% end %> +
- <%= t("helpers.saving")%>
+ <% end %> + <% end %> +> ++ <% if answer.created_at.nil? then %> + <%= t("helpers.notanswered") %> + <% else %> + <%= t("helpers.answered_by")%><%= answer.created_at %><%= t("helpers.answered_by_part2")%><%= answer.user.name %> + <% end %> + <%= t("helpers.unsaved") %> +<%= question.text %>
++ <% if q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") || q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown") %> ++-
+ <% if answer.options.is_a? Option then %>
+
- <%= answer.options.text %> + <% else %> + <% answer.options.each do |o| %> +
- <%= o.text %> + <% end %> + <% end %> +
+ <%= raw answer.text %> ++++ +<% if last_question_id == question.id then %> + +<% else %> + +<% end %> diff --git a/app/views/phases/_archive_note.html.erb b/app/views/phases/_archive_note.html.erb new file mode 100644 index 0000000..daee904 --- /dev/null +++ b/app/views/phases/_archive_note.html.erb @@ -0,0 +1,23 @@ + +<%= form_for(Note.new, :url => {:controller => :notes, :action => :archive } , :html => { :method => :put, :class => "archive_note_form", :id => "archive_note_form_#{note["id"]}"}) do |f| %> + <%= f.hidden_field :id, :value => note["id"] %> + <%= f.hidden_field :archived_by, :value => current_user.id %> + + <%= render :partial => "view_note", locals: {note: note} %> + + <% if current_user.id == note["user_id"] then %> + <%= t('helpers.notes.archive_own_note_question')%> + <% button_label = t("helpers.notes.archive_own_comment_button_label") %> + <% else%> + <%= t("helpers.notes.archive_note_question")%> + <% button_label = t("helpers.notes.archive_comment_button_label") %> + <%end%> + + ++ <% @comments = Notes.where("question_id = ? AND plan_id = ?", question.id, answer.plan_id ) %> + <%= hidden_field_tag :question_id, question.id, :class => "question_id" %> + <% @question_guidances = @plan.guidance_for_question(question) %> ++ + + +-
+ <% if (!question.guidance.nil? && question.guidance != "") || @question_guidances.count > 0 then %>
+
+ <% css_style_comment_div = "display: none;"%>
+ <% css_style_guidance_div = ""%>
+
- + <%= link_to t("helpers.guidance_accordion_label"), "#", :class => "guidance_accordion_button" %> + +
- + <% if @comments.count > 0 then%> + <% comments_label_with_count = "#{t("helpers.comment_accordion_label")} (#{@comments.count})"%> + <%= link_to comments_label_with_count , "#", :class => "comments_accordion_button" %> + <%else%> + <%= link_to t("helpers.add_comment_accordion_label"), "#", :class => "comments_accordion_button" %> + <%end%> + + <%else%> + + <% css_style_comment_div = ""%> + <% css_style_guidance_div = "display: none;"%> +
-
+ <% if @comments.count > 0 then%>
+ <% comments_label_with_count = "#{t("helpers.comment_accordion_label")} (#{@comments.count})"%>
+
<%= comments_label_with_count %>
+ <%else%> +<%= t("helpers.add_comment_accordion_label") %>
+ <%end%> +
+ <%end%>
+
++ + ++ + <% if !question.guidance.nil? && question.guidance != "" then %> +++ ++ <% end %> + + <% @question_guidances.each_pair do |group,themes| %> + <% themes.each_pair do |theme,guidances| %> + <% guidances.each do |guidance| %> + + <% end %> + <% end %> + <% end %> +++<%= raw question.guidance %>++ <%= render :partial => "comments", locals: {questionId: question.id, plan_id: answer.plan_id }%> ++ + + ++ <%= hidden_field_tag :note_id, note["id"], :class => "comment_id" %> + <%= f.submit button_label, :class => "btn btn-primary archive_comment_submit_button" %> + <%= link_to t("helpers.submit.cancel"), "#", :class => "cancel_archive_comment btn cancel" %> ++
+<%end%> diff --git a/app/views/phases/_edit_note.html.erb b/app/views/phases/_edit_note.html.erb new file mode 100644 index 0000000..366945f --- /dev/null +++ b/app/views/phases/_edit_note.html.erb @@ -0,0 +1,16 @@ + + +<%= form_for(Note.new, :url => {:controller => :notes, :action => :update } , :html => { :method => :put, :class => "edit_note_form", :id=> "edit_note_form_#{note["id"]}"}) do |f| %> + <%= f.hidden_field :id, :value => note["id"] %> + + <%= text_area_tag("#{note["id"]}_note_text".to_sym, note["text"] , class: "tinymce") %> +
+ + ++ <%= hidden_field_tag :answer, note["answer_id"], :class => "answer_id" %> + <%= hidden_field_tag :note_id, note["id"], :class => "note_id" %> + <%= f.submit t("helpers.submit.save"), :class => "btn btn-primary edit_note_submit_button" %> ++
+<%end%> diff --git a/app/views/phases/_list_notes.html.erb b/app/views/phases/_list_notes.html.erb new file mode 100644 index 0000000..7d6315a --- /dev/null +++ b/app/views/phases/_list_notes.html.erb @@ -0,0 +1,91 @@ + + +<% if notes.count > 1 then%> + <% style_to_add = "height:150px; overflow-y:auto;" %> +<%else%> + <% style_to_add = "" %> +<%end%> + + +<% notes.sort! {|x,y| y["updated_at"] <=> x["updated_at"] } %> + + + +++ + + + +<% notes_not_archived = notes.select { |n| n["archived"].nil? } %> +<% latest_note = notes_not_archived.sort { |x,y| y["updated_at"] <=> x["updated_at"] }.first %> +<% if !latest_note.nil? then%> ++ + <% notes.each do |c|%> +
++ + <%end%> + ++ <% user = c["user"] %> + <% user = User.find(c["user_id"]) %> + <%= user["name"] %> + (<%= l c["updated_at"], format: :custom %>) + ++ + <% if c["archived"] %> + + <% if c["archived_by"] == current_user.id %> + <%= t("helpers.comments.retracted")%> + <% else %> + <% archived_by_user = User.find(c["archived_by"]) %> + <%= t("helpers.comments.clear_by")%> <%= archived_by_user.name %> + <%end%> + + <%else%> + + <%= link_to t("helpers.comments.view_label"),"#", :class => "dmp_table_link view_comment_button" %> + <%= hidden_field_tag :note_id, c["id"], :class => "comment_id" %> + + <% if current_user.id == c["user_id"] %> + <%= link_to t("helpers.comments.edit_label"),"#", :class => "dmp_table_link edit_comment_button" %> + <%= hidden_field_tag :note_id, c["id"], :class => "comment_id" %> + <%= link_to t("helpers.comments.retract_label"),"#", :class => "dmp_table_link archive_comment_button" %> + <% end%> + + <% if plan.administerable_by?(current_user.id) && current_user.id != c["user_id"] %> + <%= hidden_field_tag :note_id, c["id"], :class => "comment_id" %> + <%= link_to t("helpers.comments.clear_label"),"#", :class => "dmp_table_link archive_comment_button" %> + <% end%> + <%end%> + + +" class ="view_comment_class"> + <%= render :partial => "view_note", locals: {note: latest_note} %> + ++<%end%> + +<%notes.each do |com|%> + +" class ="view_comment_class" style="display: none"> + <%= render :partial => "view_note", locals: {note: com} %> + ++ + +" class ="edit_comment_class" style="display: none"> + <%= render :partial => "edit_note", locals: {note: com} %> + ++ + +" class ="archive_comment_class" style="display: none"> + <%= render :partial => "archive_note", locals: {note: com} %> + ++ +<%end%> diff --git a/app/views/phases/_note.html.erb b/app/views/phases/_note.html.erb new file mode 100644 index 0000000..659738a --- /dev/null +++ b/app/views/phases/_note.html.erb @@ -0,0 +1,36 @@ + + + <% if answer.present? && answer.has_key?("notes") %> + <% notes = answer["notes"] %> + <% answerid = answer["id"] %> + <%= hidden_field_tag :answer_id, answer["id"] %> + + ++ <%= link_to t("helpers.comments.add_comment_label"),'#', :class => "btn btn-primary add_comment_button" %> ++ + + + + <%= render :partial => "list_notes", locals: {question: question, notes: notes, plan:plan} %> + + + + ++ <%= link_to t("helpers.comments.add_comment_label"),'#', :class => "btn btn-primary add_comment_button" %> ++ + + + ++ <%= render :partial => "add_note", locals: {answer: answer, answer_obj: answer_obj, question: question, plan_data: plan_data}%> ++ + <% else%> + <%= t("helpers.comments.add_comment_text")%> + <%= render :partial => "add_note", locals: {answer: answer, answer_obj: answer_obj, question: question, plan_data: plan_data}%> + <% end%> diff --git a/app/views/phases/_view_note.html.erb b/app/views/phases/_view_note.html.erb new file mode 100644 index 0000000..2a1d14a --- /dev/null +++ b/app/views/phases/_view_note.html.erb @@ -0,0 +1,11 @@ + +<% user = User.find(note["user_id"]) %> ++++diff --git a/app/views/phases/edit.html.erb b/app/views/phases/edit.html.erb new file mode 100644 index 0000000..9b98568 --- /dev/null +++ b/app/views/phases/edit.html.erb @@ -0,0 +1,168 @@ +<%- model_class = Plan -%> +<% javascript "plans.js" %> + + + + + +<%= render :partial => "/plans/plan_title", locals: {plan: @plan, plan_data: @plan_data} %> + + + +<% status = @plan.status %> +-
+
<%= t("helpers.comments.commented_by")%>
+ - <%= user.name%> (<%= l note["updated_at"], format: :custom %>) +
- <%= raw note["text"] %> +
+ <%space_used = status["space_used"].to_i + space_title = t("helpers.plan.export.space_used", space_used: space_used, num_pages: @plan.template.settings(:export).max_pages) + answered = %(#{status["num_answers"]}/#{status["num_questions"]})%> ++ + + +<%= render :partial => "/plans/plan_nav_tabs", locals: {plan: @plan, plan_data: @plan_data, active: @phase.title } %> + + + ++ <%= answered -%> <%= t("helpers.project.questions_answered")%> + ;" title="<%= answered -%> <%= t("helpers.project.questions_answered")%>"> ++ +
+ ++ = 100 ? "class=bar-full-text" : "" -%>><%= space_title -%> + " style="width: <%= space_used -%>%;" title="<%= space_title -%>"> +++ ++ + +<%= render :partial => "plans/export", locals: {plan: @plan, plan_data: @plan_data} %> + + +<% session.delete(:question_id_comments)%> diff --git a/app/views/plans/_add_note.html.erb b/app/views/plans/_add_note.html.erb deleted file mode 100644 index 957e0ef..0000000 --- a/app/views/plans/_add_note.html.erb +++ /dev/null @@ -1,20 +0,0 @@ - - -<% @new_note = Note.new %> - -<%= form_for :new_note, :url => {:controller => :notes, :action => :create } , :html=>{:method=>:post, :id => "new_note_form_#{questionId}", :class => "add_note_form"} do |f| %> - <%= f.hidden_field :user_id, :value => current_user.id %> - <%= f.hidden_field :question_id, :value => questionId %> - <%= f.hidden_field :plan_id, :value => planId %> - - <%= text_area_tag("#{questionId}new_note_text".to_sym, "" , class: "tinymce") %> -+ <% @phase_data["sections"].each do |section| %> + + <% sectionid = section["id"] %> + + + <% if session[:question_id_comments].to_i != 0 then %> + <% question_from_comment = Question.find(session[:question_id_comments])%> + <% if sectionid == question_from_comment.section_id then %> + <%= hidden_field_tag :comment_section_id, question_from_comment.section_id, :class => "comment_section_id" %> + <%end%> + <% end%> + + + ++ + <%= tinymce :content_css => asset_path("application.css"), :setup => "function(editor){editor.on('change', function(e){$.fn.check_textarea(editor)});}" %> ++ + + <% num_section_questions = section["questions"].count %> + <% num_section_answers = section["nanswers"] %> + <% question_word = "questions" %> + <% if num_section_questions == 1 then %> + <% question_word = "question" %> + <% end %> + <% section_status = "#{num_section_questions} #{question_word}, #{num_section_answers} answered" %> + + + + + ++ + ++++ <%= raw section["description"] %> ++ ++ + + ++++<%= t ('helpers.saving')%>
+++ + +<%= t ('helpers.removing')%>
++ <% section["questions"].each do |question| %> + <% if question["id"] == session[:question_id_comments].to_i then id_css = "current_question" end %> +++ <% partialname = "answer_form" + if @readonly + partialname += "_ro" + end + %> + + <% guidances = question["guidances"] %> + + <%= render partial: partialname, + locals: { + plan: @plan, + plan_data: @plan_data, + question: question, + last_question_id: section["questions"].last["id"] + } + %> ++ <% end %> ++ ++ + <% end %> ++ ++ +<%= t("helpers.project.not_saved_answers_header")%>
+++ + + +++<%= t("helpers.project.not_saved_answers_text_alert")%>
+<%= t("helpers.project.not_saved_answers_confirmation_alert")%>
+
- <% question = Question.find(questionId)%> - -- <%= hidden_field_tag :section_id, question.section_id, :class => "section_id" %> - <%= hidden_field_tag :question_id, question.id, :class => "question_id" %> - <%= f.submit t("helpers.submit.save"), :class => "btn btn-primary new_comment_submit_button" %> -- -<%end%> \ No newline at end of file diff --git a/app/views/plans/_archive_note.html.erb b/app/views/plans/_archive_note.html.erb deleted file mode 100644 index a101e30..0000000 --- a/app/views/plans/_archive_note.html.erb +++ /dev/null @@ -1,28 +0,0 @@ - - -<%= form_for(note, :url => {:controller => :notes, :action => :archive } , :html => { :method => :put, :class => "archive_note_form", :id => "archive_note_form_#{note.id}"}) do |f| %> - <%= f.hidden_field :id, :value => note.id %> - <%= f.hidden_field :archived_by, :value => current_user.id %> - - <%= render :partial => "view_note", locals: {note: note} %> - - <% if current_user.id == note.user_id then %> - <%= t('helpers.notes.archive_own_note_question')%> - <% button_label = t("helpers.notes.archive_own_comment_button_label") %> - <% else%> - <%= t("helpers.notes.archive_note_question")%> - <% button_label = t("helpers.notes.archive_comment_button_label") %> - <%end%> - - -- <% question = Question.find(note.question_id)%> - <%= hidden_field_tag :plan_id, note.plan_id, :class => "plan_id" %> - <%= hidden_field_tag :note_id, note.id, :class => "comment_id" %> - <%= hidden_field_tag :section_id, question.section_id, :class => "section_id" %> - <%= f.submit button_label, :class => "btn btn-primary archive_comment_submit_button" %> - <%= hidden_field_tag :note_id, note.id, :class => "comment_id" %> - <%= link_to t("helpers.submit.cancel"), "#", :class => "cancel_archive_comment btn cancel" %> --
-<%end%> \ No newline at end of file diff --git a/app/views/plans/_dropdowns_new_plan.html.erb b/app/views/plans/_dropdowns_new_plan.html.erb new file mode 100644 index 0000000..5413579 --- /dev/null +++ b/app/views/plans/_dropdowns_new_plan.html.erb @@ -0,0 +1,41 @@ + + +<%= semantic_form_for @plan, :url => {:controller => :plans, :action => :create }, :html=>{:method=>:post} do |f| %> + <%= f.inputs do %> + <%= hidden_field_tag :default_tag, "false" ,:id => "default_tag" %> ++ +diff --git a/app/views/plans/_list_notes.html.erb b/app/views/plans/_list_notes.html.erb deleted file mode 100644 index 10a16f0..0000000 --- a/app/views/plans/_list_notes.html.erb +++ /dev/null @@ -1,79 +0,0 @@ - -<% if notes.count > 1 then%> - <% style_to_add = "height:150px; overflow-y:auto;" %> -<%else%> - <% style_to_add = "" %> -<%end%> - -<%= t('helpers.project.create_page.title') %>
+++ + +<%= raw t('helpers.project.create_page.desc_html')%>
++ + ++ <% end %> + + + <%= f.actions do %> + <%= f.action :submit, + :as => :button, + :input_html => { :id => "create-plan-button", :class => "btn btn-primary"}, + :label => t('helpers.project.create') %> + <% end %> + +<% end %> diff --git a/app/views/plans/_edit_note.html.erb b/app/views/plans/_edit_note.html.erb deleted file mode 100644 index 6294200..0000000 --- a/app/views/plans/_edit_note.html.erb +++ /dev/null @@ -1,18 +0,0 @@ - - -<%= form_for(note, :url => {:controller => :notes, :action => :update } , :html => { :method => :put, :class => "edit_note_form", :id=> "edit_note_form_#{note.id}"}) do |f| %> - <%= f.hidden_field :id, :value => note.id %> - - <%= text_area_tag("#{note.id}_note_text".to_sym, note.text , class: "tinymce") %> -+++ <%= f.input :funder_id, + :as => :select, + :collection => @funders, + :label => t('helpers.project.create_page.funders_question'), + :input_html => { :multiple => false, :class => ["select2", "select2-container"] }, + :include_blank => constant("organisation_types.funder") %> + + ++ +
- - -- <% question = Question.find(note.question_id)%> - <%= hidden_field_tag :plan_id, note.plan_id, :class => "plan_id" %> - <%= hidden_field_tag :note_id, note.id, :class => "note_id" %> - <%= hidden_field_tag :section_id, question.section_id, :class => "section_id" %> - <%= f.submit t("helpers.submit.save"), :class => "btn btn-primary edit_note_submit_button" %> --
-<%end%> \ No newline at end of file diff --git a/app/views/plans/_export.html.erb b/app/views/plans/_export.html.erb index 6c0e8de..876ab64 100644 --- a/app/views/plans/_export.html.erb +++ b/app/views/plans/_export.html.erb @@ -1,9 +1,9 @@\ No newline at end of file +-<%= t('helpers.export') %> <%= plan.project.title %>: <%= plan.version.phase.dmptemplate.title %>
+<%= t('helpers.export') %> <%= plan.title %>: <%= plan_data["template"]["title"] %>
- <%= render :partial => "/shared/export_links", locals: {plan: plan} %> + <%= render :partial => "/shared/export_links", locals: {plan: plan, plan_data: plan_data} %>--- - - - -<% notes_not_archived = notes.where("archived IS NULL") %> -<% latest_note = notes_not_archived.order("updated_at DESC").first %> -<% if !latest_note.nil? then%> -- - <% notes.order("updated_at DESC").each do |c|%> -
-- - <%end%> - -- <% user = User.find(c.user_id) %> - <%= user.name %> - (<%= l c.updated_at, format: :custom %>) - -- <% if c.archived == true then %> - <% if c.archived_by == current_user.id then%> - <%= t("helpers.comments.retracted")%> - <% else %> - <% archived_by_user = User.find(c.archived_by) %> - <%= t("helpers.comments.clear_by")%> <%= archived_by_user.name %> - <%end%> - <%else%> - <%= link_to t("helpers.comments.view_label"),"#", :class => "dmp_table_link view_comment_button" %> - <%= hidden_field_tag :note_id, c.id, :class => "comment_id" %> - <% if current_user.id == c.user_id then %> - <%= link_to t("helpers.comments.edit_label"),"#", :class => "dmp_table_link edit_comment_button" %> - - <%= hidden_field_tag :note_id, c.id, :class => "comment_id" %> - <%= link_to t("helpers.comments.retract_label"),"#", :class => "dmp_table_link archive_comment_button" %> - <% end%> - <% project_id = Plan.find(c.plan_id).project_id%> - <% if (Project.find(project_id).administerable_by(current_user.id) && current_user.id != c.user_id )then%> - <%= hidden_field_tag :note_id, c.id, :class => "comment_id" %> - <%= link_to t("helpers.comments.clear_label"),"#", :class => "dmp_table_link archive_comment_button" %> - <% end%> - <%end%> - -- <%= render :partial => "view_note", locals: {note: latest_note} %> - --<%end%> - -<%notes.order("updated_at DESC").each do |com|%> - -- <%= render :partial => "view_note", locals: {note: com} %> - -- - -- <%= render :partial => "edit_note", locals: {note: com} %> - -- - -- <%= render :partial => "archive_note", locals: {note: com} %> - -- - <%end%> diff --git a/app/views/plans/_note.html.erb b/app/views/plans/_note.html.erb deleted file mode 100644 index a6ed343..0000000 --- a/app/views/plans/_note.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - - - - -<% @notes = Note.where("question_id = ? AND plan_id = ?", questionId, plan_id) %> -<%= hidden_field_tag :question_id, questionId, :class => "question_id" %> - -<% if @notes.count > 0 then%> - -- <%= link_to t("helpers.comments.add_comment_label"),'#', :class => "btn btn-primary add_comment_button" %> - ---- - <%= render :partial => "list_notes", locals: {notes: @notes}%> --- -- <%= link_to t("helpers.comments.add_comment_label"),'#', :class => "btn btn-primary add_comment_button" %> ---- -- <%= render :partial => "add_note", locals: {questionId: questionId, planId: plan_id}%> -- -<% else%> - <%= t("helpers.comments.add_comment_text")%> - <%= render :partial => "add_note", locals: {questionId: questionId, planId: plan_id}%> -<% end%> diff --git a/app/views/plans/_plan_details.html.erb b/app/views/plans/_plan_details.html.erb new file mode 100644 index 0000000..7a1466b --- /dev/null +++ b/app/views/plans/_plan_details.html.erb @@ -0,0 +1,319 @@ + ++ + + + +diff --git a/app/views/plans/_plan_list_head.html.erb b/app/views/plans/_plan_list_head.html.erb new file mode 100644 index 0000000..c924411 --- /dev/null +++ b/app/views/plans/_plan_list_head.html.erb @@ -0,0 +1,6 @@ +"> + ++ + + +++ + ++ <%= raw t('helpers.project.project_details_editing_text_html')%> +
++ + <%= semantic_form_for @plan, :url => {:controller => :plans, :action => :update }, :html=>{:method=>:put} do |f| %> + <%= f.inputs do %> ++ + ++ <% end %> + + <%= f.actions do %> ++
++ +<%= t('helpers.project.project_name') %> ++ <%= f.text_field :title, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_name_help_text') %> + ++ +<%= t('helpers.project.project_identifier') %> ++ <%= f.text_field :identifier, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_identifier_help_text') %> + ++ +<%= t('helpers.project.grant_title') %> ++ <%= f.text_field :grant_number, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.grant_help_text') %> + ++ +<%= t('helpers.project.principal_investigator') %> ++ <%= f.text_field :principal_investigator, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.principal_investigator_help_text') %> + ++ +<%= t('helpers.project.principal_investigator_id') %> ++ <%= f.text_field :principal_investigator_identifier, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.principal_investigator_id_help_text') %> + ++ +<%= t('helpers.project.project_data_contact') %> ++ <%= f.text_field :data_contact, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('helpers.project.project_data_contact_help_text') %> + ++ +<%= t('helpers.desc') %> ++ <%= f.text_area :description, { :rows => 7, :class => 'text_area has-tooltip', 'data-toggle' => "tooltip", 'data-html' => "true", 'title'=> t('helpers.project.project_desc_help_text_html')} %> + ++ <%= f.submit t("helpers.submit.save"), :class => 'btn btn-primary' %> + <%= t("helpers.links.cancel") %> ++ <%end%> + <%end%> +"> ++ + + +++ + + + + +<%= t('helpers.project.project_details_text_html')%>
++++
++ + +<%= t('helpers.project.project_name') %> +<%= @plan.title %> ++ + +<%= t('helpers.project.project_identifier') %> ++ <% if !@plan.identifier.nil? && @plan.identifier != "" then %> + <%= @plan.identifier %> + <%else%> + - + <%end%> + ++ +<%= t('helpers.project.grant_title') %> ++ <% if !@plan.grant_number.nil? && @plan.grant_number!= "" then %> + <%= @plan.grant_number %> + <%else%> + - + <%end%> + ++ + <% if !@plan.principal_investigator_identifier.nil? && @plan.principal_investigator_identifier != "" then %> +<%= t('helpers.project.principal_investigator') %> +<% if !@plan.principal_investigator.nil? && @plan.principal_investigator != "" then %> + <%= @plan.principal_investigator %> + <%else%> + - + <%end%> + ++ + <%end%> +<%= t('helpers.project.principal_investigator_id') %> ++ <%= @plan.principal_investigator_identifier %> + ++ +<%= t('helpers.project.project_data_contact') %> +<% if !@plan.data_contact.nil? && @plan.data_contact != "" then%> + <%= @plan.data_contact %> + <%else%> + - + <%end%> + ++ +<%= t('helpers.desc') %> +<% if !@plan.description.nil? && @plan.description != "" then%> + <%= @plan.description %> + <%else%> + - + <%end%> + +++ + + ++ +++++ <%= semantic_form_for @plan, :url => {:controller => :plans, :action => :update_guidance_choices }, :html=>{:method=>:put}, :remote => true do |f| %> + <%= f.inputs do %> + <%= f.input :plan_guidance_groups, + :as => :check_boxes, + :collection => selected_guidance_groups %> + <% end %> + + <%= f.actions do %> +++ <%= f.submit t("helpers.submit.save"), :class => 'btn btn-primary' %> + <%= t("helpers.links.cancel") %> ++ <%end%> + <%end%> +<%= t('helpers.project.project_static_info')%>
+ ++ + <%if @plan_data["template"]["org"]["name"].present? %> +
+ + + + + <% phases = @plan_data["template"]["phases"] %> + <% if phases.any? %> + <% if phases.count == 1 then %> + <% phases.each do |phase| %> + ++ + <%end%> + <%if @plan_data["template"]["customization_of"].present? %> + <%= " (Customised from " + @plan_data["template"]["customization_of"]["org"]["name"] + ")" %> + <%end%> +<%= constant("organisation_types.funder") %> +<%= @plan_data["template"]["org"]["name"] %> ++ <%= link_to t('helpers.answer_questions'), edit_plan_path(plan), :class => 'btn btn-primary' %> + <%= t('helpers.export') %> ++ <%= render :partial => "plans/export", locals: {plan: plan, plan_data: plan_data} %> + +<%= raw phase["description"] %>
+ <% if phase["sections"].any? %> ++ +
+ <%end%> + <%end%> + <%else%> ++ + + + <% phase["sections"].each do |section| %> +<%= t('helpers.sections_label')%> +<%= t('helpers.questions_label')%> ++ + <%end%> + ++ +<%= section["title"] %>
++ <% if section["questions"].any? %> + +-
+ <% section["questions"].each do |ques|%>
+
- + <%= raw ques["text"] %> + + <%end%> +
+ <%= raw plan_data["template"]["description"] %> ++ <% phases.each do |phase| %> +++ <%end%> + <%end%> + <%end%> ++ ++" class="accordion-project collapse"> +++++ <%= link_to t('helpers.answer_questions'), edit_plan_path(plan), :class => 'btn btn-primary' %> + -export-dialog" data-toggle="modal" class='btn btn-primary'><%= t('helpers.export') %> ++ <%= render :partial => "plans/export", locals: {plan: plan, plan_data: plan_data} %> + +<%= raw phase["description"] %> +
+ + <% if phase["sections"].any? %> ++ +
+ <%end%> ++ + + + <% phase["sections"].each do |section| %> +<%= t('helpers.sections_label')%> +<%= t('helpers.questions_label')%> ++ + <%end%> + ++ +<%= section["title"] %>
++ <% if section["questions"].any? %> + +-
+ <% section["questions"].each do |ques|%>
+
- + - <%= raw ques["text"] %> + + <%end%> +
+ <% @selected_columns.each do |column| %> + <%= plan_list_column_heading(column) %> + <% end %> + diff --git a/app/views/plans/_plan_list_item.html.erb b/app/views/plans/_plan_list_item.html.erb new file mode 100644 index 0000000..5014813 --- /dev/null +++ b/app/views/plans/_plan_list_item.html.erb @@ -0,0 +1,27 @@ +<%= t("helpers.select_action")%> ++ <% @selected_columns.each do |column| %> + <%= plan_list_column_body(column, plan) %> + <% end %> + diff --git a/app/views/plans/_plan_nav_tabs.html.erb b/app/views/plans/_plan_nav_tabs.html.erb new file mode 100644 index 0000000..77633b0 --- /dev/null +++ b/app/views/plans/_plan_nav_tabs.html.erb @@ -0,0 +1,38 @@ + ++ <% if plan.editable_by?(current_user.id) then %> + <%= link_to t(".edit", :default => t("helpers.links.edit")), plan_path(plan), :class => "dmp_table_link"%> + + <% if plan.administerable_by?(current_user.id) then %> + <%= link_to t("helpers.project.share.tab_share"), share_plan_path(plan), :class => "dmp_table_link"%> + <% end %> + + <%= link_to t("helpers.project.tab_export"), export_plan_path(plan), :class => "dmp_table_link"%> + + <% if plan.administerable_by?(current_user.id) then %> + <%= link_to t(".destroy", :default => t("helpers.links.destroy")), plan_path(plan), :class => "dmp_table_link", + :method => :delete, :data => { + :confirm => t("helpers.project.confirm_delete_text") + }%> + <% end %> + <% else %> + <%= link_to t(".view", :default => t("helpers.view")), plan_path(plan), :class => "dmp_table_link"%> + <%= link_to t("helpers.project.tab_export"), export_plan_path(plan), :class => "dmp_table_link"%> + <% end %> + + ++diff --git a/app/views/plans/_plan_title.html.erb b/app/views/plans/_plan_title.html.erb new file mode 100644 index 0000000..d134aa1 --- /dev/null +++ b/app/views/plans/_plan_title.html.erb @@ -0,0 +1,8 @@ + +-
+
+
+
- > + <%= link_to t("helpers.project.tab_plan"), "/plans/" + plan_data["id"].to_s %> + + + + <% plan_data["template"]["phases"].each do |phase| %> +
- > + <%= link_to phase["title"], "/plans/" + plan_data["id"].to_s + "/phases/" + phase["id"].to_s + "/edit" %> + + <% end %> + + + <% if @plan.administerable_by?(current_user.id) then %> + <% if active == "share" %> +
- + <% else %> +
- + <% end %> + <%= link_to t("helpers.project.share.tab_share"), ["share", plan] %> + + <% end %> + + + <% if active == "export" then %> +
- + <% else %> +
- + <% end %> + <%= link_to t("helpers.project.tab_export"), ["export",plan] %> + + +
+diff --git a/app/views/plans/_toolbar.html.erb b/app/views/plans/_toolbar.html.erb new file mode 100644 index 0000000..07ad94a --- /dev/null +++ b/app/views/plans/_toolbar.html.erb @@ -0,0 +1,12 @@ ++++ <%= plan.title %> +
++ + + + +diff --git a/app/views/plans/_view_note.html.erb b/app/views/plans/_view_note.html.erb deleted file mode 100644 index 6b7737f..0000000 --- a/app/views/plans/_view_note.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - -<% user = User.find(note.user_id) %> ----diff --git a/app/views/plans/create.html.erb b/app/views/plans/create.html.erb new file mode 100644 index 0000000..b1ef328 --- /dev/null +++ b/app/views/plans/create.html.erb @@ -0,0 +1,14 @@ + +-
-
<%= t("helpers.comments.commented_by")%>
- - <%= user.name%> (<%= l note.updated_at, format: :custom %>) -
- <%= raw note.text %> -
+ ++ + diff --git a/app/views/plans/edit.html.erb b/app/views/plans/edit.html.erb index 0bd9403..bd3de93 100644 --- a/app/views/plans/edit.html.erb +++ b/app/views/plans/edit.html.erb @@ -1,16 +1,19 @@ <%- model_class = Plan -%> <% javascript "plans.js" %> - + -<%= render :partial => "/projects/project_title", locals: {project: @plan.project} %> +<%= render :partial => "plan_title", locals: {plan: @plan} %> <% status = @plan.status %>Choose one of these templates
+ +<%= debug @templates %> + +<% @templates.each do |t| %> +<%= t %> +<% end %> + +
<%space_used = status["space_used"].to_i - space_title = t("helpers.plan.export.space_used", space_used: space_used, num_pages: @plan.dmptemplate.settings(:export).max_pages) + space_title = t("helpers.plan.export.space_used", space_used: space_used, num_pages: @plan.template.settings(:export).max_pages) answered = %(#{status["num_answers"]}/#{status["num_questions"]})%>-<% readonly = nil %> -<% if ! @plan.editable_by(current_user.id) then %> - <% readonly = "always" %> -<% end %> - - -<%= render :partial => "/projects/project_nav_tabs", locals: {project: @plan.project, active: @plan.id} %> + +<%= render :partial => "plan_nav_tabs", locals: {plan: @plan, active: @phase.id } %> - +<%= answered -%> <%= t("helpers.project.questions_answered")%> @@ -23,27 +26,18 @@+ +- <% sections = @plan.sections %> + <% sections = @phase.sections %> <% sections.each do |section| %> - <% locked = @plan.locked(section.id, current_user.id) %> - <% if readonly == nil && locked["locked"] then %> - <% readonly = "conditional" %> - <% end %> <% if session[:question_id_comments].to_i != 0 then %> @@ -56,59 +50,78 @@+ +- <% num_section_questions = @plan.status["sections"][section.id]["num_questions"] %> - <% num_section_answers = @plan.status["sections"][section.id]["num_answers"] %> + + + <% num_section_questions = @section.status["sections"][section.id]["num_questions"] %> + <% num_section_answers = @section.status["sections"][section.id]["num_answers"] %> <% question_word = "questions" %> <% if num_section_questions == 1 then %> <% question_word = "question" %> <% end %> <% section_status = "#{num_section_questions} #{question_word}, #{num_section_answers} answered" %> + + + + -+- <%= raw section.description %> -+ <%= raw section.description %> ++ +- + <% section.questions.order("number").each do |question| %> + <% if question.id == session[:question_id_comments].to_i then id_css = "current_question" end %> +-<%= t ('helpers.loading')%>
+--<%= t ('helpers.saving')%>
+-+ +<%= t ('helpers.removing')%>
--style="display:none"<% end %>> - <% if locked["locked"] then %> -- <% section.questions.order("number").each do |question| %> - <% if question.id == session[:question_id_comments].to_i then id_css = "current_question" end %> -<%= t("helpers.project.share.locked_section_text")%><%= locked["locked_by"] %>
- <% end %> -- <%= render partial: "answer_form", locals: {question: question, readonly: readonly, last_question_id: section.questions.order("number DESC").first.id} %> -- <% end %> -+ <% partialname = "answer_form" + if @readonly + partialname += "_ro" + end + %> + + <%= render partial: partialname, + locals: { + plan: @plan, + question: question, + last_question_id: section.questions.order("number DESC").first.id + } + %> ++ <% end %> +
-
<% if user_signed_in? %>