Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Toggle template button in settings

Oliver Günther1d36257ec6b7
diff --git a/app/views/projects/_edit.html.erb b/app/views/projects/_edit.html.erb
index f665f2de3da..3d666a525fa 100644
--- a/app/views/projects/_edit.html.erb
+++ b/app/views/projects/_edit.html.erb
@@ -58,18 +58,17 @@ See docs/COPYRIGHT.rdoc for more details.
<span class="button--text"><%= t(:label_archive_project) %></span>
<% end %>
</li>
- <% unless @project.templated? %>
<li class="toolbar-item hidden-for-mobile">
<%= form_for(@project,
html: { class: 'toolbar-item'},
url: project_path(@project),
method: :patch) do |f| %>
- <%= f.hidden_field :templated, value: true %>
- <button class="button" title="<%= t('project.template.make_template') %>">
- <%= op_icon('button--icon icon-duplicate') %>
- <span class="button--text"><%= t('project.template.make_template') %></span>
+ <%= f.hidden_field :templated, value: [email protected] %>
+ <% label = @project.templated ? 'remove_from_templates' : 'make_template' %>
+ <button class="button" title="<%= t("project.template.#{label}") %>">
+ <%= op_icon('button--icon icon-duplicate') unless @project.templated %>
+ <span class="button--text"><%= t("project.template.#{label}") %></span>
</button>
- <% end %>
</li>
<% end %>
<li class="toolbar-item">
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c183b8ecc8e..c565fef8200 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2011,6 +2011,7 @@ en:
You will be notified by mail as soon as the project is available.
use_template: 'Use template'
make_template: 'Set as template'
+ remove_from_templates: 'Remove from templates'
archive:
are_you_sure: "Are you sure you want to archive the project '%{name}'?"
archived: "Archived"