diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-17 19:10:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-17 19:10:54 +0000 |
commit | 3c95f761e610a1d5957ca9f96708958ba80565ab (patch) | |
tree | 37efaadcfb59ffb57a003d8115c7528b21118de9 /app/views/enumerations | |
parent | f4e0c77c8357958e713466c000e135e321600249 (diff) | |
download | redmine-3c95f761e610a1d5957ca9f96708958ba80565ab.tar.gz redmine-3c95f761e610a1d5957ca9f96708958ba80565ab.zip |
Ability to remove enumerations (activities, priorities, document categories) that are in use. Associated objects can be reassigned to another value (#1467).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1558 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/enumerations')
-rw-r--r-- | app/views/enumerations/destroy.rhtml | 12 | ||||
-rw-r--r-- | app/views/enumerations/list.rhtml | 7 |
2 files changed, 17 insertions, 2 deletions
diff --git a/app/views/enumerations/destroy.rhtml b/app/views/enumerations/destroy.rhtml new file mode 100644 index 000000000..657df8322 --- /dev/null +++ b/app/views/enumerations/destroy.rhtml @@ -0,0 +1,12 @@ +<h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2> + +<% form_tag({}) do %> +<div class="box"> +<p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p> +<p><%= l(:text_enumeration_category_reassign_to) %> +<%= select_tag 'reassign_to_id', ("<option>--- #{l(:actionview_instancetag_blank_option)} ---</option>" + options_from_collection_for_select(@enumerations, 'id', 'name')) %></p> +</div> + +<%= submit_tag l(:button_apply) %> +<%= link_to l(:button_cancel), :controller => 'enumerations', :action => 'index' %> +<% end %> diff --git a/app/views/enumerations/list.rhtml b/app/views/enumerations/list.rhtml index 1967e5cf9..7f3886b44 100644 --- a/app/views/enumerations/list.rhtml +++ b/app/views/enumerations/list.rhtml @@ -1,7 +1,7 @@ <h2><%=l(:label_enumerations)%></h2> -<% Enumeration::OPTIONS.each do |option, name| %> -<h3><%= l(name) %></h3> +<% Enumeration::OPTIONS.each do |option, params| %> +<h3><%= l(params[:label]) %></h3> <% enumerations = Enumeration.get_values(option) %> <% if enumerations.any? %> @@ -16,6 +16,9 @@ <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => enumeration, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %> <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => enumeration, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %> </td> + <td align="center" style="width:10%;"> + <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, :method => :post, :confirm => l(:text_are_you_sure), :class => "icon icon-del" %> + </td> </tr> <% end %> </table> |