{% extends "base.html" %}

{% block title %}
	&raquo; Gas Supplier Contracts &raquo; {{entry.g_issue.g_contract.name}} &raquo; Issues &raquo; 
 	{{entry.g_issue.id}} &raquo; {{entry.timestamp|date_format}} Edit
{% endblock %}

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

{% block content %}

	<section style="display: flex;">
		<form action="/g/entries/{{entry.id}}/edit" method="post">
			<fieldset>
				<legend>Update Entry</legend>
				<label>Timestamp</label> {{ input_date('timestamp', entry.timestamp) }}
				<label>Text</label>
				{{input_textarea('markdown', entry.markdown, 40, 80, show_pos=True)}}
				<input type="submit" name="update" value="Update">
			</fieldset>
		</form>
		{% include 'e/markdown_docs.html' %}
	</section>

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

{% endblock %}
