diff --git a/app/controllers/answers_controller.rb b/app/controllers/answers_controller.rb index 9c9f70e..13b475e 100644 --- a/app/controllers/answers_controller.rb +++ b/app/controllers/answers_controller.rb @@ -58,6 +58,7 @@ }).find(p_params[:plan_id]) @question = @answer.question @section = @plan.get_section(@question.section_id) + template = @section.phase.template render json: { "question" => { @@ -66,7 +67,7 @@ "locking" => @stale_answer ? render_to_string(partial: 'answers/locking', locals: { question: @question, answer: @stale_answer, user: @answer.user }, formats: [:html]) : nil, - "form" => render_to_string(partial: 'answers/new_edit', locals: { question: @question, answer: @answer, readonly: false, locking: false }, formats: [:html]), + "form" => render_to_string(partial: 'answers/new_edit', locals: { template: template, question: @question, answer: @answer, readonly: false, locking: false }, formats: [:html]), "answer_status" => render_to_string(partial: 'answers/status', locals: { answer: @answer}, formats: [:html]) }, "section" => { diff --git a/app/views/annotations/_show.html.erb b/app/views/annotations/_show.html.erb index b5085f4..407928a 100644 --- a/app/views/annotations/_show.html.erb +++ b/app/views/annotations/_show.html.erb @@ -1,12 +1,8 @@ <% org = template.org.abbreviation.present? ? template.org.abbreviation : template.org.name %> -<% if example_answer.present? || guidance.present? %> +<% if guidance.present? %>
<%= _('The following answer cannot be saved') %>
- <%= render partial: '/answers/new_edit', locals: { question: question, answer: answer, readonly: true, locking: true } %> + <%# We do not need to re-show example answers in this lock conflict section so leave template nil %> + <%= render partial: '/answers/new_edit', locals: { template: nil, question: question, answer: answer, readonly: true, locking: true } %><%= _('since %{name} saved the answer below while you were editing. Please, combine your changes and then save the answer again.') % { name: user.name} %>