{% extends "base.html" %}

{% block title %}
	&raquo; MOP Contracts &raquo; {{batch_file.batch.contract.name}} &raquo;
 	Batches &raquo; {{batch_file.batch.reference}} &raquo;
 	{{batch_file.filename}} &raquo; Edit
{% endblock %}

{% block nav %}
	<a href="/e/mop_contracts">MOP Contracts</a> &raquo; 
	<a href="/e/mop_contracts/{{batch_file.batch.contract.id}}"
		>{{batch_file.batch.contract.name}}</a> &raquo; 
	<a href="/e/mop_batches?mop_contract_id={{batch_file.batch.contract.id}}">Batches</a>
 	&raquo; 
	<a href="/e/mop_batches/{{batch_file.batch.id}}">{{batch_file.batch.reference}}</a>
 	&raquo; 
	<a href="/e/mop_batch_files/{{batch_file.id}}">{{batch_file.filename}}</a>
 	&raquo; Edit
{% endblock %}

{% block content %}
	{% if request.values.confirm_delete %}

		<form method="post" action="/e/mop_batch_files/{{batch_file.id}}/edit">
			<fieldset>
				<legend>Are you sure you want to delete this file?</legend>	
				<input type="submit" name="delete" value="Delete">
				<a href="/e/mop_batch_files/{{batch_file.id}}">Cancel</a>
			</fieldset>
		</form>
		
	{% else %}
		<ul>
			<li>Filename: {{batch_file.filename}}</li>
			<li>
				Upload Timestamp:
				{{batch_file.upload_timestamp|date_format}}
			</li>
		</ul>

		<form action="/e/mop_batch_files/{{batch_file.id}}/edit" method="post">
			<fieldset class="grid">
				<legend>Update This Batch File</legend>	
				<label>Parser</label>
				<select name="parser_name">
					{% for parser_name in parser_names  %}
						{{input_option('bill_parser_name', parser_name, parser_name)}}
					{% endfor %}
				</select>
				<input type="submit" name="update" value="Update">
			</fieldset>
		</form>

		<form action="/e/mop_batch_files/{{batch_file.id}}/edit">
			<fieldset>
				<legend>Delete This Batch File</legend>	
				<input type="submit" name="confirm_delete" value="Delete">
			</fieldset>
		</form>

	{% endif %}
{% endblock %}
