diff --git a/app/controllers/org_admin/templates_controller.rb b/app/controllers/org_admin/templates_controller.rb index 56ff633..61a2238 100644 --- a/app/controllers/org_admin/templates_controller.rb +++ b/app/controllers/org_admin/templates_controller.rb @@ -300,11 +300,14 @@ end end end - + # If the no funder was specified OR the funder matches the org if funder_id.blank? || funder_id == org_id # Retrieve the Org's templates - templates << Template.published.organisationally_visible.where(org_id: org_id, customization_of: nil).to_a + templates << Template.published.organisationally_visible.where(org_id: org_id).to_a.map do |template| + template.title = "#{template.title} (#{d_('dmpopidor', 'Customized by ')} #{Org.find(org_id).name})" if template.customization_of + template + end end templates = templates.flatten.uniq end @@ -319,7 +322,7 @@ end templates = (templates.count > 0 ? templates.sort{|x,y| x.title <=> y.title} : []) - render json: {"templates": templates.collect{|t| {id: t.id, title: t.title} }}.to_json + render json: {"templates": templates.collect{|t| { id: t.id, title: t.title, default: t.is_default } }}.to_json end diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 30a8b2b..eb62e10 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -30,6 +30,9 @@ # Get the current user's org @default_org = current_user.org if @orgs.include?(current_user.org) + # Get the default template + @default_template = Template.default + flash[:notice] = "#{_('This is a')} #{_('test plan')}" if params[:test] @is_test = params[:test] ||= false respond_to :html diff --git a/app/views/branded/plans/new.html.erb b/app/views/branded/plans/new.html.erb deleted file mode 100644 index 5a28baa..0000000 --- a/app/views/branded/plans/new.html.erb +++ /dev/null @@ -1,96 +0,0 @@ -<% title _('Create a new plan') %> -
- <%= d_('dmpopidor', 'Several template types are available:') %> -
+ <%= _("Before you get started, we need some information about your research project to set you up with the best DMP template for your needs.") %> +
+- <%= _("Before you get started, we need some information about your research project to set you up with the best DMP template for your needs.") %> -
-