diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-09-28 12:03:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-09-28 12:03:17 +0000 |
commit | a37af7a2260d7da269a08e2d94d88f67aaad5c9b (patch) | |
tree | c1b0c8f0afd1e98f55b0b79d1c4af07eedba593d /app/views/workflows | |
parent | 85711f1d5484ae9708dc4e92fdaf4eb499da8ede (diff) | |
download | redmine-a37af7a2260d7da269a08e2d94d88f67aaad5c9b.tar.gz redmine-a37af7a2260d7da269a08e2d94d88f67aaad5c9b.zip |
Adds a workflow overview screen.
Workflow setup moved to a dedicated controller.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1914 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/workflows')
-rw-r--r-- | app/views/workflows/edit.rhtml | 64 | ||||
-rw-r--r-- | app/views/workflows/index.rhtml | 31 |
2 files changed, 95 insertions, 0 deletions
diff --git a/app/views/workflows/edit.rhtml b/app/views/workflows/edit.rhtml new file mode 100644 index 000000000..00d6115d9 --- /dev/null +++ b/app/views/workflows/edit.rhtml @@ -0,0 +1,64 @@ +<div class="contextual"> +<%= link_to l(:field_summary), :action => 'index' %> +</div> + +<h2><%=l(:label_workflow)%></h2> + +<p><%=l(:text_workflow_edit)%>:</p> + +<% form_tag({}, :method => 'get') do %> +<p><label for="role_id"><%=l(:label_role)%>:</label> +<select id="role_id" name="role_id"> + <%= options_from_collection_for_select @roles, "id", "name", (@role.id unless @role.nil?) %> +</select> + +<label for="tracker_id"><%=l(:label_tracker)%>:</label> +<select id="tracker_id" name="tracker_id"> + <%= options_from_collection_for_select @trackers, "id", "name", (@tracker.id unless @tracker.nil?) %> +</select> +<%= submit_tag l(:button_edit), :name => nil %> +</p> +<% end %> + + + +<% unless @tracker.nil? or @role.nil? %> +<% form_tag({}, :id => 'workflow_form' ) do %> +<%= hidden_field_tag 'tracker_id', @tracker.id %> +<%= hidden_field_tag 'role_id', @role.id %> +<div class="box"> + <table> + <tr> + <td align="center"><strong><%=l(:label_current_status)%></strong></td> + <td align="center" colspan="<%= @statuses.length %>"><strong><%=l(:label_new_statuses_allowed)%></strong></td> + </tr> + <tr> + <td></td> + <% for new_status in @statuses %> + <td width="80" align="center"><%= new_status.name %></td> + <% end %> + </tr> + + <% for old_status in @statuses %> + <tr> + <td><%= old_status.name %></td> + <% new_status_ids_allowed = old_status.find_new_statuses_allowed_to(@role, @tracker).collect(&:id) -%> + <% for new_status in @statuses -%> + <td align="center"> + <input type="checkbox" + name="issue_status[<%= old_status.id %>][]" + value="<%= new_status.id %>" + <%= 'checked="checked"' if new_status_ids_allowed.include? new_status.id %>> + </td> + <% end -%> + </tr> + <% end %> + </table> + <p><%= check_all_links 'workflow_form' %></p> +</div> +<%= submit_tag l(:button_save) %> +<% end %> + +<% end %> + +<% html_title(l(:label_workflow)) -%> diff --git a/app/views/workflows/index.rhtml b/app/views/workflows/index.rhtml new file mode 100644 index 000000000..2fd080d8f --- /dev/null +++ b/app/views/workflows/index.rhtml @@ -0,0 +1,31 @@ +<h2><%=l(:label_workflow)%></h2> + +<% if @workflow_counts.empty? %> +<p class="nodata"><%= l(:label_no_data) %></p> +<% else %> +<table class="list"> +<thead> + <tr> + <th></th> + <% @workflow_counts.first.last.each do |role, count| %> + <th> + <%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %> + </th> + + <% end %> + </tr> +</thead> +<tbody> +<% @workflow_counts.each do |tracker, roles| -%> +<tr class="<%= cycle('odd', 'even') %>"> + <td><%= h tracker %></td> + <% roles.each do |role, count| -%> + <td align="center"> + <%= link_to((count > 1 ? count : image_tag('false.png')), {:action => 'edit', :role_id => role, :tracker_id => tracker}, :title => l(:button_edit)) %> + </td> + <% end -%> +</tr> +<% end -%> +</tbody> +</table> +<% end %> |