@@ -17,6 +17,13 | |||||
17 |
|
17 | |||
18 | module CustomFieldsHelper |
|
18 | module CustomFieldsHelper | |
19 |
|
19 | |||
|
20 | def custom_fields_tabs | |||
|
21 | tabs = [{:name => 'IssueCustomField', :label => :label_issue_plural}, | |||
|
22 | {:name => 'ProjectCustomField', :label => :label_project_plural}, | |||
|
23 | {:name => 'UserCustomField', :label => :label_user_plural} | |||
|
24 | ] | |||
|
25 | end | |||
|
26 | ||||
20 | # Return custom field html tag corresponding to its format |
|
27 | # Return custom field html tag corresponding to its format | |
21 | def custom_field_tag(custom_value) |
|
28 | def custom_field_tag(custom_value) | |
22 | custom_field = custom_value.custom_field |
|
29 | custom_field = custom_value.custom_field |
@@ -1,21 +1,26 | |||||
1 | <h2><%=l(:label_custom_field_plural)%></h2> |
|
1 | <h2><%=l(:label_custom_field_plural)%></h2> | |
2 |
|
2 | |||
|
3 | <% selected_tab = params[:tab] ? params[:tab].to_s : custom_fields_tabs.first[:name] %> | |||
|
4 | ||||
3 | <div class="tabs"> |
|
5 | <div class="tabs"> | |
4 | <ul> |
|
6 | <ul> | |
5 | <li><%= link_to l(:label_issue_plural), {}, :id=> "tab-IssueCustomField", :onclick => "showTab('IssueCustomField'); this.blur(); return false;" %></li> |
|
7 | <% custom_fields_tabs.each do |tab| -%> | |
6 | <li><%= link_to l(:label_project_plural), {}, :id=> "tab-ProjectCustomField", :onclick => "showTab('ProjectCustomField'); this.blur(); return false;" %></li> |
|
8 | <li><%= link_to l(tab[:label]), { :tab => tab[:name] }, | |
7 | <li><%= link_to l(:label_user_plural), {}, :id=> "tab-UserCustomField", :onclick => "showTab('UserCustomField'); this.blur(); return false;" %></li> |
|
9 | :id => "tab-#{tab[:name]}", | |
|
10 | :class => (tab[:name] != selected_tab ? nil : 'selected'), | |||
|
11 | :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> | |||
|
12 | <% end -%> | |||
8 | </ul> |
|
13 | </ul> | |
9 | </div> |
|
14 | </div> | |
10 |
|
15 | |||
11 | <% %w(IssueCustomField ProjectCustomField UserCustomField).each do |type| %> |
|
16 | <% custom_fields_tabs.each do |tab| %> | |
12 | <div id="tab-content-<%= type %>" class="tab-content"> |
|
17 | <div id="tab-content-<%= tab[:name] %>" class="tab-content" style="<%= tab[:name] != selected_tab ? 'display:none' : nil %>"> | |
13 | <table class="list"> |
|
18 | <table class="list"> | |
14 | <thead><tr> |
|
19 | <thead><tr> | |
15 | <th width="30%"><%=l(:field_name)%></th> |
|
20 | <th width="30%"><%=l(:field_name)%></th> | |
16 | <th><%=l(:field_field_format)%></th> |
|
21 | <th><%=l(:field_field_format)%></th> | |
17 | <th><%=l(:field_is_required)%></th> |
|
22 | <th><%=l(:field_is_required)%></th> | |
18 |
<% if t |
|
23 | <% if tab[:name] == 'IssueCustomField' %> | |
19 | <th><%=l(:field_is_for_all)%></th> |
|
24 | <th><%=l(:field_is_for_all)%></th> | |
20 | <th><%=l(:label_used_by)%></th> |
|
25 | <th><%=l(:label_used_by)%></th> | |
21 | <% end %> |
|
26 | <% end %> | |
@@ -23,12 +28,12 | |||||
23 | <th width="10%"></th> |
|
28 | <th width="10%"></th> | |
24 | </tr></thead> |
|
29 | </tr></thead> | |
25 | <tbody> |
|
30 | <tbody> | |
26 |
<% |
|
31 | <% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%> | |
27 | <tr class="<%= cycle("odd", "even") %>"> |
|
32 | <tr class="<%= cycle("odd", "even") %>"> | |
28 | <td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> |
|
33 | <td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> | |
29 | <td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td> |
|
34 | <td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td> | |
30 | <td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td> |
|
35 | <td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td> | |
31 |
<% if t |
|
36 | <% if tab[:name] == 'IssueCustomField' %> | |
32 | <td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td> |
|
37 | <td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td> | |
33 | <td align="center"><%= 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? %></td> |
|
38 | <td align="center"><%= 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? %></td> | |
34 | <% end %> |
|
39 | <% end %> | |
@@ -45,11 +50,9 | |||||
45 | <% end; reset_cycle %> |
|
50 | <% end; reset_cycle %> | |
46 | </tbody> |
|
51 | </tbody> | |
47 | </table> |
|
52 | </table> | |
48 | <br /> |
|
53 | ||
49 |
<%= link_to l(:label_custom_field_new), {:action => 'new', :type => t |
|
54 | <p><%= link_to l(:label_custom_field_new), {:action => 'new', :type => tab[:name]}, :class => 'icon icon-add' %></p> | |
50 | </div> |
|
55 | </div> | |
51 | <% end %> |
|
56 | <% end %> | |
52 |
|
57 | |||
53 | <%= javascript_tag "showTab('#{@tab}');" %> |
|
|||
54 |
|
||||
55 | <% html_title(l(:label_custom_field_plural)) -%> |
|
58 | <% html_title(l(:label_custom_field_plural)) -%> |
@@ -1,18 +1,24 | |||||
1 | <h2><%=l(:label_settings)%></h2> |
|
1 | <h2><%=l(:label_settings)%></h2> | |
2 |
|
2 | |||
|
3 | <% tabs = project_settings_tabs %> | |||
|
4 | <% selected_tab = params[:tab] ? params[:tab].to_s : tabs.first[:name] %> | |||
|
5 | ||||
3 | <div class="tabs"> |
|
6 | <div class="tabs"> | |
4 | <ul> |
|
7 | <ul> | |
5 |
<% |
|
8 | <% tabs.each do |tab| -%> | |
6 | <li><%= link_to l(tab[:label]), {}, :id => "tab-#{tab[:name]}", :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> |
|
9 | <li><%= link_to l(tab[:label]), { :tab => tab[:name] }, | |
7 | <% end %> |
|
10 | :id => "tab-#{tab[:name]}", | |
|
11 | :class => (tab[:name] != selected_tab ? nil : 'selected'), | |||
|
12 | :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> | |||
|
13 | <% end -%> | |||
8 | </ul> |
|
14 | </ul> | |
9 | </div> |
|
15 | </div> | |
10 |
|
16 | |||
11 |
<% |
|
17 | <% tabs.each do |tab| -%> | |
12 |
<%= content_tag('div', render(:partial => tab[:partial]), |
|
18 | <%= content_tag('div', render(:partial => tab[:partial]), | |
13 | <% end %> |
|
19 | :id => "tab-content-#{tab[:name]}", | |
14 |
|
20 | :style => (tab[:name] != selected_tab ? 'display:none' : nil), | ||
15 | <%= tab = params[:tab] ? h(params[:tab]) : project_settings_tabs.first[:name] |
|
21 | :class => 'tab-content') %> | |
16 | javascript_tag "showTab('#{tab}');" %> |
|
22 | <% end -%> | |
17 |
|
23 | |||
18 | <% html_title(l(:label_settings)) -%> |
|
24 | <% html_title(l(:label_settings)) -%> |
@@ -1,18 +1,23 | |||||
1 | <h2><%= l(:label_settings) %></h2> |
|
1 | <h2><%= l(:label_settings) %></h2> | |
2 |
|
2 | |||
|
3 | <% selected_tab = params[:tab] ? params[:tab].to_s : administration_settings_tabs.first[:name] %> | |||
|
4 | ||||
3 | <div class="tabs"> |
|
5 | <div class="tabs"> | |
4 |
|
|
6 | <ul> | |
5 |
|
|
7 | <% administration_settings_tabs.each do |tab| -%> | |
6 | <li><%= link_to l(tab[:label]), {}, :id => "tab-#{tab[:name]}", :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> |
|
8 | <li><%= link_to l(tab[:label]), { :tab => tab[:name] }, | |
7 | <% end -%> |
|
9 | :id => "tab-#{tab[:name]}", | |
8 | </ul> |
|
10 | :class => (tab[:name] != selected_tab ? nil : 'selected'), | |
|
11 | :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> | |||
|
12 | <% end -%> | |||
|
13 | </ul> | |||
9 | </div> |
|
14 | </div> | |
10 |
|
15 | |||
11 | <% administration_settings_tabs.each do |tab| %> |
|
16 | <% administration_settings_tabs.each do |tab| -%> | |
12 |
|
|
17 | <%= content_tag('div', render(:partial => tab[:partial]), | |
13 | <% end %> |
|
18 | :id => "tab-content-#{tab[:name]}", | |
14 |
|
19 | :style => (tab[:name] != selected_tab ? 'display:none' : nil), | ||
15 | <%= tab = params[:tab] ? h(params[:tab]) : administration_settings_tabs.first[:name] |
|
20 | :class => 'tab-content') %> | |
16 | javascript_tag "showTab('#{tab}');" %> |
|
21 | <% end -%> | |
17 |
|
22 | |||
18 | <% html_title(l(:label_settings), l(:label_administration)) -%> |
|
23 | <% html_title(l(:label_settings), l(:label_administration)) -%> |
General Comments 0
You need to be logged in to leave comments.
Login now