2013-05-09 12:17:12 +02:00

81 lines
2.8 KiB
Plaintext

<% if @workflow.project %>
<h2><%= link_to l(:label_dmsf_workflow_plural), settings_project_path(@project, :tab => 'dmsf') %> &#187; <%=h @workflow %></h2>
<% else %>
<h2><%= link_to l(:label_dmsf_workflow_plural), dmsf_workflows_path %> &#187; <%=h @workflow %></h2>
<% end %>
<% if @project %>
<div class="contextual">
<%= link_to 'Action', action_dmsf_workflow_path(:project_id => @project.id, :id => @workflow, :step => 1), :remote => true %>
</div>
<% end %>
<%= labelled_form_for @workflow do |f| %>
<%= error_messages_for 'workflow' %>
<div class="box tabular">
<p><%= f.text_field :name, :required => true %><%= submit_tag l(:button_save) %></p>
</div>
<% end %>
<div class="tab-content" id="tab-content-members">
<div class="splitcontentleft">
<% if @workflow.steps.any? %>
<table class="list steps">
<thead><tr>
<th><%= l(:label_dmsf_workflow_step) %></th>
<th><%= l(:label_dmsf_workflow_approval_plural) %></th>
<th><%=l(:button_sort)%></th>
<th style="width:15%"></th>
</tr></thead>
<tbody>
<% @workflow.steps.each do |step| %>
<tr id="step-<%= step %>" class="<%= cycle 'odd', 'even' %> step">
<td class="step"><%= step %></td>
<td class="approval">
<% @workflow.approvals(step).each_with_index do |approval, i| %>
<% if i != 0 %>
<b><%= approval.soperator %></b>&nbsp
<% end %>
<%= link_to_user approval.user %>
<% end %>
</td>
<td align="center" style="width:15%;">
<%= reorder_links('workflow_step', {:action => 'edit', :id => @workflow, :step => step}, :put) %>
</td>
<td class="buttons">
<%= delete_link edit_dmsf_workflow_path(@workflow, :step => step) %>
</td>
</tr>
<% end; reset_cycle %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
</div>
<div class="splitcontentright">
<%= form_for(@workflow, :url => edit_dmsf_workflow_path(@workflow),
:html => {:method => :post}) do |f| %>
<fieldset><legend><%=l(:label_user_new)%></legend>
<p><%= label_tag 'user_search', l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
<%= javascript_tag "observeSearchfield('user_search', null, '#{ escape_javascript autocomplete_for_user_dmsf_workflow_path(@workflow) }')" %>
<div id="users">
<%= render_principals_for_new_dmsf_workflow_users(@workflow) %>
</div>
<p>
<%= l(:label_dmsf_workflow_step) %>
<%= select_tag 'step',
dmsf_workflow_steps_options_for_select(@workflow.steps),
:id => 'selected_step', :style => "width:100px" %>
</p>
<p><%= submit_tag l(:dmsf_and) %>&nbsp<%= submit_tag l(:dmsf_or) %></p>
</fieldset>
<% end %>
</div>
</div>