From 805864590a4988ae457b0e5d4196f11065abdb9b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 26 Mar 2008 18:49:12 +0000 Subject: Do not use javascript to hide tabs content on page loading and make tabs work with javascript disabled. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1293 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/custom_fields/list.rhtml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'app/views/custom_fields') diff --git a/app/views/custom_fields/list.rhtml b/app/views/custom_fields/list.rhtml index 4fd381a17..43ddd99c8 100644 --- a/app/views/custom_fields/list.rhtml +++ b/app/views/custom_fields/list.rhtml @@ -1,21 +1,26 @@

<%=l(:label_custom_field_plural)%>

+<% selected_tab = params[:tab] ? params[:tab].to_s : custom_fields_tabs.first[:name] %> +
-<% %w(IssueCustomField ProjectCustomField UserCustomField).each do |type| %> -
+<% custom_fields_tabs.each do |tab| %> +
- <% if type == 'IssueCustomField' %> + <% if tab[:name] == 'IssueCustomField' %> <% end %> @@ -23,12 +28,12 @@ -<% for custom_field in (@custom_fields_by_type[type] || []).sort %> +<% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%> "> - <% if type == 'IssueCustomField' %> + <% if tab[:name] == 'IssueCustomField' %> <% end %> @@ -45,11 +50,9 @@ <% end; reset_cycle %>
<%=l(:field_name)%> <%=l(:field_field_format)%> <%=l(:field_is_required)%><%=l(:field_is_for_all)%> <%=l(:label_used_by)%>
<%= 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? %> <%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %>
-
-<%= link_to l(:label_custom_field_new), {:action => 'new', :type => type}, :class => 'icon icon-add' %> + +

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

<% end %> -<%= javascript_tag "showTab('#{@tab}');" %> - <% html_title(l(:label_custom_field_plural)) -%> -- cgit v1.2.3