From b127f9157d456f233b320b349b415844eb632cb9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 9 Dec 2011 22:58:30 +0000 Subject: Resourcified custom fields. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8144 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/custom_fields/_form.html.erb | 2 +- app/views/custom_fields/_index.html.erb | 8 ++++---- app/views/custom_fields/edit.html.erb | 2 +- app/views/custom_fields/new.html.erb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'app/views/custom_fields') diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb index 7432a426f..a5abb2031 100644 --- a/app/views/custom_fields/_form.html.erb +++ b/app/views/custom_fields/_form.html.erb @@ -81,7 +81,7 @@ function toggle_custom_field_format() { when "IssueCustomField" %>
<%=l(:label_tracker_plural)%> - <% for tracker in @trackers %> + <% Tracker.all.each do |tracker| %> <%= check_box_tag "custom_field[tracker_ids][]", tracker.id, (@custom_field.trackers.include? tracker), diff --git a/app/views/custom_fields/_index.html.erb b/app/views/custom_fields/_index.html.erb index ccbacde1d..1adbcaa08 100644 --- a/app/views/custom_fields/_index.html.erb +++ b/app/views/custom_fields/_index.html.erb @@ -13,7 +13,7 @@ <% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%> "> - <%= link_to h(custom_field.name), :action => 'edit', :id => custom_field %> + <%= link_to h(custom_field.name), edit_custom_field_path(custom_field) %> <%= l(Redmine::CustomFieldFormat.label_for(custom_field.field_format)) %> <%= checked_image custom_field.is_required? %> <% if tab[:name] == 'IssueCustomField' %> @@ -22,8 +22,8 @@ <% end %> <%= reorder_links('custom_field', {:action => 'edit', :id => custom_field}) %> - <%= link_to(l(:button_delete), { :action => 'destroy', :id => custom_field }, - :method => :post, + <%= link_to(l(:button_delete), custom_field_path(custom_field), + :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> @@ -32,4 +32,4 @@ -

<%= link_to l(:label_custom_field_new), {:action => 'new', :type => tab[:name]}, :class => 'icon icon-add' %>

+

<%= link_to l(:label_custom_field_new), new_custom_field_path(:type => tab[:name]), :class => 'icon icon-add' %>

diff --git a/app/views/custom_fields/edit.html.erb b/app/views/custom_fields/edit.html.erb index 51ac84fcf..62672ab20 100644 --- a/app/views/custom_fields/edit.html.erb +++ b/app/views/custom_fields/edit.html.erb @@ -2,7 +2,7 @@ » <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %> » <%=h @custom_field.name %> -<% labelled_form_for :custom_field, @custom_field, :url => { :action => "edit", :id => @custom_field } do |f| %> +<% labelled_form_for :custom_field, @custom_field, :url => custom_field_path(@custom_field), :html => {:method => :put} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/custom_fields/new.html.erb b/app/views/custom_fields/new.html.erb index a68cef5dd..4fcd160e4 100644 --- a/app/views/custom_fields/new.html.erb +++ b/app/views/custom_fields/new.html.erb @@ -2,7 +2,7 @@ » <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %> » <%= l(:label_custom_field_new) %> -<% labelled_form_for :custom_field, @custom_field, :url => { :action => "new" } do |f| %> +<% labelled_form_for :custom_field, @custom_field, :url => custom_fields_path do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= hidden_field_tag 'type', @custom_field.type %> <%= submit_tag l(:button_save) %> -- cgit v1.2.3