{% extends "base.html" %}

{% block title %}
	&raquo;List of Local Reports &raquo; {{report.name}}
{% endblock %}

{% block nav %}
	<a href="/local_reports">List of Local Reports</a> &raquo; {{report.name}}
{% endblock %}

{% block content %}
	{% if request.method == 'GET' and request.values.confirm_delete %}
		<form method="post" action="/local_reports/{{report.id}}">
			<fieldset>
				<legend>Are you sure you want to delete this report?</legend>	
				<a href="/local_reports/{{report.id}}">Cancel</a>
				<input type="submit" value="Delete">
			</fieldset>
		</form>

	{% else %}
		<ul>
			<li>
				<a href="{{report.id}}/output">Output</a>
			</li>
		</ul>	

		<form method="post" action="/local_reports/{{report.id}}">
			<fieldset>
				<legend>Update Report</legend>
				<label>Name</label> {{input_text("name", report.name, size=100)}}

				<label>Script</label>
				{{input_textarea('script', report.script, 50, 88, show_pos=True)}}

				<label>Template</label>
				{{input_textarea('template', report.template, 50, 88, show_pos=True)}}

				<input type="submit" value="Save">
			</fieldset>
		</form>

		<form action="/local_reports/{{report.id}}">
			<fieldset>
				<legend>Delete this report</legend>	
				<input type="submit" name="confirm_delete" value="Delete">
			</fieldset>
		</form>
	{% endif %}
{% endblock %}
