diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 7d3cd05..82e00b4 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -197,10 +197,6 @@ break random unless Template.exists?(dmptemplate_id: random) end authorize @template - - # Auto create a default phase - @template.phases << Phase.new({number: 1, title: "#{_('Phase')} 1", modifiable: true}) - if @template.save! redirect_to admin_template_template_path(@template), notice: _('Information was successfully created.') else diff --git a/app/views/templates/_admin_nav_tabs.html.erb b/app/views/templates/_admin_nav_tabs.html.erb index 94e5feb..79b61df 100644 --- a/app/views/templates/_admin_nav_tabs.html.erb +++ b/app/views/templates/_admin_nav_tabs.html.erb @@ -19,7 +19,10 @@ <% end %> - <% if current_user.can_org_admin? && (template.org.funder? || current_user.org.funder?) %> + <% if current_user.can_org_admin? && + (template.org.funder? || + current_user.org.funder? || + (template.org == current_user.org)) %> <% if active == 'add_plan' %>
  • <% else %>