{% extends "base.html" %}

{% block title %}
	&raquo; Non-Core Contracts &raquo; {{contract.name}}
{% endblock %}

{% block nav %}
	<a href="/non_core_contracts">Non-Core Contracts</a> &raquo; 
 	{{contract.name}} [<a href="/non_core_contracts/{{contract.id}}/edit">edit</a>]
{% endblock %}

{% block content %}
	{% if contract.name in ['bank_holidays', 'bmarketidx'] %}
		<p>
			<a href="/non_core_contracts/{{contract.id}}/auto_importer">Automatic Importer</a>
		</p>
	{% elif contract.name == 'tnuos' %}
		<p>
			<a href="/national_grid">Automatic Importer</a>
		</p>
	{% elif contract.name == 'triad_dates' %}
		<p>
			<a href="/rate_server">Automatic Importer</a>
		</p>
	{% elif contract.name == 'bsuos' %}
		<p>
			Automatic importers:
			<ul>
				<li><a href="/rate_server">Current Rates</a></li>
				<li>
					<a href="/non_core_contracts/{{contract.id}}/auto_importer">Old Rates</a>
				</li>
				<li><a href="/national_grid">Forecast Rates</a></li>
			</ul>
		</p>
	{% elif contract.name in ['rcrc', 'system_price', 'tlms'] %}
		<p>
			<a href="/e/elexon">Automatic Importer</a>
		</p>
	{% endif %}


	<table>
		<caption>
				Rate Scripts
				[<a href="/non_core_contracts/{{contract.id}}/add_rate_script">add</a>]
		</caption>
		<thead>
			<tr>
				<th></th>
				<th>Start Date</th>
				<th>Finish Date</th>
			</tr>
		</thead>
		<tbody>
			{% for rate_script in rate_scripts %}
				<tr>
					<td><a href="/non_core_rate_scripts/{{rate_script.id}}">View</a></td>
					<td>{{ rate_script.start_date|hh_format }}</td>
					<td>{{ rate_script.finish_date|hh_format }}</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>

	<h3>Properties</h3>	

	<pre>{{contract.properties}}</pre>

	<h3>State</h3>	

	<pre>{{contract.state}}</pre>
{% endblock %}
