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. 59
      sapl/templates/materia/acessorio_lote.html

4
sapl/materia/views.py

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

59
sapl/templates/materia/acessorio_lote.html

@ -18,17 +18,60 @@
{% else %} {% else %}
<tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr> <tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr>
{% endif %} {% 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>
<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"> <table class="table table-striped table-hover">
<thead> <thead>
<tr> <tr><th>Matéria</th></tr>
<th>Matérias</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<form method="POST">
{% csrf_token %}
{% for materia in object_list %} {% for materia in object_list %}
<tr> <tr>
<td> <td>
@ -37,8 +80,10 @@
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</form>
</tbody> </tbody>
</table> </table>
</fieldset>
<input type="submit" value="Salvar" class="btn btn-primary"S>
</form>
{% endif %} {% endif %}
{% endblock detail_content %} {% endblock detail_content %}

Loading…
Cancel
Save