OSDN Git Service

added svn:eol-style native property on /app files
[redminele/redmine.git] / app / views / custom_fields / list.rhtml
1 <h2><%=l(:label_custom_field_plural)%></h2>
2
3 <div class="tabs">
4 <ul>
5 <li><%= link_to l(:label_issue_plural), {}, :id=> "tab-IssueCustomField", :onclick => "showTab('IssueCustomField'); this.blur(); return false;" %></li>
6 <li><%= link_to l(:label_project_plural), {}, :id=> "tab-ProjectCustomField", :onclick => "showTab('ProjectCustomField'); this.blur(); return false;" %></li>
7 <li><%= link_to l(:label_user_plural), {}, :id=> "tab-UserCustomField", :onclick => "showTab('UserCustomField'); this.blur(); return false;" %></li>
8 </ul>
9 </div>
10
11 <% %w(IssueCustomField ProjectCustomField UserCustomField).each do |type| %>
12 <div id="tab-content-<%= type %>" class="tab-content">
13 <table class="list">            
14   <thead><tr>   
15         <th width="30%"><%=l(:field_name)%></th>
16         <th><%=l(:field_field_format)%></th>
17         <th><%=l(:field_is_required)%></th>
18         <% if type == 'IssueCustomField' %>
19         <th><%=l(:field_is_for_all)%></th>
20         <th><%=l(:label_used_by)%></th>
21         <% end %>
22         <th width="10%"></th>
23   </tr></thead>
24   <tbody>
25 <% for custom_field in (@custom_fields_by_type[type] || []) %>
26   <tr class="<%= cycle("odd", "even") %>">
27         <td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
28         <td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
29         <td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td>
30         <% if type == 'IssueCustomField' %>
31         <td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td>
32         <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>
33         <% end %>
34         <td align="center">
35            <%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
36     </td>
37   </tr>
38 <% end; reset_cycle %>
39   </tbody>
40 </table>
41 <br />
42 <%= link_to l(:label_custom_field_new), {:action => 'new', :type => type}, :class => 'icon icon-add' %>
43 </div>
44 <% end %>
45
46 <%= javascript_tag "showTab('#{@tab}');" %>