diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-11 10:26:12 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-11 10:26:12 +0000 |
commit | 0471de41ff4828345ca0afa393f4b8f3bf0098d2 (patch) | |
tree | ba8c101be1d1d5adda486d06f32836d5ed59e041 /app/views/enumerations | |
parent | 1ad16c2238be1b1e0cc29435203b8fd8c233a85c (diff) | |
download | redmine-0471de41ff4828345ca0afa393f4b8f3bf0098d2.tar.gz redmine-0471de41ff4828345ca0afa393f4b8f3bf0098d2.zip |
Resourcified enumerations.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8189 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/enumerations')
-rw-r--r-- | app/views/enumerations/_form.html.erb | 22 | ||||
-rw-r--r-- | app/views/enumerations/destroy.html.erb | 4 | ||||
-rw-r--r-- | app/views/enumerations/edit.html.erb | 6 | ||||
-rw-r--r-- | app/views/enumerations/index.html.erb | 10 | ||||
-rw-r--r-- | app/views/enumerations/new.html.erb | 7 |
5 files changed, 21 insertions, 28 deletions
diff --git a/app/views/enumerations/_form.html.erb b/app/views/enumerations/_form.html.erb index 591209da9..8ff774d9d 100644 --- a/app/views/enumerations/_form.html.erb +++ b/app/views/enumerations/_form.html.erb @@ -1,19 +1,11 @@ <%= error_messages_for 'enumeration' %> -<div class="box"> -<!--[form:optvalue]--> -<%= hidden_field 'enumeration', 'type' %> -<p><label for="enumeration_name"><%=l(:field_name)%></label> -<%= text_field 'enumeration', 'name' %></p> +<div class="box tabular"> + <p><%= f.text_field :name %></p> + <p><%= f.check_box :active %></p> + <p><%= f.check_box :is_default %></p> -<p><label for="enumeration_active"><%=l(:field_active)%></label> -<%= check_box 'enumeration', 'active' %></p> - -<p><label for="enumeration_is_default"><%=l(:field_is_default)%></label> -<%= check_box 'enumeration', 'is_default' %></p> -<!--[eoform:optvalue]--> - -<% @enumeration.custom_field_values.each do |value| %> - <p><%= custom_field_tag_with_label :enumeration, value %></p> -<% end %> + <% @enumeration.custom_field_values.each do |value| %> + <p><%= custom_field_tag_with_label :enumeration, value %></p> + <% end %> </div> diff --git a/app/views/enumerations/destroy.html.erb b/app/views/enumerations/destroy.html.erb index b77fff66e..4fca33d4a 100644 --- a/app/views/enumerations/destroy.html.erb +++ b/app/views/enumerations/destroy.html.erb @@ -1,6 +1,6 @@ <h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2> -<% form_tag({}) do %> +<% form_tag({}, :method => :delete) do %> <div class="box"> <p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p> <p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label> @@ -8,5 +8,5 @@ </div> <%= submit_tag l(:button_apply) %> -<%= link_to l(:button_cancel), :controller => 'enumerations', :action => 'index' %> +<%= link_to l(:button_cancel), enumerations_path %> <% end %> diff --git a/app/views/enumerations/edit.html.erb b/app/views/enumerations/edit.html.erb index f5caec1e8..c46a7606f 100644 --- a/app/views/enumerations/edit.html.erb +++ b/app/views/enumerations/edit.html.erb @@ -1,6 +1,6 @@ -<h2><%= link_to l(@enumeration.option_name), :controller => 'enumerations', :action => 'index' %> » <%=h @enumeration %></h2> +<h2><%= link_to l(@enumeration.option_name), enumerations_path %> » <%=h @enumeration %></h2> -<% form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") do %> - <%= render :partial => 'form' %> +<% labelled_form_for :enumeration, @enumeration, :url => enumeration_path(@enumeration), :html => {:method => :put} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/enumerations/index.html.erb b/app/views/enumerations/index.html.erb index 80f7ef3dc..d7522bc93 100644 --- a/app/views/enumerations/index.html.erb +++ b/app/views/enumerations/index.html.erb @@ -15,13 +15,13 @@ </tr></thead> <% enumerations.each do |enumeration| %> <tr class="<%= cycle('odd', 'even') %>"> - <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td> + <td><%= link_to h(enumeration), edit_enumeration_path(enumeration) %></td> <td class="center" style="width:15%;"><%= checked_image enumeration.is_default? %></td> <td class="center" style="width:15%;"><%= checked_image enumeration.active? %></td> - <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td> + <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}, :put) %></td> <td class="buttons"> - <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, - :method => :post, + <%= link_to l(:button_delete), enumeration_path(enumeration), + :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del' %> </td> @@ -31,7 +31,7 @@ <% reset_cycle %> <% end %> -<p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p> +<p><%= link_to l(:label_enumeration_new), new_enumeration_path(:type => klass.name) %></p> <% end %> <% html_title(l(:label_enumerations)) -%> diff --git a/app/views/enumerations/new.html.erb b/app/views/enumerations/new.html.erb index 34882834a..f0e6bd343 100644 --- a/app/views/enumerations/new.html.erb +++ b/app/views/enumerations/new.html.erb @@ -1,6 +1,7 @@ -<h2><%= link_to l(@enumeration.option_name), :controller => 'enumerations', :action => 'index' %> » <%=l(:label_enumeration_new)%></h2> +<h2><%= link_to l(@enumeration.option_name), enumerations_path %> » <%=l(:label_enumeration_new)%></h2> -<% form_tag({:action => 'create'}, :class => "tabular") do %> - <%= render :partial => 'form' %> +<% labelled_form_for :enumeration, @enumeration, :url => enumerations_path do |f| %> + <%= f.hidden_field :type %> + <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_create) %> <% end %> |