list.rhtml
55 lines
| 2.9 KiB
| text/html+ruby
|
RhtmlLexer
|
r10 | <h2><%=l(:label_custom_field_plural)%></h2> | ||
|
r203 | |||
<div class="tabs"> | ||||
<ul> | ||||
<li><%= link_to l(:label_issue_plural), {}, :id=> "tab-IssueCustomField", :onclick => "showTab('IssueCustomField'); this.blur(); return false;" %></li> | ||||
<li><%= link_to l(:label_project_plural), {}, :id=> "tab-ProjectCustomField", :onclick => "showTab('ProjectCustomField'); this.blur(); return false;" %></li> | ||||
<li><%= link_to l(:label_user_plural), {}, :id=> "tab-UserCustomField", :onclick => "showTab('UserCustomField'); this.blur(); return false;" %></li> | ||||
</ul> | ||||
|
r330 | </div> | ||
|
r203 | |||
<% %w(IssueCustomField ProjectCustomField UserCustomField).each do |type| %> | ||||
<div id="tab-content-<%= type %>" class="tab-content"> | ||||
|
r330 | <table class="list"> | ||
|
r105 | <thead><tr> | ||
|
r330 | <th width="30%"><%=l(:field_name)%></th> | ||
<th><%=l(:field_field_format)%></th> | ||||
|
r203 | <th><%=l(:field_is_required)%></th> | ||
|
r330 | <% if type == 'IssueCustomField' %> | ||
<th><%=l(:field_is_for_all)%></th> | ||||
|
r203 | <th><%=l(:label_used_by)%></th> | ||
|
r330 | <% end %> | ||
|
r888 | <th><%=l(:button_sort)%></th> | ||
|
r330 | <th width="10%"></th> | ||
|
r105 | </tr></thead> | ||
<tbody> | ||||
|
r888 | <% for custom_field in (@custom_fields_by_type[type] || []).sort %> | ||
|
r330 | <tr class="<%= cycle("odd", "even") %>"> | ||
|
r203 | <td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> | ||
|
r330 | <td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td> | ||
|
r203 | <td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td> | ||
|
r330 | <% if type == 'IssueCustomField' %> | ||
<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td> | ||||
|
r10 | <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> | ||
|
r203 | <% end %> | ||
|
r888 | <td align="center" style="width:15%;"> | ||
<%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => custom_field, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %> | ||||
<%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => custom_field, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> - | ||||
<%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => custom_field, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %> | ||||
<%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => custom_field, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %> | ||||
</td> | ||||
|
r2 | <td align="center"> | ||
|
r19 | <%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %> | ||
</td> | ||||
|
r2 | </tr> | ||
|
r203 | <% end; reset_cycle %> | ||
|
r105 | </tbody> | ||
|
r203 | </table> | ||
|
r2 | <br /> | ||
|
r203 | <%= link_to l(:label_custom_field_new), {:action => 'new', :type => type}, :class => 'icon icon-add' %> | ||
</div> | ||||
<% end %> | ||||
|
r951 | <%= javascript_tag "showTab('#{@tab}');" %> | ||
|
r1019 | <% html_title(l(:label_custom_field_plural)) -%> | ||