{% extends "base.html" %}

{% block title %}
  &raquo; Market Participants &raquo; {{participant.name}}
{% endblock %}

{% block nav %}
	<a href="/e/participants">Market Participants</a> &raquo; {{participant.name}}
{% endblock %}

{% block content %}
	<table>
		<tbody>
			<tr>
				<th>Code</th>
				<td>{{participant.code}}</td>
			</tr>
			<tr>
				<th>Name</th>
				<td>{{participant.name}}</td>
			</tr>
		</tbody>
	</table>
	<br>
	<br>
	<table>
		<caption>Parties</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Market Role</th>
				<th>DNO Code</th>
			</tr>
		</thead>
		<tbody>
			{% for party in participant.parties %}
				<tr>
					<td>
						<a href="/e/parties/{{party.id}}">{{party.name}}</a>
					</td>
					<td>
						<a href="/e/market_roles/{{party.market_role.id}}"
							>{{party.market_role.description}}</a>
					</td>
					<td>
						{% if party.market_role.code == 'R' %}
							{{ party.dno_code }}
						{% endif %}
					</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>
{% endblock %}
