{% extends "base.html" %}

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

{% block nav %}
	<a href="/g/industry_contracts">Gas Industry Contracts</a> &raquo;
	<a href="/g/industry_contracts/{{g_contract.id}}">{{g_contract.name}}</a> &raquo; Edit
{% endblock %}

{% block content %}

	<form hx-patch="/g/industry_contracts/{{g_contract.id}}/edit">
		<fieldset>
			<legend>Update Contract</legend>
			<label>Name</label> {{input_text('name', g_contract.name)}}
			<label>Charge Script</label>
			{{input_textarea(
				'charge_script', g_contract.charge_script, 40, 80)}}
			<label>Properties</label>
			{{input_textarea('properties', g_contract.properties, 20, 80)}}
			<input type="submit" name="update" value="Update">
		</fieldset>
	</form>

	<form hx-patch="/g/industry_contracts/{{g_contract.id}}/edit">
		<fieldset>
			<legend>Update State</legend>
			<label>State</label>
			{{input_textarea('state', g_contract.state, 20, 80)}}
			<input type="submit" name="update" value="Update">
		</fieldset>
	</form>

	<form hx-delete="/g/industry_contracts/{{g_contract.id}}/edit"
			hx-confirm="Are you sure you want to delete this industry contract?">
		<fieldset>
			<legend>Delete this contract</legend>
			<input type="submit" name="delete" value="Delete">
		</fieldset>
	</form>
{% endblock %}
