diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index a687531..3dea892 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -33,7 +33,7 @@ @plan = Plan.new authorize @plan - @plan.principal_investigator = current_user.name + @plan.principal_investigator = current_user.surname.blank? ? nil : "#{current_user.firstname} #{current_user.surname}" @plan.data_contact = current_user.email @plan.funder_name = plan_params[:funder_name] @@ -80,7 +80,7 @@ flash[:notice] = msg respond_to do |format| - format.js { render js: "window.location='#{plan_url(@plan)}'" } + format.js { render js: "window.location='#{plan_url(@plan)}?editing=true'" } end else @@ -102,7 +102,7 @@ @editing = (!params[:editing].nil? && @plan.administerable_by?(current_user.id)) @all_guidance_groups = @plan.get_guidance_group_options @selected_guidance_groups = @plan.guidance_groups.pluck(:id) - @based_on = @plan.base_template + @based_on = (@plan.template.customization_of.nil? ? @plan.template : Template.live(@plan.template.customization_of)) respond_to :html end diff --git a/app/views/plans/_available_templates.html.erb b/app/views/plans/_available_templates.html.erb index 72c8089..7e1a18f 100644 --- a/app/views/plans/_available_templates.html.erb +++ b/app/views/plans/_available_templates.html.erb @@ -1,6 +1,6 @@ -

<%= _('Which DMP template would you like to use?') %>

+<%= _('Which DMP template would you like to use?') %> -