{% extends "materia/materialegislativa_detail.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block actions %} {% endblock %}
{% block detail_content %}
	<fieldset>
		<legend>Matéria Legislativa</legend>
		<ul class="small-block-grid-3 medium-block-grid-3 large-block-grid-3">
			<li>Tipo: <b>{{materialegislativa.tipo.sigla}}</b></li>
			<li>Número: <b>{{materialegislativa.numero}}</b></li>
			<li>Ano: <b>{{materialegislativa.ano}}</b></li>
		</ul>
		Ementa: <b>{{materialegislativa.ementa}}</b>

		<fieldset>
			<legend>Editar Autoria</legend>
			<ul class="small-block-grid-3 medium-block-grid-3 large-block-grid-3">
				<li>Tipo do Autor</li>
				<li>Nome Autor</li>
				<li>Primeiro Autor</li>
			</ul>
			<form method="POST">
				{% csrf_token %}

				<ul class="small-block-grid-3 medium-block-grid-3 large-block-grid-3">
					<li>
						<select name="tipo_autor" onChange="form.submit();">
							{% for tipo in tipo_autores %}
								<option value="{{tipo.id}}" {% if tipo.id == tipo_autor_id %} selected {% endif %}>
									{{tipo.descricao}}
								</option>
							{% endfor %}
						</select>
					</li>

					<li>
						<select name="nome_autor">
							{% for a in autores %}
								{% if a.tipo_id == tipo_autor_id %}
									<option value="{{a.id}}" {% if a.id == autor_id%} selected {% endif %}>
										{{a}}
									</option>
								{% endif %}
							{% endfor %}
						</select>
					</li>

					<li>
						<select name="primeiro_autor">
							<option value="1">Sim</option>
							<option value="0" selected>Não</option>
						</select>
					</li>
				</ul>
				<input type="submit" name="salvar" value="Salvar" class="button primary">
			</form>
		</fieldset>
	</fieldset>
{% endblock %}