diff --git a/app/controllers/answers_controller.rb b/app/controllers/answers_controller.rb index b590d41..c60fbd3 100644 --- a/app/controllers/answers_controller.rb +++ b/app/controllers/answers_controller.rb @@ -23,6 +23,7 @@ if @answer.nil? @answer = Answer.new(params[:answer]) + @answer.text = params["answer-text-#{@answer.question_id}".to_sym] authorize @answer @answer.save else diff --git a/app/views/answers/update.js.erb b/app/views/answers/update.js.erb index 1ffdc73..781c176 100644 --- a/app/views/answers/update.js.erb +++ b/app/views/answers/update.js.erb @@ -19,4 +19,4 @@ // so that the next save can work. If you don't do // this it will fail forever. -$("#answer_lock_version").val(<%= @lock_version %>); +$("#answer_lock_version-<%=@question.id%>").val(<%= @lock_version %>); diff --git a/app/views/phases/_answer_form.html.erb b/app/views/phases/_answer_form.html.erb index 763735b..90880c5 100644 --- a/app/views/phases/_answer_form.html.erb +++ b/app/views/phases/_answer_form.html.erb @@ -19,12 +19,12 @@ %>
- <%= semantic_form_for answer, :url => {:controller => :answers, :action => :update }, :remote => true do |f| %> + <%= semantic_form_for answer, :url => {:controller => :answers, :action => :update }, method: "put", :remote => true do |f| %> <%= f.inputs do %> <%= f.input :plan_id, :as => :hidden, :input_html => { :value => @plan.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" } %> - <%= f.hidden_field :lock_version %> + <%= f.hidden_field :lock_version, id: "answer_lock_version-#{question_id}" %> @@ -107,7 +107,7 @@ <% if answer.nil? || answer.created_at.nil? %> <%= _('Not answered yet') %> <% else %> - <%= _('Answered')%><%= answer.created_at %><%= _(' by')%><%= answer.user.name %> + <%= _('Answered')%> <%= answer.created_at %><%= _(' by')%> <%= answer.user.name %> <% end %>
diff --git a/app/views/plans/_plan_details.html.erb b/app/views/plans/_plan_details.html.erb index 98e6fd5..dc4bdb2 100644 --- a/app/views/plans/_plan_details.html.erb +++ b/app/views/plans/_plan_details.html.erb @@ -205,7 +205,8 @@ <%end%> <%if plan.template.customization_of.present? %> - <%= " (Customised from " + plan.template.customization_of.org.name + ")" %> + <% ctemplate = Template.find(plan.template.customization_of) %> + <%= " (Customised from " + ctemplate.org.name + ")" %> <%end%> diff --git a/lib/assets/javascripts/plans.js b/lib/assets/javascripts/plans.js index 89ac3d6..3289dae 100644 --- a/lib/assets/javascripts/plans.js +++ b/lib/assets/javascripts/plans.js @@ -383,7 +383,7 @@ timestamp = new Date(Number(timestamp) * 1000); if (timestamp.getTime() != current_timestamp.getTime()) { q_status.text(""); - q_status.append(I18n.t("helpers.answered_by") + " " + I18n.t("helpers.answered_by_part2") + " " + data.questions[question_id]["answered_by"]); + q_status.append( "Answered" + " " + "by" + " " + data.questions[question_id]["answered_by"]); t = q_status.children("abbr:first"); // Update label to indicate successful submission q_status.removeClass("label-info label-warning");