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

[31200] Allow deletion of colors

Oliver Günther2ae00dc16995
diff --git a/app/views/colors/_form.html.erb b/app/views/colors/_form.html.erb
index 18190d1e989..9cd3caae243 100644
--- a/app/views/colors/_form.html.erb
+++ b/app/views/colors/_form.html.erb
@@ -29,7 +29,19 @@ See docs/COPYRIGHT.rdoc for more details.
<%= error_messages_for 'color' %>
-<%= toolbar title: (color.new_record? ? t('timelines.new_color') : t('timelines.edit_color')) %>
+<%= toolbar title: (color.new_record? ? t('timelines.new_color') : t('timelines.edit_color')) do %>
+ <% if color.persisted? %>
+ <li class="toolbar-item">
+ <%= link_to color_path(color),
+ method: :delete,
+ data: { confirm: t('text_are_you_sure') },
+ class: "button -danger" do %>
+ <%= op_icon 'button--icon icon-delete' %>
+ <span class="button--text"><%= t :button_delete %></span>
+ <% end %>
+ </li>
+ <% end %>
+<% end %>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= t('timelines.properties') %></legend>