diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-09-02 16:55:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-09-02 16:55:16 +0000 |
commit | 3a32edc3bd108ed07ef2802fbf13dcc886d76607 (patch) | |
tree | d6db898248dfa8b008e452fb99d0540fb3035779 /app/views/trackers | |
parent | 462c986452e25d00b4a76db6494b2649ca9d2285 (diff) | |
download | redmine-3a32edc3bd108ed07ef2802fbf13dcc886d76607.tar.gz redmine-3a32edc3bd108ed07ef2802fbf13dcc886d76607.zip |
Adds a view for editing all trackers fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10283 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/trackers')
-rw-r--r-- | app/views/trackers/fields.html.erb | 77 | ||||
-rw-r--r-- | app/views/trackers/index.html.erb | 1 |
2 files changed, 78 insertions, 0 deletions
diff --git a/app/views/trackers/fields.html.erb b/app/views/trackers/fields.html.erb new file mode 100644 index 000000000..a4872112f --- /dev/null +++ b/app/views/trackers/fields.html.erb @@ -0,0 +1,77 @@ +<h2><%= link_to l(:label_tracker_plural), trackers_path %> » <%= l(:field_summary) %></h2> + +<% if @trackers.any? %> + <%= form_tag({}) do %> + <div class="autoscroll"> + <table class="list"> + <thead> + <tr> + <th></th> + <% @trackers.each do |tracker| %> + <th> + <%= tracker.name %> + <%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.tracker-#{tracker.id}')", + :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %> + </th> + <% end %> + </tr> + </thead> + <tbody> + <tr class="group open"> + <td colspan="<%= @trackers.size + 1 %>"> + <span class="expander" onclick="toggleRowGroup(this);"> </span> + <%= l(:field_core_fields) %> + </td> + </tr> + <% Tracker::CORE_FIELDS.each do |field| %> + <tr class="<%= cycle("odd", "even") %>"> + <td> + <%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.core-field-#{field}')", + :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %> + <%= l("field_#{field}".sub(/_id$/, '')) %> + </td> + <% @trackers.each do |tracker| %> + <td align="center"> + <%= check_box_tag "trackers[#{tracker.id}][core_fields][]", field, tracker.core_fields.include?(field), + :class => "tracker-#{tracker.id} core-field-#{field}" %> + </td> + <% end %> + </tr> + <% end %> + <% if @custom_fields.any? %> + <tr class="group open"> + <td colspan="<%= @trackers.size + 1 %>"> + <span class="expander" onclick="toggleRowGroup(this);"> </span> + <%= l(:label_custom_field_plural) %> + </td> + </tr> + <% @custom_fields.each do |field| %> + <tr class="<%= cycle("odd", "even") %>"> + <td> + <%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.custom-field-#{field.id}')", + :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %> + <%= field.name %> + </td> + <% @trackers.each do |tracker| %> + <td align="center"> + <%= check_box_tag "trackers[#{tracker.id}][custom_field_ids][]", field.id, tracker.custom_fields.include?(field), + :class => "tracker-#{tracker.id} custom-field-#{field.id}" %> + </td> + <% end %> + </tr> + <% end %> + <% end %> + </tbody> + </table> + </div> + <p><%= submit_tag l(:button_save) %></p> + <% @trackers.each do |tracker| %> + <%= hidden_field_tag "trackers[#{tracker.id}][core_fields][]", '' %> + <%= hidden_field_tag "trackers[#{tracker.id}][custom_field_ids][]", '' %> + <% end %> + <% end %> +<% else %> + <p class="nodata"><%= l(:label_no_data) %></p> +<% end %> + +<% html_title l(:field_summary) %> diff --git a/app/views/trackers/index.html.erb b/app/views/trackers/index.html.erb index 4d10d857e..b3840dba7 100644 --- a/app/views/trackers/index.html.erb +++ b/app/views/trackers/index.html.erb @@ -1,5 +1,6 @@ <div class="contextual"> <%= link_to l(:label_tracker_new), new_tracker_path, :class => 'icon icon-add' %> +<%= link_to l(:field_summary), {:action => 'fields'}, :class => 'icon icon-summary' %> </div> <h2><%=l(:label_tracker_plural)%></h2> |