Browse Source

Adiciona formulário com campos do documento acessório

pull/583/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
513a545ace
  1. 4
      sapl/materia/views.py
  2. 87
      sapl/templates/materia/acessorio_lote.html

4
sapl/materia/views.py

@ -1264,9 +1264,13 @@ class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView):
return context
qr = self.request.GET.copy()
context['tipos_docs'] = TipoDocumento.objects.all()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
return context
def post(self, request, *args, **kwargs):
return self.get(request, self.kwargs)
# def post(self, request, *args, **kwargs):
# marcadas = request.POST.getlist('materia_id')
#

87
sapl/templates/materia/acessorio_lote.html

@ -18,27 +18,72 @@
{% else %}
<tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr>
{% endif %}
<form method="POST">
{% csrf_token %}
<fieldset>
<legend>Documento Acessório</legend>
<div class="row">
<div class="col-md-4">
<label>Tipo*</label>
<select name="legislatura" class="form-control" required="True">
{% for t in tipos_docs %} <option>{{t}}</option> {% endfor %}
</select>
</div>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Matérias</th>
</tr>
</thead>
<tbody>
<form method="POST">
{% csrf_token %}
{% for materia in object_list %}
<tr>
<td>
<input type="checkbox" name="materia_id" value="{{materia.id}}" {% if check %} checked {% endif %}/>
{{materia.tipo.sigla}} {{materia.numero}}/{{materia.ano}} - {{materia.tipo.descricao}}
</td>
</tr>
{% endfor %}
</form>
</tbody>
</table>
<div class="col-md-4">
<label>Nome*</label>
<input type="text" name="nome" class="form-control" required="True">
</div>
<div class="col-md-4">
<label>Data*</label>
<input type="text" name="data "class="form-control dateinput" required="True">
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Autor*</label>
<input type="text" name="autor" class="form-control" required="True">
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Ementa</label>
<textarea name="ementa" class="textarea form-control" cols="40" rows="10"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Texto Integral*</label>
<input type="file" name="autor" required="True">
</div>
</div>
</fieldset>
<br /><br /><br />
<fieldset>
<legend>Matérias para inclusão do Documento Acessório</legend>
<table class="table table-striped table-hover">
<thead>
<tr><th>Matéria</th></tr>
</thead>
<tbody>
{% for materia in object_list %}
<tr>
<td>
<input type="checkbox" name="materia_id" value="{{materia.id}}" {% if check %} checked {% endif %}/>
{{materia.tipo.sigla}} {{materia.numero}}/{{materia.ano}} - {{materia.tipo.descricao}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</fieldset>
<input type="submit" value="Salvar" class="btn btn-primary"S>
</form>
{% endif %}
{% endblock detail_content %}

Loading…
Cancel
Save