sanger/sequencescape

View on GitHub
app/views/batches/fail.html.erb

Summary

Maintainability
Test Coverage


<% add :menu, "Edit batch" => edit_batch_path(@batch) -%>
<% add :back_menu, "Back to batch" => batch_path(@batch) -%>

<%= page_title "Fail batch requests", @batch.id %>

<div class="info">
  Removing a request from a batch will result in it being returned to the inbox to be reprocessed. <br/ >
  Failing a request will result in an email being generated and sent to the project's PM.  This request will not be returned to the inbox. <br/>
  Batches will automatically be failed when all requests in them have been failed, cancelled or removed.
</div>

<%= form_tag(controller: :batches, action: :fail_items, id: @batch.id ) do -%>

<%= render partial: "batch_fail", locals: { requests: @batch.ordered_requests, edit: false } %>

<div class="page-header"><h2>Failure Reason</h2></div>
<div class="grid-form">
  <%= label_tag(:failure_reason, 'Select failure reason') %>
  <div class="field"><%= select :failure, :reason, @fail_reasons, {prompt: 'Select Reason'} %></div>
</div>
<div class="grid-form">
   <%= label_tag(:failure_comment, 'Comment') %>
   <div class="field"><%= text_area :failure, :comment, size: "40x6" %></div>
</div>
<div class="grid-form">
  <%= label_tag('failure_fail_but_charge', 'Fail but charge')%>
  <div class="field"><%= check_box :failure, :fail_but_charge %></div>
</div>
<div class="grid-form">
  <%= submit_tag 'Fail selected requests', value: 'Fail selected requests' %>
</div>
<% end -%>
<%= vite_javascript_tag 'fail_batch.js' %>