{% extends "base.html" %}

{% block title %}
	&raquo; Gas Supplier Contracts &raquo; {{issue.g_contract.name}} &raquo; Issues &raquo; 
 	{{issue.id}} &raquo; Edit
{% endblock %}

{% block nav %}
	<a href="/g/supplier_contracts">Gas Supplier Contracts</a> &raquo; 
	<a href="/g/supplier_contracts/{{issue.g_contract.id}}">{{issue.g_contract.name}}</a> &raquo; 
	<a href="/g/supplier_contracts/{{issue.g_contract.id}}/issues">Issues</a> &raquo; 
	<a href="/g/issues/{{issue.id}}">{{issue.id}}</a> &raquo; Edit
{% endblock %}

{% block content %}

	<form method="post" action="/g/issues/{{issue.id}}/edit">
		<fieldset>
			<legend>Update Issue</legend>
			<label>Date Created</label> {{ input_date('date_created', issue.date_created) }}

			<label>Owner</label>

			<select name="owner_id">
				{% for user in users %}
					{{ input_option( 'owner_id', user.id, user.email_address, issue.properties.owner_id) }}
				{% endfor %}
			</select>
		 
			<label>Open?</label> {{input_checkbox('is_open', issue.is_open)}}

			<label>Subject</label> {{ input_text('subject', issue.properties.get('subject', ''), size='40') }}

			<input type="submit" name="update" value="Update">
		</fieldset>
	</form>

	<form hx-delete="/g/issues/{{issue.id}}/edit"
		 	  hx-confirm="Are you sure you want to delete this issue?">
		<fieldset>
			<legend>Delete This Issue</legend>
			<input type="submit" name="delete" value="Delete">
		</fieldset>
	</form>

{% endblock %}
