From ede9960444ed7c93e1561f004ee8682a0458f295 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 12 Sep 2009 09:13:13 +0000 Subject: Refactoring of tabs rendering. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2871 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/custom_fields/_index.rhtml | 32 +++++++++++++++++++++++ app/views/custom_fields/index.rhtml | 50 +----------------------------------- 2 files changed, 33 insertions(+), 49 deletions(-) create mode 100644 app/views/custom_fields/_index.rhtml (limited to 'app/views/custom_fields') diff --git a/app/views/custom_fields/_index.rhtml b/app/views/custom_fields/_index.rhtml new file mode 100644 index 000000000..1417dd4bb --- /dev/null +++ b/app/views/custom_fields/_index.rhtml @@ -0,0 +1,32 @@ + + + + + + <% if tab[:name] == 'IssueCustomField' %> + + + <% end %> + + + + + <% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%> + "> + + + + <% if tab[:name] == 'IssueCustomField' %> + + + <% end %> + + + + <% end; reset_cycle %> + +
<%=l(:field_name)%><%=l(:field_field_format)%><%=l(:field_is_required)%><%=l(:field_is_for_all)%><%=l(:label_used_by)%><%=l(:button_sort)%>
<%= link_to custom_field.name, :action => 'edit', :id => custom_field %><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %><%= image_tag 'true.png' if custom_field.is_required? %><%= image_tag 'true.png' if custom_field.is_for_all? %><%= l(:label_x_projects, :count => custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %><%= reorder_links('custom_field', {:action => 'edit', :id => custom_field}) %> + <%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %> +
+ +

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

diff --git a/app/views/custom_fields/index.rhtml b/app/views/custom_fields/index.rhtml index 999648f0e..7b29e25e7 100644 --- a/app/views/custom_fields/index.rhtml +++ b/app/views/custom_fields/index.rhtml @@ -1,53 +1,5 @@

<%=l(:label_custom_field_plural)%>

-<% selected_tab = params[:tab] ? params[:tab].to_s : custom_fields_tabs.first[:name] %> - -
- -
- -<% custom_fields_tabs.each do |tab| %> -
- - - - - - <% if tab[:name] == 'IssueCustomField' %> - - - <% end %> - - - - -<% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%> - "> - - - - <% if tab[:name] == 'IssueCustomField' %> - - - <% end %> - - - -<% end; reset_cycle %> - -
<%=l(:field_name)%><%=l(:field_field_format)%><%=l(:field_is_required)%><%=l(:field_is_for_all)%><%=l(:label_used_by)%><%=l(:button_sort)%>
<%= link_to custom_field.name, :action => 'edit', :id => custom_field %><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %><%= image_tag 'true.png' if custom_field.is_required? %><%= image_tag 'true.png' if custom_field.is_for_all? %><%= l(:label_x_projects, :count => custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %><%= reorder_links('custom_field', {:action => 'edit', :id => custom_field}) %> - <%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %> -
- -

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

-
-<% end %> +<%= render_tabs custom_fields_tabs %> <% html_title(l(:label_custom_field_plural)) -%> -- cgit v1.2.3