{% extends "base.html" %}

{% block title %}
	&raquo; MOP Contracts &raquo; {{contract.name}} &raquo; Batches &raquo; Add
{% endblock %}

{% block nav %}
	<a href="/e/mop_contracts">MOP Contracts</a> &raquo; 
	<a href="/e/mop_contracts/{{contract.id}}">{{contract.name}}</a> &raquo; 
	<a href="/e/mop_contracts/{{contract.id}}/batches">Batches</a> &raquo; Add
{% endblock %}

{% block content %}
	<form action="/e/mop_contracts/{{contract.id}}/batches/add" method="post">
		<fieldset>
			<legend>Add a batch</legend>
			<label>Reference</label>
			{{input_text('reference', next_batch_reference, required=True)}}

			<label>Description</label>
			{{input_text('description', '', placeholder=next_batch_description)}}

			<label>Date Created</label> {{ input_date('date_created', resolution='microsecond') }}

			<input type="submit" value="Add">
		</fieldset>
	</form>

	<table>					
		<caption>Existing Batches</caption>
		<thead>
			<tr>
				<th>Reference</th>
				<th>Description</th>
			</tr>
		</thead>
		<tbody>
			{% for batch in batches %}
				<tr>
					<td>{{batch.reference}}</td>
					<td>{{batch.description}}</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>

{% endblock %}
