{% extends "base.html" %}

{% block title %}
	Gas Contracts &raquo; {{g_contract.name}} &raquo; Batches &gt; Add
{% endblock %}

{% block nav %}
	<a href="/g_contracts">Gas Contracts</a> &raquo;
	<a href="/g_contracts/{{g_contract.id}}">{{g_contract.name}}</a> &raquo;
	<a href="/g_batches?g_contract_id={{g_contract.id}}">Batches</a> &raquo; Add
{% endblock %}

{% block content %}
	<div class="layer-section">
		<div class="section-content">
			<div class="section-data">
				<div class="standardForm textWidthAuto">
					<form
							action="/g_contracts/{{g_contract.id}}/add_batch" method="post">
						<fieldset>
							<legend>Add a batch</legend>
							<div class="row">						
								<div class="col-sm-4">
									<label>Reference</label>
								 	{{input_text('reference', '')}}
								</div>
							</div>
							<div class="row">						
								<div class="col-sm-4">
									<label>Description</label>
								 	{{input_text('description', '')}}
								</div>
							</div>
							<input type="submit" value="Add">
						</fieldset>
					</form>
				</div>
				<br>
				<table class="DataTable widthAuto noMarginBottom">
					<caption>Existing Batches</caption>
					<thead>
						<tr>
							<th>Reference</th>
							<th>Description</th>
						</tr>
					</thead>
					<tbody>
						{% for g_batch in g_batches %}
							<tr>
								<td>{{g_batch.reference}}</td>
								<td>{{g_batch.description}}</td>
							</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</div>
{% endblock %}
