{% extends "base.html" %}

{% block title %}
	&raquo; DNOs &raquo; {{dno.dno_code}} &raquo; 
 	Rate Scripts &raquo; {{rate_script.start_date|date_format}} &raquo; Edit
{% endblock %}

{% block nav %}
	<a href="/e/dnos">DNOs</a> &raquo; 
	<a href="/e/dnos/{{dno.id}}">{{dno.dno_code}}</a> &raquo; 
	<a href="/e/dno_rate_scripts/{{rate_script.id}}"
		>Rate Script {{rate_script.start_date|date_format}}</a> &raquo; Edit
{% endblock %}

{% block content %}

	<form action="/e/dno_rate_scripts/{{rate_script.id}}/edit" method="post">
		<fieldset>
			<legend>Update Rate Script</legend>	
			<label>Start Date</label>
			{{ input_date('start', rate_script.start_date) }}

			<label>End Date</label>
			{{ input_date('finish', rate_script.finish_date) }}

			<label>Ended?</label>
			{{input_checkbox('has_finished', rate_script.finish_date != None)}}

			<label>Script</label>
			{{ input_textarea('script', rate_script.script, 40, 80, show_pos=True) }}
			<input type="submit" value="Update">
		</fieldset>
	</form>

	<form hx-delete="/e/dno_rate_scripts/{{rate_script.id}}/edit"
			hx-confirm="Are you sure you want to delete this rate script?">
		<fieldset>
			<legend>Delete this Rate Script</legend>	
			<input type="submit" value="Delete">
		</fieldset>
	</form>

{% endblock %}
