app/views/batches/print_labels.html.erb
<% add :about, "Print labels" -%>
<% add :back_menu, "Back to batch" => batch_path(@batch) -%>
<%= page_title 'Print Labels', "Batch #{@batch.id}" %>
<div class="content">
<div class="info">
<form action='/batches/print_barcodes' method='POST'>
<%= render partial: "shared/print" %>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="35%" class="item">Number of copies:</td>
<td width="65%"><input name="count" size="10" value="1" /></td>
</tr>
<% @batch.requests.index_by(&:target_asset).each do |target_asset, request| -%>
<% next unless target_asset.respond_to?(:human_barcode) %>
<tr>
<td width="35%" class="item"><label for="printable[<%= request.id %>]">Tube <%= target_asset.human_barcode %></label></td>
<td width="65%"><input type='checkbox' checked='on' value='on' name='printable[<%= request.id %>]' id='printable[<%= request.id %>]' ></td>
</tr>
<% end %>
<tr>
<td width="35%" class="item"> </td>
<td width="65%"><input type='submit' value='Print labels' class="print-button"> or <%= link_to 'cancel', controller: 'batches', action: 'show', id: @batch.id %></td>
<td><input type="button" name="select_printables" class="select-all-behaviour" value="Select all" /></td>
<td><input type="button" name="unselect_printables" class="deselect-all-behaviour" value="Deselect all" /></td>
</tr>
</table>
<input type='hidden' name='batch_id' value='<%= @batch.id %>' />
</div>
</div>