Browse Source

finish the create view

pull/2260/head
Mariana Mendes 7 years ago
parent
commit
bef19a3c61
  1. 12
      sapl/sessao/forms.py
  2. 2
      sapl/templates/sessao/justificativaausencia_form.html
  3. 12
      sapl/utils.py

12
sapl/sessao/forms.py

@ -18,7 +18,7 @@ from sapl.materia.models import (MateriaLegislativa, StatusTramitacao,
from sapl.parlamentares.models import Parlamentar, Legislatura, Mandato
from sapl.utils import (RANGE_DIAS_MES, RANGE_MESES,
MateriaPesquisaOrderingFilter, autor_label,
ausencia_expediente, ausencia_ordem, autor_modal, timezone)
ausencia_materia, autor_modal, timezone)
from .models import (Bancada, Bloco, ExpedienteMateria, JustificativaAusencia,
Orador, OradorExpediente, OrdemDia, SessaoPlenaria,
@ -707,9 +707,9 @@ class JustificativaAusenciaForm(ModelForm):
row3 = to_row(
[('upload_anexo', 6)])
row4 = to_row(
[('tipo_ausencia', 6)])
[('tipo_ausencia', 12)])
row5 = to_row(
[('ausencia', 6)])
[('ausencia', 12)])
row6 = to_row(
[('observacao', 12)])
@ -718,9 +718,9 @@ class JustificativaAusenciaForm(ModelForm):
Fieldset(_('Justificativa de Ausência'),
row1, row2, row3,
row4, row5,
HTML(ausencia_expediente),
HTML(ausencia_ordem),
row6,)
HTML(ausencia_materia),
row6,
form_actions(label='Salvar'))
)
super(JustificativaAusenciaForm, self).__init__(
*args, **kwargs)

2
sapl/templates/sessao/justificativaausencia_create.html → sapl/templates/sessao/justificativaausencia_form.html

@ -5,9 +5,7 @@
{% crispy form %}
{% endblock detail_content %}
{% block extra_js %}
<script type="text/javascript">
$(function () {
$("#id_ausencia").change(function() {

12
sapl/utils.py

@ -87,32 +87,32 @@ autor_modal = '''
</div>
'''
ausencia_expediente = '''
ausencia_materia = '''
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<div class="controls" id="show_materia" class="show_materia" type="hidden">
{% for e in expedientes %}
<div class="checkbox">
<label for="show_materia">
Expediente Matéria:
<input type="checkbox" name="materia" value="{{ e.materia }}" {% if check %} checked {% endif %}/>
{{ e.materia }}
</label>
</div>
{% endfor %}
</div>
'''
ausencia_ordem = '''
<div class="controls" id="show_materia" class="show_materia" type="hidden">
{% for o in ordens %}
<div class="checkbox" >
<label for="show_materia">
Ordem Dia Matéria:
<input type="checkbox" name="materia" value="{{ o.materia }}" {% if check %} checked {% endif %}/>
{{ o.materia }}
</label>
</div>
{% endfor %}
</div>
<br/>
'''
def montar_row_autor(name):
autor_row = to_row(
[(name, 0),

Loading…
Cancel
Save