mirror of https://github.com/interlegis/sapl.git
Browse Source
* Create Tipo Justificativa * Adding the migrate * Adding justificativa on map rules * WIP Co-authored-by: João Pedro Sconetto <sconetto.joao@gmail.com> * wip * Adding the migration * fix #1801 * fix #1801 * Fix the reverse url * Fix #1801 * Adding the migrations * Fix #1801 * fix #1801 * fix #1801 * Remove ipdb * Adding anexo on justificativa sessao * Fixing some issues on map rules * wip * ajusta layout_key e corrige __init__ em form * finish the create view * Remove the template name from create view * fixing conflicts with the migration * isola em um commit ajustes de pep8 * add ao justifitiva de ausência m2m para registro do tipo matéria * add apenas os presentes la lista de parlamentares * Remove código desnecessário * ajusta crud de justificativaausencia * Remove the detail viewc * Corrige o template de sistema * muda combo de parlamentares * Adiciona a justificativa de ausência no rules_group_sessaopull/2365/head 3.1.132
Mariana Mendes
6 years ago
committed by
Edward
13 changed files with 416 additions and 21 deletions
@ -0,0 +1,52 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-10-24 10:48 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import sapl.sessao.models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0025_auto_20180924_1724'), |
|||
('sessao', '0027_auto_20181023_1239'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='JustificativaAusencia', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('data', models.DateField(verbose_name='Data')), |
|||
('hora', models.CharField(max_length=5, verbose_name='Horário (hh:mm)')), |
|||
('observacao', models.TextField(blank=True, max_length=150, verbose_name='Observação')), |
|||
('ausencia', models.PositiveIntegerField(choices=[(1, 'Matéria'), (2, 'Sessão')], default=1, verbose_name='Ausente em')), |
|||
('upload_anexo', models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.anexo_upload_path, verbose_name='Anexo de Justificativa')), |
|||
('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar')), |
|||
('sessao_plenaria', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sessao.SessaoPlenaria', verbose_name='Sessão Plenária')), |
|||
], |
|||
options={ |
|||
'verbose_name': 'Justificativa de Ausência', |
|||
'verbose_name_plural': 'Justificativas de Ausências', |
|||
}, |
|||
), |
|||
migrations.CreateModel( |
|||
name='TipoJustificativa', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('descricao', models.CharField(max_length=150, verbose_name='Descrição')), |
|||
], |
|||
options={ |
|||
'verbose_name': 'Tipo de Justificativa', |
|||
'verbose_name_plural': 'Tipos de Justificativa', |
|||
'ordering': ['descricao'], |
|||
}, |
|||
), |
|||
migrations.AddField( |
|||
model_name='justificativaausencia', |
|||
name='tipo_ausencia', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoJustificativa', verbose_name='Tipo de Justificativa'), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-10-24 12:52 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('sessao', '0028_auto_20181024_0848'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='justificativaausencia', |
|||
name='materias_da_ordem_do_dia', |
|||
field=models.ManyToManyField(blank=True, to='sessao.OrdemDia', verbose_name='Matérias do Ordem do Dia'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='justificativaausencia', |
|||
name='materias_do_expediente', |
|||
field=models.ManyToManyField(blank=True, to='sessao.ExpedienteMateria', verbose_name='Matérias do Expediente'), |
|||
), |
|||
] |
@ -0,0 +1,6 @@ |
|||
{% extends "crud/detail.html" %} |
|||
{% load i18n %} |
|||
{% load crispy_forms_tags %} |
|||
{% block detail_content %} |
|||
{% crispy form %} |
|||
{% endblock detail_content %} |
@ -0,0 +1,25 @@ |
|||
{% extends "crud/form.html" %} |
|||
{% load i18n %} |
|||
{% load crispy_forms_tags %} |
|||
{% block detail_content %} |
|||
{% crispy form %} |
|||
{% endblock detail_content %} |
|||
|
|||
{% block extra_js %} |
|||
<script type="text/javascript"> |
|||
$(function () { |
|||
$("#id_ausencia").change(function() { |
|||
var val = $(this).val(); |
|||
if(val === "1") { |
|||
$("#div_id_materias_do_expediente, #div_id_materias_da_ordem_do_dia").show(); |
|||
} |
|||
else if(val === "2") { |
|||
$("#div_id_materias_do_expediente, #div_id_materias_da_ordem_do_dia").hide(); |
|||
} |
|||
}); |
|||
$("#id_ausencia").change() |
|||
}); |
|||
</script> |
|||
|
|||
{% endblock %} |
|||
|
Loading…
Reference in new issue