{% extends "base.html" %}

{% block title %}
	&raquo; Supplier Contracts &raquo; {{contract.name}}
{% endblock %}

{% block nav %}
		<a href="/e/supplier_contracts">Supplier Contracts</a> &raquo; 
		<a href="/e/supplier_contracts/{{contract.id}}">{{contract.name}}</a>
		&raquo; Edit
{% endblock %}

{% block content %}

	<form method="post">
		<fieldset>
			<legend>Update Contract</legend>	
			<label>Party</label>
			<select name="party_id">
				{% for party in parties %}
					{{ input_option('party_id', party.id, party.participant.code + ' : ' + party.name, contract.party.id) }}
				{% endfor %}
			</select>
			<label>Name</label>
			{{input_text('name', contract.name)}}
			<label>Charge script</label>
			{{input_textarea('charge_script', contract.charge_script, 40, 80, show_pos=True)}}
			<label>Properties</label>
			{{input_textarea('properties', contract.properties, 20, 80)}}
			<input type="submit" value="Update">
		</fieldset>
	</form>

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