_task.rhtml 797 Bytes
<%# a generic task solver %>
<h2><%= _('Processing task: %s') % task.description %></h2>

<% form_for('task', task, :url => { :action => 'close', :id => task.id}) do |f| %>

  <div>
  <%= labelled_radio_button _('OK'), :decision, 'finish', true, :onclick => "if(this.checked) $('rejection-field-#{task.id}').style.display='none'" %>
  </div>
  <div>
    <%= labelled_radio_button _('Cancel'), :decision, 'cancel', false, :onclick => "if(this.checked) $('rejection-field-#{task.id}').style.display='block'" %>
  </div>

  <div id="rejection-field-<%= task.id %>" style='display: none'>
    <%= required labelled_form_field(_('Rejection explanation'), text_area(:task, :reject_explanation, :rows => 5))%>
  </div>

  <% button_bar do %>
    <%= submit_button(:ok, _('OK')) %>
  <% end %>

<% end %>