Revision 912:5e80956cc792 app/views/workflows
| app/views/workflows/_action_menu.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:button_edit), {:action => 'edit'}, :class => 'icon icon-edit' %>
|
|
| 3 |
<%= link_to l(:button_copy), {:action => 'copy'}, :class => 'icon icon-copy' %>
|
|
| 4 |
<%= link_to l(:field_summary), {:action => 'index'}, :class => 'icon icon-summary' %>
|
|
| 5 |
</div> |
|
| app/views/workflows/_action_menu.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:button_edit), {:action => 'edit'}, :class => 'icon icon-edit' %>
|
|
| 3 |
<%= link_to l(:button_copy), {:action => 'copy'}, :class => 'icon icon-copy' %>
|
|
| 4 |
<%= link_to l(:field_summary), {:action => 'index'}, :class => 'icon icon-summary' %>
|
|
| 5 |
</div> |
|
| app/views/workflows/_form.html.erb | ||
|---|---|---|
| 1 | 1 |
<table class="list transitions-<%= name %>"> |
| 2 | 2 |
<thead> |
| 3 |
<tr>
|
|
| 4 |
<th align="left">
|
|
| 5 |
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input')",
|
|
| 6 |
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
| 3 |
<tr>
|
|
| 4 |
<th align="left">
|
|
| 5 |
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input')",
|
|
| 6 |
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
| 7 | 7 |
<%=l(:label_current_status)%> |
| 8 | 8 |
</th> |
| 9 |
<th align="center" colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
|
|
| 10 |
</tr>
|
|
| 11 |
<tr>
|
|
| 12 |
<td></td>
|
|
| 13 |
<% for new_status in @statuses %>
|
|
| 14 |
<td width="<%= 75 / @statuses.size %>%" align="center">
|
|
| 15 |
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')",
|
|
| 16 |
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
| 17 |
<%=h new_status.name %>
|
|
| 18 |
</td>
|
|
| 19 |
<% end %>
|
|
| 20 |
</tr>
|
|
| 9 |
<th align="center" colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
|
|
| 10 |
</tr>
|
|
| 11 |
<tr>
|
|
| 12 |
<td></td>
|
|
| 13 |
<% for new_status in @statuses %>
|
|
| 14 |
<td width="<%= 75 / @statuses.size %>%" align="center">
|
|
| 15 |
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')",
|
|
| 16 |
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
| 17 |
<%=h new_status.name %>
|
|
| 18 |
</td>
|
|
| 19 |
<% end %>
|
|
| 20 |
</tr>
|
|
| 21 | 21 |
</thead> |
| 22 | 22 |
<tbody> |
| 23 |
<% for old_status in @statuses %>
|
|
| 24 |
<tr class="<%= cycle("odd", "even") %>">
|
|
| 25 |
<td>
|
|
| 26 |
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.id}')",
|
|
| 27 |
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
| 28 |
|
|
| 29 |
<%=h old_status.name %>
|
|
| 30 |
</td>
|
|
| 31 |
<% for new_status in @statuses -%>
|
|
| 32 |
<td align="center">
|
|
| 33 |
<%= check_box_tag "issue_status[#{ old_status.id }][#{new_status.id}][]", name, workflows.detect {|w| w.old_status_id == old_status.id && w.new_status_id == new_status.id},
|
|
| 34 |
:class => "old-status-#{old_status.id} new-status-#{new_status.id}" %>
|
|
| 35 |
</td>
|
|
| 36 |
<% end -%>
|
|
| 37 |
</tr>
|
|
| 38 |
<% end %>
|
|
| 23 |
<% for old_status in @statuses %>
|
|
| 24 |
<tr class="<%= cycle("odd", "even") %>">
|
|
| 25 |
<td>
|
|
| 26 |
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.id}')",
|
|
| 27 |
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
| 28 |
|
|
| 29 |
<%=h old_status.name %>
|
|
| 30 |
</td>
|
|
| 31 |
<% for new_status in @statuses -%>
|
|
| 32 |
<td align="center">
|
|
| 33 |
<%= check_box_tag "issue_status[#{ old_status.id }][#{new_status.id}][]", name, workflows.detect {|w| w.old_status_id == old_status.id && w.new_status_id == new_status.id},
|
|
| 34 |
:class => "old-status-#{old_status.id} new-status-#{new_status.id}" %>
|
|
| 35 |
</td>
|
|
| 36 |
<% end -%>
|
|
| 37 |
</tr>
|
|
| 38 |
<% end %>
|
|
| 39 | 39 |
</tbody> |
| 40 |
</table> |
|
| 40 |
</table> |
|
| app/views/workflows/copy.html.erb | ||
|---|---|---|
| 1 |
<%= render :partial => 'action_menu' %> |
|
| 2 |
|
|
| 3 |
<h2><%=l(:label_workflow)%></h2> |
|
| 4 |
|
|
| 5 |
<% form_tag({}, :id => 'workflow_copy_form') do %>
|
|
| 6 |
<fieldset class="tabular box"> |
|
| 7 |
<legend><%= l(:label_copy_source) %></legend> |
|
| 8 |
<p> |
|
| 9 |
<label><%= l(:label_tracker) %></label> |
|
| 10 |
<%= select_tag('source_tracker_id',
|
|
| 11 |
"<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 12 |
"<option value=\"any\">--- #{ l(:label_copy_same_as_target) } ---</option>" +
|
|
| 13 |
options_from_collection_for_select(@trackers, 'id', 'name', @source_tracker && @source_tracker.id)) %> |
|
| 14 |
</p> |
|
| 15 |
<p> |
|
| 16 |
<label><%= l(:label_role) %></label> |
|
| 17 |
<%= select_tag('source_role_id',
|
|
| 18 |
"<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 19 |
"<option value=\"any\">--- #{ l(:label_copy_same_as_target) } ---</option>" +
|
|
| 20 |
options_from_collection_for_select(@roles, 'id', 'name', @source_role && @source_role.id)) %> |
|
| 21 |
</p> |
|
| 22 |
</fieldset> |
|
| 23 |
|
|
| 24 |
<fieldset class="tabular box"> |
|
| 25 |
<legend><%= l(:label_copy_target) %></legend> |
|
| 26 |
<p> |
|
| 27 |
<label><%= l(:label_tracker) %></label> |
|
| 28 |
<%= select_tag 'target_tracker_ids', |
|
| 29 |
"<option value=\"\" disabled=\"disabled\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 30 |
options_from_collection_for_select(@trackers, 'id', 'name', @target_trackers && @target_trackers.map(&:id)), :multiple => true %> |
|
| 31 |
</p> |
|
| 32 |
<p> |
|
| 33 |
<label><%= l(:label_role) %></label> |
|
| 34 |
<%= select_tag 'target_role_ids', |
|
| 35 |
"<option value=\"\" disabled=\"disabled\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 36 |
options_from_collection_for_select(@roles, 'id', 'name', @target_roles && @target_roles.map(&:id)), :multiple => true %> |
|
| 37 |
</p> |
|
| 38 |
</fieldset> |
|
| 39 |
<%= submit_tag l(:button_copy) %> |
|
| 40 |
<% end %> |
|
| app/views/workflows/copy.rhtml | ||
|---|---|---|
| 1 |
<%= render :partial => 'action_menu' %> |
|
| 2 |
|
|
| 3 |
<h2><%=l(:label_workflow)%></h2> |
|
| 4 |
|
|
| 5 |
<% form_tag({}, :id => 'workflow_copy_form') do %>
|
|
| 6 |
<div class="tabular box"> |
|
| 7 |
<p> |
|
| 8 |
<label><%= l(:label_copy_source) %></label> |
|
| 9 |
<%= l(:label_tracker) %><br /> |
|
| 10 |
<%= select_tag('source_tracker_id',
|
|
| 11 |
"<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 12 |
"<option value=\"any\">--- #{ l(:label_copy_same_as_target) } ---</option>" +
|
|
| 13 |
options_from_collection_for_select(@trackers, 'id', 'name', @source_tracker && @source_tracker.id)) %><br /> |
|
| 14 |
<%= l(:label_role) %><br /> |
|
| 15 |
<%= select_tag('source_role_id',
|
|
| 16 |
"<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 17 |
"<option value=\"any\">--- #{ l(:label_copy_same_as_target) } ---</option>" +
|
|
| 18 |
options_from_collection_for_select(@roles, 'id', 'name', @source_role && @source_role.id)) %> |
|
| 19 |
</p> |
|
| 20 |
<p> |
|
| 21 |
<label><%= l(:label_copy_target) %></label> |
|
| 22 |
<%= l(:label_tracker) %><br /> |
|
| 23 |
<%= select_tag 'target_tracker_ids', |
|
| 24 |
"<option value=\"\" disabled=\"disabled\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 25 |
options_from_collection_for_select(@trackers, 'id', 'name', @target_trackers && @target_trackers.map(&:id)), :multiple => true %><br /> |
|
| 26 |
<%= l(:label_role) %><br /> |
|
| 27 |
<%= select_tag 'target_role_ids', |
|
| 28 |
"<option value=\"\" disabled=\"disabled\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
|
|
| 29 |
options_from_collection_for_select(@roles, 'id', 'name', @target_roles && @target_roles.map(&:id)), :multiple => true %> |
|
| 30 |
</p> |
|
| 31 |
</div> |
|
| 32 |
<%= submit_tag l(:button_copy) %> |
|
| 33 |
<% end %> |
|
| app/views/workflows/edit.html.erb | ||
|---|---|---|
| 1 |
<%= render :partial => 'action_menu' %> |
|
| 2 |
|
|
| 3 |
<h2><%=l(:label_workflow)%></h2> |
|
| 4 |
|
|
| 5 |
<p><%=l(:text_workflow_edit)%>:</p> |
|
| 6 |
|
|
| 7 |
<% form_tag({}, :method => 'get') do %>
|
|
| 8 |
<p> |
|
| 9 |
<label><%=l(:label_role)%>: |
|
| 10 |
<%= select_tag 'role_id', options_from_collection_for_select(@roles, "id", "name", @role && @role.id) %></label> |
|
| 11 |
|
|
| 12 |
<label><%=l(:label_tracker)%>: |
|
| 13 |
<%= select_tag 'tracker_id', options_from_collection_for_select(@trackers, "id", "name", @tracker && @tracker.id) %></label> |
|
| 14 |
|
|
| 15 |
<%= hidden_field_tag 'used_statuses_only', '0' %> |
|
| 16 |
<label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label> |
|
| 17 |
</p> |
|
| 18 |
<p> |
|
| 19 |
<%= submit_tag l(:button_edit), :name => nil %> |
|
| 20 |
</p> |
|
| 21 |
<% end %> |
|
| 22 |
|
|
| 23 |
<% if @tracker && @role && @statuses.any? %> |
|
| 24 |
<% form_tag({}, :id => 'workflow_form' ) do %>
|
|
| 25 |
<%= hidden_field_tag 'tracker_id', @tracker.id %> |
|
| 26 |
<%= hidden_field_tag 'role_id', @role.id %> |
|
| 27 |
<div class="autoscroll"> |
|
| 28 |
<%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
|
|
| 29 |
|
|
| 30 |
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;"> |
|
| 31 |
<legend onclick="toggleFieldset(this);"><%= l(:label_additional_workflow_transitions_for_author) %></legend> |
|
| 32 |
<div id="author_workflows" style="margin: 0.5em 0 0.5em 0;"> |
|
| 33 |
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
|
|
| 34 |
</div> |
|
| 35 |
</fieldset> |
|
| 36 |
<%= javascript_tag "hideFieldset($('author_workflows'))" unless @workflows['author'].present? %>
|
|
| 37 |
|
|
| 38 |
<fieldset class="collapsible" style="padding: 0;"> |
|
| 39 |
<legend onclick="toggleFieldset(this);"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend> |
|
| 40 |
<div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;"> |
|
| 41 |
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
|
|
| 42 |
</div> |
|
| 43 |
</fieldset> |
|
| 44 |
<%= javascript_tag "hideFieldset($('assignee_workflows'))" unless @workflows['assignee'].present? %>
|
|
| 45 |
</div> |
|
| 46 |
<%= submit_tag l(:button_save) %> |
|
| 47 |
<% end %> |
|
| 48 |
<% end %> |
|
| 49 |
|
|
| 50 |
<% html_title(l(:label_workflow)) -%> |
|
| app/views/workflows/edit.rhtml | ||
|---|---|---|
| 1 |
<%= render :partial => 'action_menu' %> |
|
| 2 |
|
|
| 3 |
<h2><%=l(:label_workflow)%></h2> |
|
| 4 |
|
|
| 5 |
<p><%=l(:text_workflow_edit)%>:</p> |
|
| 6 |
|
|
| 7 |
<% form_tag({}, :method => 'get') do %>
|
|
| 8 |
<p> |
|
| 9 |
<label><%=l(:label_role)%>:</label> |
|
| 10 |
<%= select_tag 'role_id', options_from_collection_for_select(@roles, "id", "name", @role && @role.id) %> |
|
| 11 |
|
|
| 12 |
<label><%=l(:label_tracker)%>:</label> |
|
| 13 |
<%= select_tag 'tracker_id', options_from_collection_for_select(@trackers, "id", "name", @tracker && @tracker.id) %> |
|
| 14 |
|
|
| 15 |
<%= hidden_field_tag 'used_statuses_only', '0' %> |
|
| 16 |
<label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label> |
|
| 17 |
</p> |
|
| 18 |
<p> |
|
| 19 |
<%= submit_tag l(:button_edit), :name => nil %> |
|
| 20 |
</p> |
|
| 21 |
<% end %> |
|
| 22 |
|
|
| 23 |
<% if @tracker && @role && @statuses.any? %> |
|
| 24 |
<% form_tag({}, :id => 'workflow_form' ) do %>
|
|
| 25 |
<%= hidden_field_tag 'tracker_id', @tracker.id %> |
|
| 26 |
<%= hidden_field_tag 'role_id', @role.id %> |
|
| 27 |
<div class="autoscroll"> |
|
| 28 |
<%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
|
|
| 29 |
|
|
| 30 |
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;"> |
|
| 31 |
<legend onclick="toggleFieldset(this);"><%= l(:label_additional_workflow_transitions_for_author) %></legend> |
|
| 32 |
<div id="author_workflows" style="margin: 0.5em 0 0.5em 0;"> |
|
| 33 |
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
|
|
| 34 |
</div> |
|
| 35 |
</fieldset> |
|
| 36 |
<%= javascript_tag "hideFieldset($('author_workflows'))" unless @workflows['author'].present? %>
|
|
| 37 |
|
|
| 38 |
<fieldset class="collapsible" style="padding: 0;"> |
|
| 39 |
<legend onclick="toggleFieldset(this);"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend> |
|
| 40 |
<div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;"> |
|
| 41 |
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
|
|
| 42 |
</div> |
|
| 43 |
</fieldset> |
|
| 44 |
<%= javascript_tag "hideFieldset($('assignee_workflows'))" unless @workflows['assignee'].present? %>
|
|
| 45 |
</div> |
|
| 46 |
<%= submit_tag l(:button_save) %> |
|
| 47 |
<% end %> |
|
| 48 |
<% end %> |
|
| 49 |
|
|
| 50 |
<% html_title(l(:label_workflow)) -%> |
|
| app/views/workflows/index.html.erb | ||
|---|---|---|
| 1 |
<%= render :partial => 'action_menu' %> |
|
| 2 |
|
|
| 3 |
<h2><%=l(:label_workflow)%></h2> |
|
| 4 |
|
|
| 5 |
<% if @workflow_counts.empty? %> |
|
| 6 |
<p class="nodata"><%= l(:label_no_data) %></p> |
|
| 7 |
<% else %> |
|
| 8 |
<div class="autoscroll"> |
|
| 9 |
<table class="list"> |
|
| 10 |
<thead> |
|
| 11 |
<tr> |
|
| 12 |
<th></th> |
|
| 13 |
<% @workflow_counts.first.last.each do |role, count| %> |
|
| 14 |
<th> |
|
| 15 |
<%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %> |
|
| 16 |
</th> |
|
| 17 |
|
|
| 18 |
<% end %> |
|
| 19 |
</tr> |
|
| 20 |
</thead> |
|
| 21 |
<tbody> |
|
| 22 |
<% @workflow_counts.each do |tracker, roles| -%> |
|
| 23 |
<tr class="<%= cycle('odd', 'even') %>">
|
|
| 24 |
<td><%= h tracker %></td> |
|
| 25 |
<% roles.each do |role, count| -%> |
|
| 26 |
<td align="center"> |
|
| 27 |
<%= link_to((count > 0 ? count : image_tag('false.png')), {:action => 'edit', :role_id => role, :tracker_id => tracker}, :title => l(:button_edit)) %>
|
|
| 28 |
</td> |
|
| 29 |
<% end -%> |
|
| 30 |
</tr> |
|
| 31 |
<% end -%> |
|
| 32 |
</tbody> |
|
| 33 |
</table> |
|
| 34 |
</div> |
|
| 35 |
<% end %> |
|
| app/views/workflows/index.rhtml | ||
|---|---|---|
| 1 |
<%= render :partial => 'action_menu' %> |
|
| 2 |
|
|
| 3 |
<h2><%=l(:label_workflow)%></h2> |
|
| 4 |
|
|
| 5 |
<% if @workflow_counts.empty? %> |
|
| 6 |
<p class="nodata"><%= l(:label_no_data) %></p> |
|
| 7 |
<% else %> |
|
| 8 |
<div class="autoscroll"> |
|
| 9 |
<table class="list"> |
|
| 10 |
<thead> |
|
| 11 |
<tr> |
|
| 12 |
<th></th> |
|
| 13 |
<% @workflow_counts.first.last.each do |role, count| %> |
|
| 14 |
<th> |
|
| 15 |
<%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %> |
|
| 16 |
</th> |
|
| 17 |
|
|
| 18 |
<% end %> |
|
| 19 |
</tr> |
|
| 20 |
</thead> |
|
| 21 |
<tbody> |
|
| 22 |
<% @workflow_counts.each do |tracker, roles| -%> |
|
| 23 |
<tr class="<%= cycle('odd', 'even') %>">
|
|
| 24 |
<td><%= h tracker %></td> |
|
| 25 |
<% roles.each do |role, count| -%> |
|
| 26 |
<td align="center"> |
|
| 27 |
<%= link_to((count > 0 ? count : image_tag('false.png')), {:action => 'edit', :role_id => role, :tracker_id => tracker}, :title => l(:button_edit)) %>
|
|
| 28 |
</td> |
|
| 29 |
<% end -%> |
|
| 30 |
</tr> |
|
| 31 |
<% end -%> |
|
| 32 |
</tbody> |
|
| 33 |
</table> |
|
| 34 |
</div> |
|
| 35 |
<% end %> |
|
Also available in: Unified diff