{% extends "base.html" %}

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

{% block nav %}
	<a href="/g/suppleir_contracts">Gas Supplier Contracts</a> &raquo;
	<a
	 		href="/g/supplier_contracts/{{g_batch.g_contract.id}}"
			>{{g_batch.g_contract.name}}</a> &raquo;
	<a
	 		href="/g/batches?g_contract_id={{g_batch.g_contract.id}}"
			>Batches</a> &raquo;
	<a href="/g/batches/{{g_batch.id}}">{{g_batch.reference}}</a> &raquo; Edit
{% endblock %}

{% block content %}

	<form action="/g/batches/{{g_batch.id}}/edit" method="post">
		<fieldset>
			<legend>Update batch</legend>
			<label>Reference</label> {{input_text('reference', g_batch.reference)}}
			<label>Description</label> {{input_text('description', g_batch.description)}}
			<input type="submit" name="update" value="Update">
		</fieldset>
	</form>

	<form hx-post="/g/batches/{{g_batch.id}}/edit"
		hx-confirm="Are you sure you want to delete all the bills in this batch?">
		<fieldset>
			<legend>Delete all the bills in this batch</legend>
			<input type="submit" name="delete_bills" value="Delete">
		</fieldset>
	</form>

	<form hx-delete="/g/batches/{{g_batch.id}}/edit"
		hx-confirm="Are you sure you want to delete this batch and all its bills?">
		<fieldset>
			<legend>Delete this batch</legend>
			<input type="submit" value="Delete">
		</fieldset>
	</form>

{% endblock %}
