{% extends "materia/materialegislativa_detail.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block actions %} {% endblock %}
{% block detail_content %}
	<fieldset>
		<legend>Matéria Legislativa</legend>
    <div class="row">
      <div class="col-md-4">Tipo: <b>{{object.tipo.sigla}}</b></div>
      <div class="col-md-4">Número: <b>{{object.numero}}</b></div>
      <div class="col-md-4">Ano: <b>{{object.ano}}</b></div>
    </div>
		Ementa: <b>{{object.ementa}}</b>

		<fieldset>
			<legend>Editar Documento Acessório</legend>
				<form method="POST">
					{% csrf_token %}
          <div class="row">
            <div class="col-md-4">
              <labe>Tipo*</labe>
              <select name="tipo">
                {% for t in tipos %}
                <option value="{{t.id}}" {% if t.id == doc.tipo.id %} selected {% endif %}>
                {{t.descricao}}
                </option>
                {% endfor %}
              </select>
            </div>

            <div class="col-md-4">
              <labe>Data</labe>
              <input type="text" name="data" class="dateinput" value="{{doc.data|date:'d/m/Y'}}" />
            </div>

            <div class="col-md-4">
              <labe>Nome*</labe>
              <input type="text" name="nome" value="{{doc.nome}}" />
            </div>
          </div>

          <div class="row">
            <div class="col-md-6">
              <labe>Autor*</labe>
              <input type="text" name="autor" value="{{doc.autor}}" />
            </div>

            <div class="col-md-6">
              <labe>Ementa*</labe>
              <input type="text" name="ementa" value="{{doc.ementa}}" />
            </div>
          </div>
					<input type="submit" value="Salvar" id="salvar" name="salvar" class="primary button" />
					<input type="submit" value="Excluir" id="excluir" name="excluir" class="primary button" />
				</form>
		</fieldset>
	</fieldset>
{% endblock %}