mirror of https://github.com/interlegis/sigi.git
Sesostris Vieira
4 years ago
165 changed files with 6986 additions and 14918 deletions
@ -1,24 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
|
|||
class MoodleRouter(object): |
|||
|
|||
def db_for_read(self, model, **hints): |
|||
if model._meta.app_label == 'mdl': |
|||
return 'moodle' |
|||
return None |
|||
|
|||
def db_for_write(self, model, **hints): |
|||
if model._meta.app_label == 'mdl': |
|||
return 'moodle' |
|||
return None |
|||
|
|||
def allow_relation(self, obj1, obj2, **hints): |
|||
if obj1._meta.app_label == 'mdl' and obj2._meta.app_label == 'mdl': |
|||
return True |
|||
return None |
|||
|
|||
def allow_migrate(self, db, model): |
|||
if model._meta.app_label == 'mdl': |
|||
return False |
|||
return None |
File diff suppressed because it is too large
@ -1,16 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from dados_gerentes import atrib, gerentes |
|||
from sigi.apps.casas.models import CasaLegislativa |
|||
|
|||
|
|||
def salvar(): |
|||
for cod, abrev_gerente in atrib: |
|||
casas = CasaLegislativa.objects.filter(municipio__codigo_ibge=cod, tipo__sigla='CM') |
|||
if not casas: |
|||
print '############################# SEM CASA: ', cod |
|||
elif len(casas) > 1: |
|||
print '############################# VÁRIAS CASAS: ', cod, casas |
|||
else: |
|||
[c] = casas |
|||
c.gerente_contas = gerentes[abrev_gerente] |
|||
c.save() |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0002_auto_20150710_1247'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='casalegislativa', |
|||
name='horario_funcionamento', |
|||
field=models.CharField(max_length=100, verbose_name='Hor\xe1rio de funcionamento da Casa Legislativa', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='data_nascimento', |
|||
field=models.DateField(null=True, verbose_name='Data de nascimento', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0003_auto_20200207_0919'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='gerente_contas', |
|||
field=models.ForeignKey(related_name='casas_que_gerencia_old', verbose_name=b'Gerente de contas', blank=True, to='servidores.Servidor', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('servidores', '0001_initial'), |
|||
('casas', '0004_auto_20201015_0810'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='casalegislativa', |
|||
name='gerentes_interlegis', |
|||
field=models.ManyToManyField(related_name='casas_que_gerencia', verbose_name=b'Gerentes Interlegis', to='servidores.Servidor'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0005_casalegislativa_gerentes_interlegis'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RemoveField( |
|||
model_name='casalegislativa', |
|||
name='gerente_contas', |
|||
), |
|||
] |
@ -0,0 +1,128 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0006_remove_casalegislativa_gerente_contas'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='desativado', |
|||
field=models.BooleanField(default=False, verbose_name='Desativado'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='observacoes', |
|||
field=models.TextField(verbose_name='Observa\xe7\xf5es', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='bairro', |
|||
field=models.CharField(max_length=100, verbose_name='Bairro', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='cep', |
|||
field=models.CharField(max_length=32, verbose_name='CEP'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='codigo_interlegis', |
|||
field=models.CharField(max_length=3, verbose_name='C\xf3digo Interlegis', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='email', |
|||
field=models.EmailField(max_length=128, verbose_name='E-mail', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='foto', |
|||
field=models.ImageField(upload_to=b'imagens/casas', width_field=b'foto_largura', height_field=b'foto_altura', blank=True, verbose_name='Foto'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='inclusao_digital', |
|||
field=models.CharField(default=b'NAO PESQUISADO', max_length=30, verbose_name='Inclus\xe3o digital', choices=[(b'NAO PESQUISADO', 'N\xe3o pesquisado'), (b'NAO POSSUI PORTAL', 'N\xe3o possui portal'), (b'PORTAL MODELO', 'Possui Portal Modelo'), (b'OUTRO PORTAL', 'Possui outro portal')]), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='logradouro', |
|||
field=models.CharField(help_text='Avenida, rua, pra\xe7a, jardim, parque...', max_length=100, verbose_name='Logradouro'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='municipio', |
|||
field=models.ForeignKey(verbose_name='Munic\xedpio', to='contatos.Municipio'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='nome', |
|||
field=models.CharField(help_text='Exemplo: <em>C\xe2mara Municipal de Pains</em>.', max_length=60, verbose_name='Nome'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='casalegislativa', |
|||
name='pagina_web', |
|||
field=models.URLField(help_text='Exemplo: <em>http://www.camarapains.mg.gov.br</em>.', verbose_name='P\xe1gina web', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='cargo', |
|||
field=models.CharField(max_length=100, null=True, verbose_name='Cargo', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='nota', |
|||
field=models.CharField(max_length=70, null=True, verbose_name='Telefones', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='setor', |
|||
field=models.CharField(default=b'outros', max_length=100, verbose_name='Setor', choices=[(b'presidente', 'Presidente'), (b'contato_interlegis', 'Contato Interlegis'), (b'infraestrutura_fisica', 'Infraestrutura F\xedsica'), (b'estrutura_de_ti', 'Estrutura de TI'), (b'organizacao_do_processo_legislativo', 'Organiza\xe7\xe3o do Processo Legislativo'), (b'producao_legislativa', 'Produ\xe7\xe3o Legislativa'), (b'estrutura_de_comunicacao_social', 'Estrutura de Comunica\xe7\xe3o Social'), (b'estrutura_de_recursos_humanos', 'Estrutura de Recursos Humanos'), (b'gestao', 'Gest\xe3o'), (b'outros', 'Outros')]), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='sexo', |
|||
field=models.CharField(default=b'M', max_length=1, verbose_name='Sexo', choices=[(b'M', 'Masculino'), (b'F', 'Feminino')]), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='tempo_de_servico', |
|||
field=models.CharField(max_length=50, null=True, verbose_name='Tempo de servi\xe7o', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='tipocasalegislativa', |
|||
name='nome', |
|||
field=models.CharField(max_length=100, verbose_name='Nome'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='tipocasalegislativa', |
|||
name='sigla', |
|||
field=models.CharField(max_length=5, verbose_name='Sigla'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,45 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('contatos', '0002_auto_20151104_0810'), |
|||
('casas', '0007_auto_20201016_1632'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='bairro', |
|||
field=models.CharField(max_length=100, verbose_name='Bairro', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='cep', |
|||
field=models.CharField(max_length=10, verbose_name='CEP', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='endereco', |
|||
field=models.CharField(max_length=100, verbose_name='Endere\xe7o', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='municipio', |
|||
field=models.ForeignKey(verbose_name='Municipio', to='contatos.Municipio', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='funcionario', |
|||
name='redes_sociais', |
|||
field=models.TextField(help_text='Colocar um por linha', verbose_name='Redes sociais', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0008_auto_20210218_1007'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='municipio', |
|||
field=models.ForeignKey(verbose_name='Municipio', blank=True, to='contatos.Municipio', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0009_auto_20210406_1055'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameModel( |
|||
old_name='TipoCasaLegislativa', |
|||
new_name='TipoOrgao', |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0010_auto_20210406_1101'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='tipoorgao', |
|||
options={'verbose_name': 'Tipo de \xf3rg\xe3o', 'verbose_name_plural': 'Tipos de \xf3rg\xe3o'}, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0011_auto_20210406_1135'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='tipoorgao', |
|||
options={}, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0012_auto_20210406_1420'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='tipoorgao', |
|||
options={'verbose_name': 'Tipo de \xf3rg\xe3o', 'verbose_name_plural': 'Tipos de \xf3rg\xe3o'}, |
|||
), |
|||
] |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import image_cropping.fields |
|||
import sigi.apps.utils |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
# ('metas', '0002_auto_20210406_1945'), |
|||
('contatos', '0002_auto_20151104_0810'), |
|||
('servidores', '0001_initial'), |
|||
# ('parlamentares', '0002_auto_20210406_1945'), |
|||
# ('servicos', '0005_auto_20210406_1945'), |
|||
('servicos', '0004_delete_casaatendida'), |
|||
# ('inventario', '0002_auto_20210406_1945'), |
|||
# ('convenios', '0003_auto_20210406_1945'), |
|||
# ('ocorrencias', '0003_auto_20210406_1945'), |
|||
# ('diagnosticos', '0004_auto_20210406_1945'), |
|||
# ('eventos', '0005_auto_20210406_1945'), |
|||
('casas', '0013_auto_20210406_1428'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameModel( |
|||
old_name='CasaLegislativa', |
|||
new_name='Orgao', |
|||
), |
|||
] |
@ -0,0 +1,28 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0014_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='orgao', |
|||
options={'ordering': ('nome',), 'verbose_name': '\xd3rg\xe3o', 'verbose_name_plural': '\xd3rg\xe3os'}, |
|||
), |
|||
migrations.AddField( |
|||
model_name='tipoorgao', |
|||
name='legislativo', |
|||
field=models.BooleanField(default=False, verbose_name='Poder legislativo'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterUniqueTogether( |
|||
name='orgao', |
|||
unique_together=set([]), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0015_auto_20210407_0801'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='orgao', |
|||
name='gerentes_interlegis', |
|||
field=models.ManyToManyField(related_name='casas_que_gerencia', verbose_name='Gerentes Interlegis', to='servidores.Servidor', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,45 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0016_auto_20210407_1559'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(verbose_name='\xf3rg\xe3o', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='municipio', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='Municipio', blank=True, to='contatos.Municipio', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='orgao', |
|||
name='municipio', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Munic\xedpio', to='contatos.Municipio'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='orgao', |
|||
name='pesquisador', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='Pesquisador', blank=True, to='servidores.Servidor', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='orgao', |
|||
name='tipo', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Tipo', to='casas.TipoOrgao'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0017_auto_20210416_0841'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='orgao', |
|||
name='sigla', |
|||
field=models.CharField(max_length=30, verbose_name='sigla do \xf3rg\xe3o', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0018_orgao_sigla'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='email', |
|||
field=models.CharField(max_length=250, verbose_name='e-mail', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='funcionario', |
|||
name='nota', |
|||
field=models.CharField(max_length=250, null=True, verbose_name='Telefones', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('casas', '0019_auto_20210501_1058'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='tipoorgao', |
|||
options={'ordering': ('nome',), 'verbose_name': 'Tipo de \xf3rg\xe3o', 'verbose_name_plural': 'Tipos de \xf3rg\xe3o'}, |
|||
), |
|||
] |
@ -0,0 +1,164 @@ |
|||
{% load i18n admin_static admin_modify bootstrapped_goodies_tags %} |
|||
<div class="_inline-group" id="{{ inline_admin_formset.formset.prefix }}-group"> |
|||
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}"> |
|||
{{ inline_admin_formset.formset.management_form }} |
|||
<fieldset class="module"> |
|||
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2> |
|||
{{ inline_admin_formset.formset.non_form_errors }} |
|||
<table class="table table-striped table-bordered"> |
|||
<thead><tr> |
|||
{% for field in inline_admin_formset.fields %} |
|||
{% if not field.widget.is_hidden %} |
|||
<th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }} |
|||
{% if field.help_text %}<i class="glyphicon glyphicon-comment help help-tooltip" style="margin-left: 4px;" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}"></i>{% endif %} |
|||
</th> |
|||
{% endif %} |
|||
{% endfor %} |
|||
{% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %} |
|||
</tr></thead> |
|||
|
|||
<tbody> |
|||
{% for inline_admin_form in inline_admin_formset %} |
|||
{% if inline_admin_form.form.non_field_errors %} |
|||
<tr><td colspan="{{ inline_admin_form|cell_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr> |
|||
{% endif %} |
|||
<tr class="form-row {% cycle "row1" "row2" %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last %} empty-form{% endif %}" |
|||
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}"> |
|||
<td class="original"> |
|||
{% if inline_admin_formset.opts.sortable_field_name %} |
|||
<span class="btn btn-default btn-xs drag-handler pull-left"><i class="glyphicon glyphicon-move"></i></span> |
|||
{% endif %} |
|||
{% if inline_admin_form.original or inline_admin_form.show_url %}<p> |
|||
{% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %} |
|||
{% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %} |
|||
</p>{% endif %} |
|||
{% if inline_admin_form.has_auto_field or inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %} |
|||
{{ inline_admin_form.fk_field.field }} |
|||
{% spaceless %} |
|||
{% for fieldset in inline_admin_form %} |
|||
{% for line in fieldset %} |
|||
{% for field in line %} |
|||
{% if field.is_hidden %} {{ field.field }} {% endif %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endspaceless %} |
|||
</td> |
|||
{% for fieldset in inline_admin_form %} |
|||
{% for line in fieldset %} |
|||
{% for field in line %} |
|||
<td{% if field.field.name %} class="field-{{ field.field.name }}"{% endif %}> |
|||
{% if field.is_readonly %} |
|||
<p>{{ field.contents }}</p> |
|||
{% else %} |
|||
{% if field.errors %} |
|||
<div class="alert alert-danger">{{ field.errors|striptags }}</div> |
|||
{% endif %} |
|||
{% dab_field_rendering field.field %} |
|||
{% endif %} |
|||
</td> |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
{% if inline_admin_formset.formset.can_delete %} |
|||
<td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td> |
|||
{% endif %} |
|||
</tr> |
|||
{% endfor %} |
|||
<tr><td colspan="100"> |
|||
<a href="{% url 'admin:ocorrencias_ocorrencia_add' %}?casa_legislativa={{original.pk|safe}}"> |
|||
<span class="glyphicon glyphicon-plus"></span>{% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %} |
|||
</a> |
|||
</td></tr> |
|||
</tbody> |
|||
</table> |
|||
</fieldset> |
|||
</div> |
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
(function($) { |
|||
$(document).ready(function($) { |
|||
var rows = "#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr"; |
|||
var alternatingRows = function(row) { |
|||
$(rows).not(".add-row").removeClass("row1 row2") |
|||
.filter(":even").addClass("row1").end() |
|||
.filter(rows + ":odd").addClass("row2"); |
|||
} |
|||
var reinitDateTimeShortCuts = function() { |
|||
// Reinitialize the calendar and clock widgets by force |
|||
if (typeof DateTimeShortcuts != "undefined") { |
|||
$(".datetimeshortcuts").remove(); |
|||
DateTimeShortcuts.init(); |
|||
} |
|||
} |
|||
var updateSelectFilter = function() { |
|||
// If any SelectFilter widgets are a part of the new form, |
|||
// instantiate a new SelectFilter instance for it. |
|||
if (typeof SelectFilter != "undefined"){ |
|||
$(".selectfilter").each(function(index, value){ |
|||
var namearr = value.name.split('-'); |
|||
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% static "admin/" %}"); |
|||
}); |
|||
$(".selectfilterstacked").each(function(index, value){ |
|||
var namearr = value.name.split('-'); |
|||
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}"); |
|||
}); |
|||
} |
|||
} |
|||
var initPrepopulatedFields = function(row) { |
|||
row.find('.prepopulated_field').each(function() { |
|||
var field = $(this); |
|||
var input = field.find('input, select, textarea'); |
|||
var dependency_list = input.data('dependency_list') || []; |
|||
var dependencies = []; |
|||
$.each(dependency_list, function(i, field_name) { |
|||
dependencies.push('#' + row.find('.field-' + field_name).find('input, select, textarea').attr('id')); |
|||
}); |
|||
if (dependencies.length) { |
|||
input.prepopulate(dependencies, input.attr('maxlength')); |
|||
} |
|||
}); |
|||
} |
|||
$(rows).formset({ |
|||
prefix: "{{ inline_admin_formset.formset.prefix }}", |
|||
addText: "{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|title %}Add another {{ verbose_name }}{% endblocktrans %}", |
|||
formCssClass: "dynamic-{{ inline_admin_formset.formset.prefix }}", |
|||
deleteCssClass: "inline-deletelink", |
|||
deleteText: "{% trans "Remove" %}", |
|||
emptyCssClass: "empty-form", |
|||
removed: alternatingRows, |
|||
added: (function(row) { |
|||
initPrepopulatedFields(row); |
|||
reinitDateTimeShortCuts(); |
|||
updateSelectFilter(); |
|||
alternatingRows(row); |
|||
}) |
|||
}); |
|||
}); |
|||
})(django.jQuery); |
|||
|
|||
// listener for jquery 1.7.2 |
|||
(function($) { |
|||
{% if inline_admin_formset.opts.sortable_field_name %} |
|||
$('tbody').sortable({ |
|||
// items: '.dynamic-{{ inline_admin_formset.formset.prefix }}', |
|||
handle: '.drag-handler', |
|||
items: ".form-row" |
|||
}); |
|||
$("#{{ opts.model_name }}_form").submit(function(e) { |
|||
var sortable_field_name = "{{ inline_admin_formset.opts.sortable_field_name }}", |
|||
i = 0; |
|||
var initial_form_count = $('#id_{{ inline_admin_formset.formset.prefix }}-INITIAL_FORMS').val(); |
|||
|
|||
$('#{{ inline_admin_formset.formset.prefix }}-group table > tbody').find(".form-row").each(function(i, e) { |
|||
// make sure we don't assign a position unless extra has been moved |
|||
if ($(this).find("input[name$='" + sortable_field_name + "']").val() || (i <= initial_form_count - 1 )) { |
|||
$(this).find("input[name$='" + sortable_field_name + "']").val(i); |
|||
i++; |
|||
} |
|||
}); |
|||
}); |
|||
{% endif %} |
|||
})(jQuery); |
|||
</script> |
@ -0,0 +1,57 @@ |
|||
{% extends "admin/base_site.html" %} |
|||
{% load i18n admin_static %} |
|||
{% load static from staticfiles %} |
|||
|
|||
{% block coltype %}colMS{% endblock %} |
|||
|
|||
{% block content_title %}<h1>{% blocktrans %}Gerentes Interlegis{% endblocktrans %}</h1>{% endblock %} |
|||
|
|||
{% block content %} |
|||
<div id="navbar-object-tools" class="nav"> |
|||
<ul class="nav navbar-nav navbar-left"> |
|||
<li><a href="?fmt=pdf"> |
|||
<span class="glyphicon glyphicon-print"></span> |
|||
Relatório PDF |
|||
</a></li> |
|||
<li><a href="?fmt=csv&casas=yes"> |
|||
<span class="glyphicon glyphicon-list-alt"></span> |
|||
CSV com casas |
|||
</a></li> |
|||
<li><a href="?fmt=csv&casas=no"> |
|||
<span class="glyphicon glyphicon-list-alt"></span> |
|||
CSV sem casas |
|||
</a></li> |
|||
</ul> |
|||
</div> |
|||
|
|||
<div id="content" class="colM"> |
|||
{% for linha in gerentes %} |
|||
<div class="panel panel-primary"> |
|||
<div class="panel-heading"> |
|||
<p>{{ linha.gerente.nome_completo }} <span class="badge">{{ linha.gerente.casas_que_gerencia.count }}</span></p> |
|||
</div> |
|||
<div class="panel-body"> |
|||
<ul class="nav nav-pills" role="tablist"> |
|||
{% for uf in linha.ufs %} |
|||
<li role="presentation"> |
|||
<a href="#tab{{ linha.gerente.id }}-{{ uf.0 }}" aria-controls="tab{{ linha.gerente.id }}-{{ uf.0 }}" role="tab" data-toggle="tab">{{ uf.1 }} <span class="badge">{{ uf.2|length }}</span></a> |
|||
</li> |
|||
{% endfor %} |
|||
</ul> |
|||
<div class="tab-content"> |
|||
{% for uf in linha.ufs %} |
|||
<div role="tabpanel" class="tab-pane" id="tab{{ linha.gerente.id }}-{{ uf.0 }}"> |
|||
<ul class="list-group list-inline"> |
|||
{% for casa in uf.2 %} |
|||
<li class="list-group-item list-inline-item"> |
|||
<a href="{% url 'admin:casas_orgao_change' casa.id %}" target="_blank">{{ casa }}</a></li> |
|||
{% endfor %} |
|||
</ul> |
|||
</div> |
|||
{% endfor %} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{% endfor %} |
|||
</div> |
|||
{% endblock %} |
@ -0,0 +1,143 @@ |
|||
{% load static from staticfiles %} |
|||
{% load i18n %} |
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|||
<html> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>Casa Legislativa</title> |
|||
<style type="text/css"> |
|||
table { |
|||
padding: 3px; |
|||
line-height: 1em; |
|||
-fs-table-paginate: paginate; |
|||
} |
|||
thead { |
|||
display: table-header-group; |
|||
} |
|||
th { |
|||
font-weight: bold; |
|||
text-align: left; |
|||
} |
|||
th, td { |
|||
border-bottom: 1px solid #ddd; |
|||
vertical-align: top; |
|||
} |
|||
td.logo { |
|||
text-align: center; |
|||
} |
|||
td.header_text p { |
|||
margin: 0px; |
|||
font-size: 1.4em; |
|||
} |
|||
td.header_text { |
|||
width: 550px; |
|||
} |
|||
ul { |
|||
list-style-type: none; |
|||
padding-left: 15px; |
|||
} |
|||
li { |
|||
padding-left: 5px; |
|||
color: #999; |
|||
} |
|||
li.selected { |
|||
list-style-type: disc; |
|||
color: #000; |
|||
font-weight: bold; |
|||
} |
|||
p.strong { |
|||
margin-left: 25px; |
|||
line-height: 1em; |
|||
} |
|||
h1 { |
|||
font-size: 2em; |
|||
text-align: center; |
|||
} |
|||
h2 { |
|||
font-size: 1.7em; |
|||
} |
|||
h3 { |
|||
margin-top: 10px; |
|||
margin-bottom: 0px; |
|||
} |
|||
body { |
|||
font-family: "Helvetica, Arial, sans-serif"; |
|||
font-size: 1.3em; |
|||
line-height: 1em; |
|||
} |
|||
div.new_page { |
|||
page-break-before: always; |
|||
} |
|||
div.same_page_ { |
|||
-pdf-keep-with-next: true; |
|||
} |
|||
.text-right { |
|||
text-align: right; |
|||
} |
|||
@page { |
|||
margin: 4cm 1cm 1cm 2cm; |
|||
font-family: "Helvetica, Arial, sans-serif"; |
|||
font-size: 2em; |
|||
@frame header { |
|||
-pdf-frame-content: header; |
|||
top: 1cm; |
|||
} |
|||
@frame footer { |
|||
-pdf-frame-content: footer; |
|||
bottom: 0cm; |
|||
margin-left: 9cm; |
|||
margin-right: 9cm; |
|||
height: 1cm; |
|||
} |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div id="header"> |
|||
<table> |
|||
<tr> |
|||
<td class="logo"><img src="{% static 'img/logo-senado.jpg' %}"/></td> |
|||
<td class="header_text"> |
|||
<p><strong>{% trans 'SENADO FEDERAL' %}</strong></p> |
|||
<p><strong>{% trans 'ILB - Interlegis' %}</strong></p> |
|||
<p>{% trans 'Gerentes Interlegis' %}</p> |
|||
</td> |
|||
<td class="logo"><img src="{% static 'img/logo-interlegis.jpg' %}"/></td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
|
|||
<table> |
|||
<thead> |
|||
<tr> |
|||
<th>Gerente Interlegis</th> |
|||
<th>UF</th> |
|||
<th>Número de casas</th> |
|||
</tr> |
|||
</thead> |
|||
{% for linha in gerentes %} |
|||
{% for uf in linha.ufs %} |
|||
<tr> |
|||
{% if forloop.first %} |
|||
<td>{{ linha.gerente.nome_completo }}</td> |
|||
{% else %} |
|||
<td> </td> |
|||
{% endif %} |
|||
<td>{{ uf.1 }}</td> |
|||
<td class="text-right">{{ uf.2.count }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
<tr> |
|||
<td colspan="2"><strong>Total de casas atendidas por {{ linha.gerente.nome_completo }}</strong></td> |
|||
<td class="text-right"><strong>{{ linha.gerente.casas_que_gerencia.count }}</strong></td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
<div id="footer"> |
|||
{%block page_foot%} |
|||
{% trans 'Página' %} <pdf:pagenumber> |
|||
{%endblock%} |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,81 @@ |
|||
{% extends "admin/base_site.html" %} |
|||
{% load i18n bootstrap3 %} |
|||
|
|||
{% block content_title %} |
|||
<h1 class="pull-left">{% trans 'Importar dados para atualização de órgãos' %}</h1> |
|||
{% endblock %} |
|||
|
|||
{% block content %} |
|||
{% if error %} |
|||
<div class="alert alert-danger" role="alert"> |
|||
{{ error }} |
|||
</div> |
|||
{% endif %} |
|||
<div id="content-main"> |
|||
<form action="" method="post" enctype="multipart/form-data"> |
|||
{% csrf_token %} |
|||
<div class="form-group"> |
|||
{% bootstrap_form form %} |
|||
</div> |
|||
<input type="submit" value="Importar" class="btn btn-primary"/> |
|||
</form> |
|||
<div id="data-hints"> |
|||
<h3>Padrões do arquivo:</h3> |
|||
<ul class="list-group"> |
|||
<li class="list-group-item">O arquivo deve ter o formato de texto, no padrão CSV</li> |
|||
<li class="list-group-item">Deve-se usar pt-br.UTF-8 como codificação do arquivo</li> |
|||
<li class="list-group-item">A primeira linha do arquivo teve conter o cabeçalho das colunas, conforme explicado a seguir</li> |
|||
<li class="list-group-item">Cada linha subsequente deve referir-se a um e somente um órgão</li> |
|||
<li class="list-group-item">Campos deixados em branco serão ignorados</li> |
|||
</ul> |
|||
<hr/> |
|||
<h3>Colunas do arquivo:</h3> |
|||
<ul class="list-group"> |
|||
<li class="list-group-item">O arquivo deve possuir no mínimo as colunas marcadas como obrigatórias. |
|||
A primeira linha deve conter os cabeçalhos, que devem ser grafados |
|||
EXATAMENTE como descrito na tabela abaixo (minúsculas, sem acentos, sem espaços).</li> |
|||
<li class="list-group-item">É desejável que as colunas estejam na mesma ordem definida aqui.</li> |
|||
<li class="list-group-item">Colunas adicionais podem estar presentes, e serão ignoradas</li> |
|||
</ul> |
|||
<table class="table table-striped table-condensed"> |
|||
<thead class="thead-light"> |
|||
<tr> |
|||
<th>Obrigatório</th> |
|||
<th>Título do campo</th> |
|||
<th>Conteúdo esperado</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr><th>*</th><th>tipo</th><td>Deve conter CM para Câmara Municipal ou AL para Assembleia Legislativa</td></tr> |
|||
<tr><th>*</th><th>municipio</th><td>O nome do município. Não use abreviações!!!</td></tr> |
|||
<tr><th>*</th><th>uf</th><td>A sigla da Unidade da Federação (Estado) em letras maiúsculas (ex: MG, SP, PA)</td></tr> |
|||
<tr><th></th><th>orgao_endereco</th><td>O novo endereço do órgão.</td></tr> |
|||
<tr><th></th><th>orgao_bairro</th><td>O novo bairro do órgão</td></tr> |
|||
<tr><th></th><th>orgao_cep</th><td>O novo CEP do órgão</td></tr> |
|||
<tr><th></th><th>orgao_email</th><td>O novo e-mail institucional do órgão</td></tr> |
|||
<tr><th></th><th>orgao_portal</th><td>O novo endereço do portal institucional do órgão</td></tr> |
|||
<tr><th></th><th>orgao_telefones</th><td>Os telefones do órgão. Pode conter quantos telefones forem necessários, separando-os por ';'. Use a formatação padrão de telefones, mas não use ';' entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. </td></tr> |
|||
<tr><th></th><th>presidente_nome</th><td>O nome completo do presidente</td></tr> |
|||
<tr><th></th><th>presidente_data_nascimento</th><td>A data de nascimento do presidente no formato DD/MM/AAAA</td></tr> |
|||
<tr><th></th><th>presidente_telefones</th><td>Os telefones ou whatsapp do presidente. Pode conter quantos telefones forem necessários, separando-os por ';'. Use a formatação padrão de telefones, mas não use ';' entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes.</td></tr> |
|||
<tr><th></th><th>presidente_emails</th><td>Os e-mails do presidente. Pode conter quantos e-mails forem necessários. Utilize ';' para separar um e-mail do outro</td></tr> |
|||
<tr><th></th><th>presidente_endereco</th><td>O novo endereço do presidente</td></tr> |
|||
<tr><th></th><th>presidente_municipio</th><td>O nome do município onde mora o presidente</td></tr> |
|||
<tr><th></th><th>presidente_bairro</th><td>O nome do bairro onde mora o presidente</td></tr> |
|||
<tr><th></th><th>presidente_cep</th><td>O novo CEP do presidente</td></tr> |
|||
<tr><th></th><th>presidente_redes_sociais</th><td>As redes sociais do presidente. Pode conter quantas redes sociais forem necessárias. Utilize espaço para separar uma rede da outra.</td></tr> |
|||
<tr><th></th><th>contato_nome</th><td>O nome completo do contato</td></tr> |
|||
<tr><th></th><th>contato_data_nascimento</th><td>A data de nascimento do contato no formato DD/MM/AAAA</td></tr> |
|||
<tr><th></th><th>contato_telefones</th><td>Os telefones ou whatsapp do contato. Pode conter quantos telefones forem necessários, separando-os por ';'. Use a formatação padrão de telefones, mas não use ';' entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes.</td></tr> |
|||
<tr><th></th><th>contato_emails</th><td>Os e-mails do contato. Pode conter quantos e-mails forem necessários. Utilize ';' para separar um e-mail do outro</td></tr> |
|||
<tr><th></th><th>contato_endereco</th><td>O novo endereço do contato</td></tr> |
|||
<tr><th></th><th>contato_municipio</th><td>O nome do município onde mora o contato</td></tr> |
|||
<tr><th></th><th>contato_bairro</th><td>O nome do bairro onde mora o contato</td></tr> |
|||
<tr><th></th><th>contato_cep</th><td>O novo CEP do contato</td></tr> |
|||
<tr><th></th><th>contato_redes_sociais</th><td>As redes sociais do contato. Pode conter quantas redes sociais forem necessárias. Utilize espaço para separar uma rede da outra.</td></tr> |
|||
<tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
{% endblock %} |
|||
|
@ -0,0 +1,18 @@ |
|||
{% extends "admin/base_site.html" %} |
|||
{% load i18n %} |
|||
|
|||
{% block content_title %} |
|||
<h1 class="pull-left">Importação de órgãos concluída com {% if com_erros %}erros{% else %}sucesso!{% endif %}</h1> |
|||
{% endblock %} |
|||
|
|||
{% block content %} |
|||
<div id="content-main"> |
|||
<p>{{ total }} registros importados do arquivo {{ file_name }}</p> |
|||
{% if com_erros %} |
|||
<p>{{ com_erros }} registros apresentaram erros</p> |
|||
<p><a href="{{ MEDIA_URL }}temp/{{ result_file }}">Download do arquivo de erros</a></p> |
|||
{% endif %} |
|||
<p><a href="{% url 'importar-casas' %}">Importar outro arquivo</a></p> |
|||
</div> |
|||
{% endblock %} |
|||
|
@ -0,0 +1,237 @@ |
|||
{% load smart_if %} |
|||
{% load static from staticfiles %} |
|||
{% load i18n %} |
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|||
<html> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>Casa Legislativa</title> |
|||
<style type="text/css"> |
|||
table { |
|||
padding: 3px; |
|||
line-height: 1em; |
|||
-fs-table-paginate: paginate; |
|||
} |
|||
thead { |
|||
display: table-header-group; |
|||
} |
|||
th { |
|||
font-weight: bold; |
|||
text-align: left; |
|||
} |
|||
|
|||
th, td { |
|||
border-bottom: 1px solid #ddd; |
|||
} |
|||
|
|||
.identificacao th { |
|||
width: 20%; |
|||
} |
|||
|
|||
div#capa h3 { |
|||
text-align: center; |
|||
margin-top: 5px; |
|||
margin-bottom: 0px; |
|||
} |
|||
div#capa p { |
|||
text-align: center; |
|||
} |
|||
td.logo { |
|||
text-align: center; |
|||
} |
|||
td.header_text p { |
|||
margin: 0px; |
|||
font-size: 1.4em; |
|||
} |
|||
td.header_text { |
|||
width: 550px; |
|||
} |
|||
ul { |
|||
list-style-type: none; |
|||
padding-left: 15px; |
|||
} |
|||
li { |
|||
padding-left: 5px; |
|||
color: #999; |
|||
} |
|||
li.selected { |
|||
list-style-type: disc; |
|||
color: #000; |
|||
font-weight: bold; |
|||
} |
|||
p.strong { |
|||
margin-left: 25px; |
|||
line-height: 1em; |
|||
} |
|||
h1 { |
|||
font-size: 2em; |
|||
text-align: center; |
|||
} |
|||
h2 { |
|||
font-size: 1.7em; |
|||
} |
|||
h3 { |
|||
margin-top: 10px; |
|||
margin-bottom: 0px; |
|||
} |
|||
body { |
|||
font-family: "Helvetica, Arial, sans-serif"; |
|||
font-size: 1.3em; |
|||
line-height: 1em; |
|||
} |
|||
|
|||
div.new_page { |
|||
page-break-before: always; |
|||
} |
|||
div.same_page_ { |
|||
-pdf-keep-with-next: true; |
|||
} |
|||
@page { |
|||
size: {{ pagesize }}; |
|||
margin: 4cm 1cm 1cm 2cm; |
|||
font-family: "Helvetica, Arial, sans-serif"; |
|||
font-size: 2em; |
|||
@frame header { |
|||
-pdf-frame-content: header; |
|||
top: 1cm; |
|||
} |
|||
@frame footer { |
|||
-pdf-frame-content: footer; |
|||
bottom: 0cm; |
|||
margin-left: 9cm; |
|||
margin-right: 9cm; |
|||
height: 1cm; |
|||
} |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div id="header"> |
|||
<table> |
|||
<tr> |
|||
<td class="logo"><img src="{% static 'img/logo-senado.jpg' %}"/></td> |
|||
<td class="header_text"> |
|||
<p><strong>{% trans 'SENADO FEDERAL' %}</strong></p> |
|||
<p><strong>{% trans 'ILB - Interlegis' %}</strong></p> |
|||
<p>{% trans 'Relatório completo' %}</p> |
|||
</td> |
|||
<td class="logo"><img src="{% static 'img/logo-interlegis.jpg' %}"/></td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
|
|||
{% for casa in casas %} |
|||
<div class="{% if forloop.first %}{% else %}new_page{% endif %}"> |
|||
<h2>{{ casa.nome }}</h2> |
|||
<table class="identificacao"> |
|||
<tr><th>{% trans 'Presidente:' %}</th><td>{{ casa.presidente }}</td></tr> |
|||
<tr><th>{% trans 'Tipo:' %}</th><td>{{ casa.tipo.nome }}</td></tr> |
|||
<tr><th>{% trans 'Estado / região:' %}</th><td>{{ casa.municipio.uf.nome }} / {{ casa.municipio.uf.get_regiao_display }}</td></tr> |
|||
<tr><th>{% trans 'Município:' %}</th><td>{{ casa.municipio.nome }}</td></tr> |
|||
<tr><th>{% trans 'Endereço:' %}</th><td>{{ casa.logradouro }}</td></tr> |
|||
<tr><th>{% trans 'Bairro:' %}</th><td>{{ casa.bairro }}</td></tr> |
|||
<tr><th>{% trans 'CEP:' %}</th><td>{{ casa.cep }}</td></tr> |
|||
<tr><th>{% trans 'CNPJ:' %}</th><td>{{ casa.cnpj }}</td></tr> |
|||
<tr><th>{% trans 'Telefone:' %}</th><td>{{ casa.telefone }}</td></tr> |
|||
<tr><th>{% trans 'E-mail:' %}</th><td>{{ casa.email }}</td></tr> |
|||
</table> |
|||
|
|||
<h3>Telefones</h3> |
|||
|
|||
<table repeat="1"> |
|||
<thead> |
|||
<tr> |
|||
<th>Número</th> |
|||
<th>Tipo</th> |
|||
<th>Nota</th> |
|||
</tr> |
|||
<thead> |
|||
{% for tel in casa.telefones.all %} |
|||
<tr> |
|||
<td>{{ tel.numero }}</td> |
|||
<td>{{ tel.get_tipo_display }}</td> |
|||
<td>{{ tel.nota }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
<h3>Pessoas de contato</h3> |
|||
|
|||
<table repeat="1"> |
|||
<thead> |
|||
<tr> |
|||
<th>Nome</th> |
|||
<th>E-mail</th> |
|||
<th>Setor</th> |
|||
<th>Notas</th> |
|||
</tr> |
|||
</thead> |
|||
{% for func in casa.funcionario_set.all %} |
|||
<tr> |
|||
<td>{{ func.nome }}</td> |
|||
<td>{{ func.email }}</td> |
|||
<td>{{ func.get_setor_display }}</td> |
|||
<td>{{ func.nota }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
<h3>Convênios</h3> |
|||
|
|||
<table repeat="1"> |
|||
<thead> |
|||
<tr> |
|||
<th>Projeto</th> |
|||
<th>Nº convênio</th> |
|||
<th>Nº processo SF</th> |
|||
<th>Adesão</th> |
|||
<th>Convênio</th> |
|||
<th>Equipada</th> |
|||
<th>Publicada</th> |
|||
</tr> |
|||
</thead> |
|||
{% for conv in casa.convenio_set.all %} |
|||
<tr> |
|||
<td>{{ conv.projeto.nome }}</td> |
|||
<td>{{ conv.num_convenio|default_if_none:"-" }}</td> |
|||
<td>{{ conv.num_processo_sf|default_if_none:"-" }}</td> |
|||
<td>{{ conv.data_adesao|date:"SHORT_DATE_FORMAT" }}</td> |
|||
<td>{{ conv.data_retorno_assinatura|date:"SHORT_DATE_FORMAT" }}</td> |
|||
<td>{{ conv.equipada|yesno }}</td> |
|||
<td>{{ conv.data_pub_diario|date:"SHORT_DATE_FORMAT" }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
<h3>Serviços Interlegis</h3> |
|||
|
|||
<table repeat="1"> |
|||
<thead> |
|||
<tr> |
|||
<th>Serviço</th> |
|||
<th>Endereço</th> |
|||
<th>Ativado em</th> |
|||
<th>Desativado em</th> |
|||
</tr> |
|||
</thead> |
|||
{% for srv in casa.servico_set.all %} |
|||
<tr> |
|||
<td>{{ srv.tipo_servico.nome }}</td> |
|||
<td>{{ srv.url|default_if_none:"-" }}</td> |
|||
<td>{{ srv.data_ativacao|date:"SHORT_DATE_FORMAT" }}</td> |
|||
<td>{{ srv.data_desativacao|date:"SHORT_DATE_FORMAT" }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
|
|||
</div> |
|||
{% endfor %} |
|||
|
|||
<div id="footer"> |
|||
{%block page_foot%} |
|||
{% trans 'Página' %} <pdf:pagenumber> |
|||
{%endblock%} |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,132 @@ |
|||
{% load smart_if %} |
|||
{% load static from staticfiles %} |
|||
{% load i18n %} |
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|||
<html> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>Casa Legislativa</title> |
|||
<style type="text/css"> |
|||
table { |
|||
padding: 3px; |
|||
line-height: 1em; |
|||
-fs-table-paginate: paginate; |
|||
} |
|||
thead { |
|||
display: table-header-group; |
|||
} |
|||
th { |
|||
font-weight: bold; |
|||
text-align: left; |
|||
} |
|||
|
|||
th, td { |
|||
border-bottom: 1px solid #ddd; |
|||
} |
|||
|
|||
td.logo { |
|||
text-align: center; |
|||
} |
|||
|
|||
td.header_text p { |
|||
margin: 0px; |
|||
font-size: 1.4em; |
|||
} |
|||
|
|||
td.header_text { |
|||
width: 550px; |
|||
} |
|||
|
|||
h1 { |
|||
font-size: 2em; |
|||
text-align: center; |
|||
} |
|||
h2 { |
|||
font-size: 1.7em; |
|||
} |
|||
h3 { |
|||
margin-top: 10px; |
|||
margin-bottom: 0px; |
|||
} |
|||
body { |
|||
font-family: "Helvetica, Arial, sans-serif"; |
|||
font-size: 1.3em; |
|||
line-height: 1em; |
|||
} |
|||
|
|||
#footer { |
|||
text-align: center; |
|||
} |
|||
|
|||
@page { |
|||
size: a4 landscape; |
|||
margin: 3.5cm 2cm 2cm 2cm; |
|||
font-family: "Helvetica, Arial, sans-serif"; |
|||
font-size: 2em; |
|||
@frame header { |
|||
-pdf-frame-content: header; |
|||
top: 1cm; |
|||
} |
|||
@frame footer { |
|||
-pdf-frame-content: footer; |
|||
bottom: 0cm; |
|||
margin-left: 2cm; |
|||
margin-right: 2cm; |
|||
height: 1cm; |
|||
} |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div id="header"> |
|||
<table> |
|||
<tr> |
|||
<td class="logo"><img src="{% static 'img/logo-senado.jpg' %}"/></td> |
|||
<td class="header_text"> |
|||
<p><strong>{% trans 'SENADO FEDERAL' %}</strong></p> |
|||
<p><strong>{% trans 'ILB - Interlegis' %}</strong></p> |
|||
<p>{{ title }}</p> |
|||
</td> |
|||
<td class="logo"><img src="{% static 'img/logo-interlegis.jpg' %}"/></td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
|
|||
<table repeat="1"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width: 22.5%;">{% trans 'Casa' %}</th> |
|||
<th style="width: 12.5%;">{% trans 'Presidente' %}</th> |
|||
<th style="width: 5%;">{% trans 'Tipo' %}</th> |
|||
<th style="width: 18%;">{% trans 'Endereço' %}</th> |
|||
<th style="width: 10%;">{% trans 'Bairro' %}</th> |
|||
<th style="width: 7%;">{% trans 'CEP' %}</th> |
|||
<th style="width: 12.5%;">{% trans 'Telefone' %}</th> |
|||
<th style="width: 12.5%;">{% trans 'E-mail' %}</th> |
|||
</tr> |
|||
</thead> |
|||
|
|||
{% for casa in casas %} |
|||
{% ifchanged casa.municipio.uf %} |
|||
<tr><td colspan="8"><h3>{{ casa.municipio.uf.nome }}</h3></td></tr> |
|||
{% endifchanged %} |
|||
<tr> |
|||
<td>{{ casa.nome }}</td> |
|||
<td>{{ casa.presidente }}</td> |
|||
<td>{{ casa.tipo.sigla }}</td> |
|||
<td>{{ casa.logradouro }}</td> |
|||
<td>{{ casa.bairro }}</td> |
|||
<td>{{ casa.cep }}</td> |
|||
<td>{{ casa.telefone }}</td> |
|||
<td>{{ casa.email }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
<div id="footer"> |
|||
{%block page_foot%} |
|||
{% trans 'Página' %} <pdf:pagenumber> |
|||
{%endblock%} |
|||
</div> |
|||
</body> |
|||
</html> |
@ -1,38 +1,57 @@ |
|||
# coding: utf-8 |
|||
from django.conf.urls import patterns, url |
|||
from django.contrib.auth.decorators import login_required |
|||
from sigi.apps.casas.views import importa_casas |
|||
|
|||
|
|||
urlpatterns = patterns( |
|||
'sigi.apps.casas.views', |
|||
|
|||
# Informacoes de uma casa legislativa |
|||
url(r'^casalegislativa/report_complete/$', 'report_complete', name='report-complete-all'), |
|||
url(r'^casalegislativa/(?P<id>\w+)/report_complete/$', 'report_complete', name='report-complete-id'), |
|||
url(r'^orgao/report_complete/$', 'report_complete', |
|||
name='report-complete-all'), |
|||
url(r'^orgao/(?P<id>\w+)/report_complete/$', 'report_complete', |
|||
name='report-complete-id'), |
|||
|
|||
# Reports Labels |
|||
url(r'^casalegislativa/labels/$', 'labels_report', name='labels-report-all'), |
|||
url(r'^casalegislativa/(?P<id>\w+)/labels/$', 'labels_report', name='labels-report-id'), |
|||
url(r'^orgao/labels/$', 'labels_report', name='labels-report-all'), |
|||
url(r'^orgao/(?P<id>\w+)/labels/$', 'labels_report', |
|||
name='labels-report-id'), |
|||
|
|||
# Reports Labels Parlamentar |
|||
url(r'^casalegislativa/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), |
|||
url(r'^casalegislativa/(?P<id>\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), |
|||
url(r'^orgao/labels_parlamentar/$', 'labels_report_parlamentar', |
|||
name='lebels-report-parlamentar-all'), |
|||
url(r'^orgao/(?P<id>\w+)/labels_parlamentar/$', 'labels_report_parlamentar', |
|||
name='labels-report-parlamentar-id'), |
|||
|
|||
|
|||
# Reports labels sem presidente |
|||
url(r'^casalegislativa/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), |
|||
url(r'^casalegislativa/(?P<id>\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), |
|||
url(r'^orgao/labels_sem_presidente/$', 'labels_report_sem_presidente', |
|||
name='labels-report-sem-presidente-all'), |
|||
url(r'^orgao/(?P<id>\w+)/labels_sem_presidente/$', |
|||
'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), |
|||
|
|||
# Reports casas sem convenio |
|||
url(r'^casalegislativa/reports/$', 'report', name='casa-report'), |
|||
url(r'^casalegislativa/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), |
|||
url(r'^orgao/reports/$', 'report', name='casa-report'), |
|||
url(r'^orgao/casas_sem_convenio_report/$', 'casas_sem_convenio_report', |
|||
name='casas-sem-convenio-report'), |
|||
|
|||
# CSV |
|||
url(r'^casalegislativa/csv/$', 'export_csv', name='casa-export-csv'), # Error |
|||
url(r'^orgao/csv/$', 'export_csv', name='casa-export-csv'), # Error |
|||
|
|||
# Carrinho |
|||
url(r'^casalegislativa/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), |
|||
url(r'^casalegislativa/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error |
|||
url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error |
|||
url(r'^orgao/carrinho/$', 'visualizar_carrinho', |
|||
name='visualizar-carrinho'), |
|||
url(r'^orgao/carrinho/excluir_carrinho/$', 'excluir_carrinho', |
|||
name='excluir-carrinho'), # Error |
|||
url(r'^orgao/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', |
|||
name='deleta-itens-carrinho'), # Error |
|||
url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), |
|||
url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), |
|||
|
|||
# Atualização por CSV |
|||
url(r'^orgao/importa/$', login_required(importa_casas.as_view()), |
|||
name='importar-casas'), |
|||
url(r'^gerentes/$', 'gerentes_interlegis', |
|||
name='gerentes_interlegis'), |
|||
) |
|||
|
@ -0,0 +1,39 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('contatos', '0002_auto_20151104_0810'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='contato', |
|||
name='municipio', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='munic\xedpio', blank=True, to='contatos.Municipio', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='endereco', |
|||
name='municipio', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='munic\xedpio', blank=True, to='contatos.Municipio', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='municipio', |
|||
name='microrregiao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Microrregi\xe3o', blank=True, to='contatos.Microrregiao', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='municipio', |
|||
name='uf', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='UF', to='contatos.UnidadeFederativa'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('contatos', '0003_auto_20210416_0841'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='microrregiao', |
|||
options={'ordering': ('nome',), 'verbose_name': 'Microrregi\xe3o', 'verbose_name_plural': 'Microrregi\xf5es'}, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='unidadefederativa', |
|||
name='regiao', |
|||
field=models.CharField(max_length=2, verbose_name='regi\xe3o', choices=[(b'CO', 'Centro-Oeste'), (b'NE', 'Nordeste'), (b'NO', 'Norte'), (b'SD', 'Sudeste'), (b'SL', 'Sul')]), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('convenios', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='duracao', |
|||
field=models.PositiveIntegerField(help_text='Deixar em branco caso a dura\xe7\xe3o seja indefinida', null=True, verbose_name='Dura\xe7\xe3o (meses)', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('convenios', '0002_convenio_duracao'), |
|||
('casas', '0014_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,78 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('servidores', '0001_initial'), |
|||
('convenios', '0003_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='StatusConvenio', |
|||
fields=[ |
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
|||
('nome', models.CharField(max_length=100)), |
|||
('cancela', models.BooleanField(default=False, verbose_name='Cancela o conv\xeanio')), |
|||
], |
|||
options={ |
|||
'ordering': ('nome',), |
|||
'verbose_name': 'Estado de convenios', |
|||
'verbose_name_plural': 'Estados de convenios', |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='acompanha', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='acompanhado por', blank=True, to='servidores.Servidor', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='status', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='estado atual', blank=True, to='convenios.StatusConvenio', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(verbose_name='\xf3rg\xe3o conveniado', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='data_adesao', |
|||
field=models.DateField(null=True, verbose_name='aderidas', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='data_retorno_assinatura', |
|||
field=models.DateField(help_text='Conv\xeanio firmado.', null=True, verbose_name='conveniadas', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='data_termo_aceite', |
|||
field=models.DateField(help_text='Equipamentos recebidos.', null=True, verbose_name='equipadas', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='duracao', |
|||
field=models.PositiveIntegerField(help_text='Deixar em branco caso a dura\xe7\xe3o seja indefinida', null=True, verbose_name='dura\xe7\xe3o (meses)', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='observacao', |
|||
field=models.TextField(null=True, verbose_name='observa\xe7\xf5es', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('convenios', '0004_auto_20210407_1928'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='data_sigad', |
|||
field=models.DateField(null=True, verbose_name='data de cadastro no SIGAD', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='data_sigi', |
|||
field=models.DateField(auto_now_add=True, verbose_name='data de cadastro no SIGI', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,33 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('convenios', '0005_auto_20210409_0842'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='\xf3rg\xe3o conveniado', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='projeto', |
|||
field=models.ForeignKey(to='convenios.Projeto', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='tramitacao', |
|||
name='unid_admin', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Unidade Administrativa', to='convenios.UnidadeAdministrativa'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,40 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('convenios', '0006_auto_20210416_0841'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='TipoSolicitacao', |
|||
fields=[ |
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
|||
('nome', models.CharField(max_length=100)), |
|||
], |
|||
options={ |
|||
'ordering': ('nome',), |
|||
'verbose_name': 'tipo de solicita\xe7\xe3o', |
|||
'verbose_name_plural': 'Tipos de solicita\xe7\xe3o', |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='data_solicitacao', |
|||
field=models.DateField(null=True, verbose_name='data do e-mail de solicita\xe7\xe3o', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='tipo_solicitacao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='tipo de solicita\xe7\xe3o', blank=True, to='convenios.TipoSolicitacao', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,34 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('servidores', '0004_auto_20210422_1907'), |
|||
('convenios', '0007_auto_20210416_0918'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='servico_gestao', |
|||
field=models.ForeignKey(related_name='convenios_geridos', on_delete=django.db.models.deletion.SET_NULL, verbose_name='servi\xe7o de gest\xe3o', blank=True, to='servidores.Servico', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='convenio', |
|||
name='servidor_gestao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='servidor de gest\xe3o', blank=True, to='servidores.Servidor', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convenio', |
|||
name='acompanha', |
|||
field=models.ForeignKey(related_name='convenios_acompanhados', on_delete=django.db.models.deletion.SET_NULL, verbose_name='acompanhado por', blank=True, to='servidores.Servidor', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('convenios', '0008_auto_20210422_1907'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='projeto', |
|||
options={'ordering': ('nome',)}, |
|||
), |
|||
] |
@ -1,19 +1,67 @@ |
|||
{% extends "change_list_with_cart.html" %} |
|||
{% load i18n %} |
|||
|
|||
{% block search %} |
|||
<div id="toolbar"> |
|||
<form id="changelist-search" action="" method="get"> |
|||
<div><!-- DIV needed for valid HTML --> |
|||
<label for="searchbar"><img src="/static/admin/img/icon_searchbox.png" alt="Search" /></label> |
|||
<input type="text" size="40" name="q" value="" id="searchbar" /> |
|||
{% block extra_search %} |
|||
<nav class="navbar navbar-default"> |
|||
<div class="container-fluid"> |
|||
<div class="navbar-header"> |
|||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> |
|||
<span class="sr-only">Toggle navigation</span> |
|||
<span class="icon-bar"></span> |
|||
<span class="icon-bar"></span> |
|||
<span class="icon-bar"></span> |
|||
</button> |
|||
<a class="navbar-brand" href="#">Filtro de datas</a> |
|||
<p class="navbar-text">Use AAAA, AAAA-MM ou AAAA-MM-DD</p> |
|||
</div> |
|||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
|||
<form class="navbar-form navbar-left" role="extra-search" id="changelist-extrasearch" action="" method="get"> |
|||
<div class="form-group"> |
|||
<label for="data_retorno_assinatura__gte">{% trans 'Conveniadas a partir de' %}:</label> |
|||
<input type="text" size="10" name="data_retorno_assinatura__gte" value="" id="data_retorno_assinatura__gte" class="vDateField"/> |
|||
<input type="text" class="form-control search-query" size="10" name="data_retorno_assinatura__gte" value="" id="data_retorno_assinatura__gte"> |
|||
<label for="data_retorno_assinatura__lte">{% trans 'até' %}:</label> |
|||
<input type="text" size="10" name="data_retorno_assinatura__lte" value="" id="data_retorno_assinatura__lte" /> |
|||
<input type="submit" value="Pesquisar" /> |
|||
{% trans 'Datas podem ser: Um ano (aaaa), um mês (aaaa-mm) ou um dia (aaaa-mm-dd)' %} |
|||
<input type="text" class="form-control search-query" size="10" name="data_retorno_assinatura__lte" value="" id="data_retorno_assinatura__lte"> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="data_sigad__gte">{% trans 'SIGAD a partir de' %}:</label> |
|||
<input type="text" class="form-control search-query" size="10" name="data_sigad__gte" value="" id="data_sigad__gte"> |
|||
<label for="data_sigad__lte">{% trans 'até' %}:</label> |
|||
<input type="text" class="form-control search-query" size="10" name="data_sigad__lte" value="" id="data_sigad__lte"> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="data_sigi__gte">{% trans 'SIGI a partir de' %}:</label> |
|||
<input type="text" class="form-control search-query" size="10" name="data_sigi__gte" value="" id="data_sigi__gte"> |
|||
<label for="data_sigi__lte">{% trans 'até' %}:</label> |
|||
<input type="text" class="form-control search-query" size="10" name="data_sigi__lte" value="" id="data_sigi__lte"> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="data_solicitacao__gte">{% trans 'E-mail a partir de' %}:</label> |
|||
<input type="text" class="form-control search-query" size="10" name="data_solicitacao__gte" value="" id="data_solicitacao__gte"> |
|||
<label for="data_solicitacao__lte">{% trans 'até' %}:</label> |
|||
<input type="text" class="form-control search-query" size="10" name="data_solicitacao__lte" value="" id="data_solicitacao__lte"> |
|||
</div> |
|||
<button type="submit" class="btn btn-default navbar-btn "> |
|||
<span class="glyphicon glyphicon-search"></span> |
|||
</button> |
|||
</form> |
|||
</div><!-- /.navbar-collapse --> |
|||
</div><!-- /.container-fluid --> |
|||
</nav> |
|||
{% comment %} |
|||
<form class="navbar-form navbar-right" role="extra-search" id="changelist-extrasearch" action="" method="get"> |
|||
<div class="form-group"><!-- DIV needed for valid HTML --> |
|||
<div class="input-group"> |
|||
<label for="data_retorno_assinatura__gte">{% trans 'Conveniadas a partir de' %}:</label> |
|||
<input type="text" class="form-control search-query" placeholder="YYYY ou YYYY-MM ou YYYY-MM-DD" size="10" name="data_retorno_assinatura__gte" value="" id="data_retorno_assinatura__gte"> |
|||
<label for="data_retorno_assinatura__lte">{% trans 'até' %}:</label> |
|||
<input type="text" class="form-control search-query" placeholder="YYYY ou YYYY-MM ou YYYY-MM-DD" size="10" name="data_retorno_assinatura__lte" value="" id="data_retorno_assinatura__lte"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="submit"> |
|||
<span class="glyphicon glyphicon-search"></span> |
|||
</button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
{% endcomment %} |
|||
{% endblock %} |
@ -0,0 +1,275 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
import csv |
|||
from collections import OrderedDict |
|||
from django.core.management.base import BaseCommand, CommandError |
|||
from sigi.apps.casas.models import Funcionario |
|||
from sigi.apps.contatos.models import UnidadeFederativa |
|||
from sigi.apps.diagnosticos.models import Categoria, Diagnostico, Resposta |
|||
|
|||
DATATYPES = { |
|||
'text': 'T', |
|||
'float': 'N', |
|||
'date': 'D', |
|||
'one': 'L', |
|||
'many': 'M' |
|||
} |
|||
|
|||
class Command(BaseCommand): |
|||
help = u"""Exporta dados do diagnóstico para o formato Tab-Separated-Values |
|||
do LimeSurvey, conforme documentado em |
|||
https://manual.limesurvey.org/Tab_Separated_Value_survey_structure""" |
|||
|
|||
def handle(self, *args, **options): |
|||
def normalize(l): |
|||
return [s.encode('utf-8') for s in l] |
|||
|
|||
nonum = lambda s: s[s.index(' ')+1:] |
|||
avalue = lambda e: ('Y' if e.title == u'Sim' else 'N' |
|||
if e.title == u'Não' else e.id) |
|||
|
|||
setores = [(i+1, s[0], s[1]) for i, s in enumerate( |
|||
Funcionario.SETOR_CHOICES)] |
|||
|
|||
if len(args) < 2: |
|||
raise CommandError(u"Use: ls_export survey_id struct.txt data.csv") |
|||
|
|||
survey_id = args[0] |
|||
|
|||
lsf = csv.writer(open(args[1], 'wb+'), delimiter="\t", |
|||
quoting=csv.QUOTE_MINIMAL) |
|||
|
|||
struct = ['id', 'token', 'submitdate', 'lastpage', 'startlanguage', |
|||
'seed'] |
|||
|
|||
self.stdout.write("Exporting survey structure: ") |
|||
# Structure headers # |
|||
self.stdout.write("\tStructure headers...", ending=" ") |
|||
lsf.writerow(['id', 'related_id', 'class', 'type/scale', 'name', |
|||
'relevance', 'text', 'help', 'language', 'validation', |
|||
'mandatory', 'other', 'default', 'same_default']) |
|||
lsf.writerows([ |
|||
['', '', 'S', '', 'sid', '', survey_id], |
|||
['', '', 'S', '', 'format', '', 'G'], |
|||
['', '', 'S', '', 'language', '', 'pt-BR'], |
|||
['', '', 'SL', '', 'surveyls_survey_id', '', survey_id, '', |
|||
'pt-BR'], |
|||
['', '', 'SL', '', 'surveyls_language', '', 'pt-BR', '', 'pt-BR'], |
|||
['', '', 'SL', '', 'surveyls_title', '', |
|||
u'Diagnóstico PML'.encode('utf-8'), '', 'pt-BR']]) |
|||
self.stdout.write("Done!") |
|||
|
|||
# Identificação da Casa Legislativa e sua equipe # |
|||
self.stdout.write("\tIdentificação da Casa...", ending=" ") |
|||
lsf.writerow(normalize(['1000', '', 'G', '', u'Identificação da Casa', |
|||
'', '', '', 'pt-BR'])) |
|||
lsf.writerow(normalize(['1001', '', 'Q', 'L', 'c001q001', '1', |
|||
u'Região', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c001q001') |
|||
lsf.writerows([normalize(['1001', '', 'A', '0', sigla, '', nome, '', |
|||
'pt-BR']) for sigla, nome in UnidadeFederativa.REGIAO_CHOICES]) |
|||
lsf.writerow(normalize(['1002', '', 'Q', '!', 'c001q002', '1', |
|||
u'Estado (UF)', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c001q002') |
|||
lsf.writerows([normalize(['1002', '', 'A', '0', u.sigla, '', u.nome, '', |
|||
'pt-BR']) for u in UnidadeFederativa.objects.all()]) |
|||
lsf.writerow(normalize(['1003', '', 'Q', 'S', 'c001q003', '1', |
|||
u'Município', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c001q003') |
|||
lsf.writerow(normalize(['1004', '', 'Q', 'D', 'c001q004', '1', |
|||
u'Data de criação do município', '', 'pt-BR', '', 'Y', 'N', '', |
|||
'0'])) |
|||
struct.append('c001q004') |
|||
lsf.writerow(normalize(['1005', '', 'Q', 'S', 'c001q005', '1', |
|||
u'Nome da Casa', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c001q005') |
|||
lsf.writerow(normalize(['1006', '', 'Q', 'D', 'c001q006', '1', |
|||
u'Data de instalação do legislativo', '', 'pt-BR', '', 'Y', 'N', '', |
|||
'0'])) |
|||
struct.append('c001q006') |
|||
lsf.writerow(normalize(['1007', '', 'Q', 'T', 'c001q007', '1', |
|||
u'Endereço', '', 'pt-BR', '', 'N', 'N', '', '0'])) |
|||
struct.append('c001q007') |
|||
lsf.writerow(normalize(['1008', '', 'Q', 'S', 'c001q008', '1', |
|||
u'CNPJ', '', 'pt-BR', '', 'N', 'N', '', '0'])) |
|||
struct.append('c001q008') |
|||
lsf.writerow(normalize(['1009', '', 'Q', 'S', 'c001q009', '1', |
|||
u'E-mail principal', '', 'pt-BR', '', 'N', 'N', '', '0'])) |
|||
struct.append('c001q009') |
|||
lsf.writerow(normalize(['1010', '', 'Q', 'S', 'c001q010', '1', |
|||
u'Endereço Web', '', 'pt-BR', '', 'N', 'N', '', '0'])) |
|||
struct.append('c001q010') |
|||
lsf.writerow(normalize(['1011', '', 'Q', ';', 'c001q011', '1', |
|||
u'Pessoas de contato', '', 'pt-BR', '', 'N', 'N', '', '0'])) |
|||
lsf.writerow(normalize(['101198', '', 'SQ', '1', 'SQ00101', '', u'Nome', |
|||
'', 'pt-BR', '', '', 'N', '', '0'])) |
|||
lsf.writerow(normalize(['101199', '', 'SQ', '1', 'SQ00102', '', |
|||
u'E-mail', '', 'pt-BR', '', '', 'N', '', '0'])) |
|||
for i, k, v in setores: |
|||
lsf.writerow(normalize(['10110{0}'.format(i), '', 'SQ', '', |
|||
'SQ1010{0}'.format(i), '1', v, '', 'pt-BR', '', '', 'N', |
|||
'', '0'])) |
|||
struct.extend([ |
|||
'c001q011_SQ1010{0}_SQ00101'.format(i), |
|||
'c001q011_SQ1010{0}_SQ00102'.format(i), |
|||
]) |
|||
|
|||
self.stdout.write("Done!") |
|||
# Equipe de diagnóstico # |
|||
self.stdout.write("\tEquipe de diagnóstico...", ending=" ") |
|||
lsf.writerow(normalize(['2000', '', 'G', '', u'Equipe de diagnóstico', |
|||
'', '', '', 'pt-BR'])) |
|||
lsf.writerow(normalize(['2001', '', 'Q', 'D', 'c002q001', '1', |
|||
u'Data de início da visita', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c002q001') |
|||
lsf.writerow(normalize(['2002', '', 'Q', 'D', 'c002q002', '1', |
|||
u'Data de término da visita', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c002q002') |
|||
lsf.writerow(normalize(['2003', '', 'Q', 'S', 'c002q003', '1', |
|||
u'Líder da equipe', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c002q003') |
|||
lsf.writerow(normalize(['2004', '', 'Q', 'T', 'c002q004', '1', |
|||
u'Membros da equipe', '', 'pt-BR', '', 'Y', 'N', '', '0'])) |
|||
struct.append('c002q004') |
|||
self.stdout.write("Done!") |
|||
|
|||
for c in Categoria.objects.all(): |
|||
self.stdout.write("\t{0}...".format(nonum(c.nome).encode('utf-8')), ending=" ") |
|||
lsf.writerow(normalize([str(c.id), '', 'G', '', |
|||
nonum(c.nome), '', nonum(c.nome), '', |
|||
'pt-BR'])) |
|||
perguntas = sorted([(p.title, p) for p in c.perguntas.all()]) |
|||
for t, p in perguntas: |
|||
lstype = DATATYPES[p.datatype] |
|||
# Hack para perguntas SIM/NÃO que foram cadastradas como Choice |
|||
if lstype == 'L': |
|||
if ("".join([e.title for e in p.choices.all()]) in |
|||
[u"SimNão", u"NãoSim"]): |
|||
lstype = 'Y' |
|||
######## |
|||
relevance = "1" |
|||
if p.abre_por.exists(): |
|||
relevance = "(" + " or ".join( |
|||
[u'({sid}X{gid}X{qid}.NAOK == "{value}")'.format( |
|||
sid=survey_id, gid=e.schema.categoria.id, |
|||
qid=e.schema.id, value=avalue(e)) for e in |
|||
p.abre_por.all()]) + ")" |
|||
|
|||
lsf.writerow(normalize([str(p.id), '', 'Q', lstype, |
|||
'c{0:03}q{1:03}'.format(c.id, p.id), relevance, |
|||
nonum(p.title), p.help_text, 'pt-BR', '', 'NY'[p.required], |
|||
'N', '', '0'])) |
|||
if lstype == 'L': |
|||
lsf.writerows([normalize([str(p.id), u'', u'A', u'0', |
|||
str(e.id), u'', e.title, u'', u'pt-BR']) |
|||
for e in p.choices.all()]) |
|||
if lstype == 'M': |
|||
lsf.writerows([normalize([str(p.id*1000+e.id), u'', u'SQ', |
|||
u'', str(e.id), u'1', e.title, u'', u'pt-BR']) |
|||
for e in p.choices.all()]) |
|||
struct.extend(['c{0:03}q{1:03}_{2}'.format(c.id, p.id, |
|||
e.id) for e in p.choices.all()]) |
|||
else: |
|||
struct.extend(['c{0:03}q{1:03}'.format(c.id, p.id)]) |
|||
self.stdout.write("Done!") |
|||
|
|||
if len(args) < 3: # No data export |
|||
return |
|||
|
|||
self.stdout.write("Exporting survey data: ") |
|||
|
|||
dtf = csv.writer(open(args[2], 'wb+'), delimiter='\t', |
|||
quoting=csv.QUOTE_MINIMAL) |
|||
|
|||
dtf.writerow(struct) |
|||
|
|||
for d in Diagnostico.objects.all(): |
|||
self.stdout.write(u"\t{0}".format(d.casa_legislativa.nome)) |
|||
|
|||
form = OrderedDict.fromkeys(struct, '{question_not_shown}') |
|||
|
|||
form['id'] = str(d.id) |
|||
if d.data_publicacao: |
|||
form['submitdate'] = d.data_publicacao.isoformat() |
|||
# form['lastpage'] = '8' |
|||
form['startlanguage'] = 'pt-BR' |
|||
# form['seed'] = '123456' |
|||
|
|||
# Identificação da Casa Legislativa e sua equipe # |
|||
form['c001q001'] = d.casa_legislativa.municipio.uf.regiao |
|||
form['c001q002'] = d.casa_legislativa.municipio.uf.sigla |
|||
form['c001q003'] = d.casa_legislativa.municipio.nome |
|||
if d.casa_legislativa.municipio.data_criacao: |
|||
form['c001q004'] = \ |
|||
d.casa_legislativa.municipio.data_criacao.isoformat() |
|||
form['c001q005'] = d.casa_legislativa.nome |
|||
if d.casa_legislativa.data_instalacao: |
|||
form['c001q006'] = \ |
|||
d.casa_legislativa.data_instalacao.isoformat() |
|||
form['c001q007'] = ( |
|||
u"{logradouro}{{cr}}{{newline}}" |
|||
u"{bairro}{{cr}}{{newline}}" |
|||
u"{cep} - {municipio} - {uf}".format( |
|||
logradouro=d.casa_legislativa.logradouro, |
|||
bairro=d.casa_legislativa.bairro, |
|||
cep=d.casa_legislativa.cep, |
|||
municipio=d.casa_legislativa.municipio.nome, |
|||
uf=d.casa_legislativa.municipio.uf.sigla |
|||
)) |
|||
form['c001q008'] = d.casa_legislativa.cnpj |
|||
form['c001q009'] = d.casa_legislativa.email |
|||
form['c001q010'] = d.casa_legislativa.pagina_web |
|||
|
|||
for i, k, v in setores: |
|||
q = d.casa_legislativa.funcionario_set.filter(setor=k) |
|||
if q.exists(): |
|||
f = q.first() |
|||
knome = 'c001q011_SQ1010{0}_SQ00101'.format(i) |
|||
kmail = 'c001q011_SQ1010{0}_SQ00102'.format(i) |
|||
form[knome] = f.nome |
|||
form[kmail] = f.email |
|||
|
|||
if d.data_visita_inicio: |
|||
form['c002q001'] = d.data_visita_inicio.isoformat() |
|||
if d.data_visita_fim: |
|||
form['c002q002'] = d.data_visita_fim.isoformat() |
|||
form['c002q003'] = d.responsavel.nome_completo |
|||
form['c002q004'] = "{cr}{newline}".join( |
|||
[e.membro.nome_completo for e in d.equipe_set.all()]) |
|||
|
|||
for r in Resposta.objects.filter(entity_id=d.id): |
|||
if r.schema.datatype == 'many': |
|||
key = "c{cid:03}q{qid:03}_{sqid}".format( |
|||
cid=r.schema.categoria.id, |
|||
qid=r.schema.id, |
|||
sqid=r.value.id |
|||
) |
|||
value = 'Y' |
|||
else: |
|||
key = "c{cid:03}q{qid:03}".format(cid=r.schema.categoria.id, |
|||
qid=r.schema.id) |
|||
value = r.value |
|||
if r.schema.datatype == 'one': |
|||
if value is None: |
|||
value = '{question_not_shown}' |
|||
elif value.title == u'Sim': |
|||
value = 'Y' |
|||
elif value.title == u'Não': |
|||
value = 'N' |
|||
else: |
|||
value = r.value.id |
|||
elif r.schema.datatype == 'text': |
|||
value = value.\ |
|||
replace('\r\n', '{cr}{newline}').\ |
|||
replace('\r', '{cr}{newline}').\ |
|||
replace('\n', '{cr}{newline}').\ |
|||
replace('\t', ' ') |
|||
|
|||
if value is None: |
|||
value = '{question_not_shown}' |
|||
form[key] = u'{0}'.format(value) |
|||
dtf.writerow(normalize(form.values())) |
|||
|
|||
self.stdout.write('Done!') |
|||
|
|||
|
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import autoslug.fields |
|||
import eav.models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('diagnosticos', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='pergunta', |
|||
name='name', |
|||
field=autoslug.fields.AutoSlugField(populate_from=b'title', editable=True, max_length=250, blank=True, verbose_name='name', slugify=eav.models.slugify_attr_name), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('diagnosticos', '0002_auto_20170407_1024'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='escolha', |
|||
name='schema_to_open', |
|||
field=models.ForeignKey(related_name='abre_por', verbose_name='pergunta para abrir', blank=True, to='diagnosticos.Pergunta', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('diagnosticos', '0003_auto_20201101_2240'), |
|||
('casas', '0014_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='diagnostico', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,51 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('diagnosticos', '0004_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='diagnostico', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa Legislativa', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='diagnostico', |
|||
name='responsavel', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='respons\xe1vel', to='servidores.Servidor'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='equipe', |
|||
name='membro', |
|||
field=models.ForeignKey(to='servidores.Servidor', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='escolha', |
|||
name='schema_to_open', |
|||
field=models.ForeignKey(related_name='abre_por', on_delete=django.db.models.deletion.SET_NULL, verbose_name='pergunta para abrir', blank=True, to='diagnosticos.Pergunta', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='resposta', |
|||
name='choice', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='escolha', blank=True, to='diagnosticos.Escolha', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='resposta', |
|||
name='schema', |
|||
field=models.ForeignKey(related_name='attrs', on_delete=django.db.models.deletion.PROTECT, verbose_name='pergunta', to='diagnosticos.Pergunta'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('eventos', '0003_auto_20151104_0810'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RemoveField( |
|||
model_name='evento', |
|||
name='curso_moodle_id', |
|||
), |
|||
] |
@ -0,0 +1,27 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('eventos', '0004_remove_evento_curso_moodle_id'), |
|||
('casas', '0014_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='convite', |
|||
name='casa', |
|||
field=models.ForeignKey(verbose_name='Casa convidada', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='evento', |
|||
name='casa_anfitria', |
|||
field=models.ForeignKey(verbose_name='Casa anfitri\xe3', blank=True, to='casas.Orgao', null=True), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,57 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('eventos', '0005_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='convite', |
|||
name='casa', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa convidada', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='convite', |
|||
name='servidor', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Servidor que convidou', to='servidores.Servidor'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='equipe', |
|||
name='funcao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Fun\xe7\xe3o na equipe', to='eventos.Funcao'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='equipe', |
|||
name='membro', |
|||
field=models.ForeignKey(related_name='equipe_evento', on_delete=django.db.models.deletion.PROTECT, to='servidores.Servidor'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='evento', |
|||
name='casa_anfitria', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa anfitri\xe3', blank=True, to='casas.Orgao', null=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='evento', |
|||
name='municipio', |
|||
field=models.ForeignKey(to='contatos.Municipio', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='evento', |
|||
name='tipo_evento', |
|||
field=models.ForeignKey(to='eventos.TipoEvento', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,38 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('eventos', '0006_auto_20210416_0841'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='convite', |
|||
name='nomes_participantes', |
|||
field=models.TextField(help_text='Favor colocar um participante por linha', verbose_name='nome dos participantes', blank=True), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='convite', |
|||
name='qtde_participantes', |
|||
field=models.PositiveIntegerField(default=0, verbose_name='n\xfamero de participantes'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='evento', |
|||
name='carga_horaria', |
|||
field=models.PositiveIntegerField(default=0, verbose_name='carga hor\xe1ria'), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AddField( |
|||
model_name='evento', |
|||
name='virtual', |
|||
field=models.BooleanField(default=False, verbose_name='Virtual'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1 @@ |
|||
{% extends "change_list_with_cart.html" %} |
@ -0,0 +1,63 @@ |
|||
{% extends "admin/carrinho.html" %} |
|||
{% load admin_list i18n %} |
|||
{% block extrastyle %} |
|||
{{ block.super }} |
|||
{#% include "admin/tabs_style.html" %#} |
|||
{% endblock %} |
|||
|
|||
{% block title %}{% trans 'Eventos no Carrinho | SIGI' %}{% endblock %} |
|||
{% block content_title %}<h1>{% trans 'Eventos no Carrinho' %}</h1>{% endblock %} |
|||
|
|||
{% block mensagem%} |
|||
<ul class="messagelist"> |
|||
{%if carIsEmpty%} |
|||
<li class="warning">{% trans 'O carrinho está vazio, sendo assim todos os eventos entram na lista para exportação de acordo com os filtros aplicados.' %}</li> |
|||
{%else%} |
|||
<li>{{paginas.paginator.count}} {% trans 'Eventos no carrinho' %}.</li> |
|||
{%endif%} |
|||
</ul> |
|||
{% endblock %} |
|||
|
|||
{% block action %}deleta_itens_carrinho{% endblock %} |
|||
|
|||
{% block tabela %} |
|||
<table class="table table-striped"> |
|||
<thead class="thead-dark"> |
|||
<tr> |
|||
{%if not carIsEmpty%} |
|||
<th><!-- <input type="checkbox" id="action-toggle" style="display: inline;">--> |
|||
</th> |
|||
{% endif %} |
|||
<th>{% trans 'Nome do evento' %}</th> |
|||
<th>{% trans 'Tipo evento' %}</th> |
|||
<th>{% trans 'Status' %}</th> |
|||
<th>{% trans 'Data de início' %}</th> |
|||
<th>{% trans 'Data de término' %}</th> |
|||
<th>{% trans 'município' %}</th> |
|||
<th>{% trans 'Solicitante' %}</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{% for evento in paginas.object_list %} |
|||
<tr> |
|||
{%if not carIsEmpty%} |
|||
<th><input type="checkbox" name="_selected_action" |
|||
value="{{evento.id|safe}}" class="action-select" /> |
|||
</th> |
|||
{% endif %} |
|||
<td style="text-align: left;">{{evento.nome}}</td> |
|||
<td>{{evento.tipo_evento}}</td> |
|||
<td>{{evento.get_status_display}}</td> |
|||
<td>{{evento.data_inicio}}</td> |
|||
<td>{{evento.data_termino}}</td> |
|||
<td>{{evento.municipio}}</td> |
|||
<td>{{evento.solicitante}}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</tbody> |
|||
</table> |
|||
{% endblock %} |
|||
|
|||
{% block botoes %} |
|||
<a class="btn btn-primary" href="../csv/{{query_str}}">{% trans "Exportar CVS" %}</a> |
|||
{% endblock %} |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('inventario', '0001_initial'), |
|||
('casas', '0014_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='bem', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,39 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('inventario', '0002_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='bem', |
|||
name='fornecedor', |
|||
field=models.ForeignKey(to='inventario.Fornecedor', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='equipamento', |
|||
name='fabricante', |
|||
field=models.ForeignKey(to='inventario.Fabricante', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='equipamento', |
|||
name='modelo', |
|||
field=models.ForeignKey(to='inventario.ModeloEquipamento', on_delete=django.db.models.deletion.PROTECT), |
|||
preserve_default=True, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='modeloequipamento', |
|||
name='tipo', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='tipo de equipamento', to='inventario.TipoEquipamento'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -1,3 +0,0 @@ |
|||
from django.contrib import admin |
|||
|
|||
# Register your models here. |
File diff suppressed because it is too large
@ -1,116 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='Cohort', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'mdl_cohort', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='CohortMembers', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'mdl_cohort_members', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='Context', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'mdl_context', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='Course', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'ordering': ['sortorder'], |
|||
'db_table': 'mdl_course', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='CourseCategories', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'ordering': ['sortorder'], |
|||
'db_table': 'mdl_course_categories', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='CourseCompletions', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'mdl_course_completions', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='CourseStats', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'sigi_course_stats', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='Enrol', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'ordering': ['sortorder'], |
|||
'db_table': 'mdl_enrol', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='User', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'mdl_user', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
migrations.CreateModel( |
|||
name='UserEnrolments', |
|||
fields=[ |
|||
], |
|||
options={ |
|||
'db_table': 'mdl_user_enrolments', |
|||
'managed': False, |
|||
}, |
|||
bases=(models.Model,), |
|||
), |
|||
] |
@ -1,360 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from __future__ import unicode_literals |
|||
from django.db import models |
|||
|
|||
|
|||
class CourseStats(models.Model): |
|||
# databaseview: (postgresql dialect): |
|||
# -- View: sigi_course_stats |
|||
# |
|||
# DROP VIEW sigi_course_stats; |
|||
# |
|||
# CREATE OR REPLACE VIEW sigi_course_stats AS |
|||
# SELECT cc.id AS categoryid, c.id AS courseid, |
|||
# CASE |
|||
# WHEN e.enrol = 'ilbeadtutorado' AND ue.status = 1 THEN 'N' -- Rejeitada |
|||
# WHEN e.enrol = 'ilbead' AND ue.timeend > date_part('epoch', now()) THEN 'C' -- Em curso |
|||
# WHEN e.enrol = 'ilbead' and ue.timeend < date_part('epoch', now()) and co.timecompleted is null and gg.finalgrade is null then 'L' -- Abandono |
|||
# WHEN (co.timestarted = 0 OR co.timestarted IS NULL) AND gg.finalgrade IS NOT NULL THEN 'R' -- Reprovada |
|||
# WHEN co.timestarted = 0 OR co.timestarted IS NULL THEN 'L' -- Abandono |
|||
# WHEN co.timestarted > 0 AND co.timecompleted IS NULL THEN 'R' -- Reprovado |
|||
# WHEN co.timecompleted IS NOT NULL THEN 'A' -- Aprovado |
|||
# ELSE 'I' -- Indeterminado |
|||
# END AS completionstatus, count(ue.id) AS usercount, avg(gg.finalgrade) as gradeaverage |
|||
# FROM mdl_course_categories cc |
|||
# JOIN mdl_course c ON c.category = cc.id |
|||
# JOIN mdl_enrol e ON e.courseid = c.id |
|||
# JOIN mdl_user_enrolments ue ON ue.enrolid = e.id |
|||
# JOIN mdl_grade_items gi ON gi.courseid = c.id AND gi.itemtype = 'course' |
|||
# LEFT JOIN mdl_grade_grades gg ON gg.itemid = gi.id AND gg.userid = ue.userid |
|||
# LEFT JOIN mdl_course_completions co ON co.userid = ue.userid AND co.course = c.id |
|||
# GROUP BY cc.id, c.id, completionstatus; |
|||
|
|||
COMPLETIONSTATUS_CHOICES = ( |
|||
('N', u'Matrículas rejeitadas'), |
|||
('C', u'Em curso'), |
|||
('R', u'Reprovação'), |
|||
('L', u'Abandono'), |
|||
('A', u'Aprovação'), |
|||
('I', u'Indeterminado'),) |
|||
|
|||
category = models.ForeignKey('CourseCategories', db_column='categoryid', primary_key=True) |
|||
course = models.ForeignKey('Course', db_column='courseid') |
|||
completionstatus = models.CharField(max_length=1, choices=COMPLETIONSTATUS_CHOICES) |
|||
usercount = models.IntegerField() |
|||
gradeaverage = models.FloatField() |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'sigi_course_stats' |
|||
|
|||
def __unicode__(self): |
|||
return '%s - %s: %s' % (self.category.name, self.course.fullname, self.usercount) |
|||
|
|||
|
|||
class Cohort(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
context = models.ForeignKey('Context', db_column='contextid') |
|||
name = models.CharField(max_length=254) |
|||
idnumber = models.CharField(max_length=100, blank=True) |
|||
description = models.TextField(blank=True) |
|||
descriptionformat = models.SmallIntegerField() |
|||
component = models.CharField(max_length=100) |
|||
timecreated = models.BigIntegerField() |
|||
timemodified = models.BigIntegerField() |
|||
visible = models.SmallIntegerField() |
|||
# Manytomany |
|||
members = models.ManyToManyField('User', through='CohortMembers') |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_cohort' |
|||
|
|||
def __unicode__(self): |
|||
return self.name |
|||
|
|||
|
|||
class CohortMembers(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
cohort = models.ForeignKey('Cohort', db_column='cohortid') |
|||
user = models.ForeignKey('User', db_column='userid') |
|||
timeadded = models.BigIntegerField() |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_cohort_members' |
|||
|
|||
|
|||
class Context(models.Model): |
|||
CONTEXT_SYSTEM = 10 # System context level - only one instance in every system |
|||
CONTEXT_USER = 30 # User context level - one instance for each user describing what others can do to user |
|||
CONTEXT_COURSECAT = 40 # Course category context level - one instance for each category |
|||
CONTEXT_COURSE = 50 # Course context level - one instances for each course |
|||
CONTEXT_MODULE = 70 # Course module context level - one instance for each course module |
|||
CONTEXT_BLOCK = 80 # Block context level - one instance for each block, sticky blocks are tricky |
|||
# because ppl think they should be able to override them at lower contexts. |
|||
# Any other context level instance can be parent of block context. |
|||
|
|||
id = models.BigIntegerField(primary_key=True) |
|||
contextlevel = models.BigIntegerField() |
|||
instanceid = models.BigIntegerField() |
|||
path = models.CharField(max_length=255, blank=True) |
|||
depth = models.SmallIntegerField() |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_context' |
|||
|
|||
def __unicode__(self): |
|||
return self.path |
|||
|
|||
|
|||
class Course(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
category = models.ForeignKey('CourseCategories', db_column='category', related_name='courses') |
|||
sortorder = models.BigIntegerField() |
|||
fullname = models.CharField(max_length=254) |
|||
shortname = models.CharField(max_length=255) |
|||
idnumber = models.CharField(max_length=100) |
|||
summary = models.TextField(blank=True) |
|||
format = models.CharField(max_length=21) |
|||
showgrades = models.SmallIntegerField() |
|||
newsitems = models.IntegerField() |
|||
startdate = models.BigIntegerField() |
|||
marker = models.BigIntegerField() |
|||
maxbytes = models.BigIntegerField() |
|||
showreports = models.SmallIntegerField() |
|||
visible = models.SmallIntegerField() |
|||
groupmode = models.SmallIntegerField() |
|||
groupmodeforce = models.SmallIntegerField() |
|||
lang = models.CharField(max_length=30) |
|||
theme = models.CharField(max_length=50) |
|||
timecreated = models.BigIntegerField() |
|||
timemodified = models.BigIntegerField() |
|||
requested = models.SmallIntegerField() |
|||
defaultgroupingid = models.BigIntegerField() |
|||
enrolmax = models.BigIntegerField() |
|||
enablecompletion = models.SmallIntegerField() |
|||
legacyfiles = models.SmallIntegerField() |
|||
summaryformat = models.SmallIntegerField() |
|||
completionnotify = models.SmallIntegerField() |
|||
visibleold = models.SmallIntegerField() |
|||
calendartype = models.CharField(max_length=30) |
|||
cacherev = models.BigIntegerField() |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_course' |
|||
ordering = ['sortorder', ] |
|||
|
|||
def __unicode__(self): |
|||
return self.fullname |
|||
|
|||
def total_alunos(self): |
|||
return sum(e.user_enrolments.count() for e in self.enrols.all()) |
|||
|
|||
def total_ativos(self): |
|||
return sum(e.user_enrolments.filter(status=0).count() for e in self.enrols.all()) |
|||
|
|||
def get_matriculas(self): |
|||
q = UserEnrolments.objects.none() |
|||
for e in self.enrols.all(): |
|||
q = q | e.user_enrolments.all() |
|||
return q |
|||
|
|||
|
|||
class CourseCategories(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
name = models.CharField(max_length=255) |
|||
description = models.TextField(blank=True) |
|||
parent = models.ForeignKey('CourseCategories', db_column='parent', related_name='children') |
|||
sortorder = models.BigIntegerField() |
|||
coursecount = models.BigIntegerField() |
|||
visible = models.SmallIntegerField() |
|||
timemodified = models.BigIntegerField() |
|||
depth = models.BigIntegerField() |
|||
path = models.CharField(max_length=255) |
|||
theme = models.CharField(max_length=50, blank=True) |
|||
descriptionformat = models.SmallIntegerField() |
|||
visibleold = models.SmallIntegerField() |
|||
idnumber = models.CharField(max_length=100, blank=True) |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_course_categories' |
|||
ordering = ['sortorder', ] |
|||
|
|||
def __unicode__(self): |
|||
return self.name |
|||
|
|||
def context(self): |
|||
return Context.objects.get(instanceid=self.id, contextlevel=Context.CONTEXT_COURSECAT) |
|||
|
|||
def total_turmas(self): |
|||
return self.coursecount + sum([c.coursecount for c in self.children.all()]) |
|||
|
|||
def total_alunos(self): |
|||
total = 0 |
|||
total = total + sum(c.total_alunos() for c in self.courses.all()) |
|||
total = total + sum(c.total_alunos() for c in self.children.all()) |
|||
return total |
|||
|
|||
def cohortids(self): |
|||
cids = [c.pk for c in self.context().cohort_set.all()] |
|||
for c in self.children.all(): |
|||
cids = cids + c.cohortids() |
|||
return cids |
|||
|
|||
def total_alunos_cohort(self): |
|||
return sum([c.members.distinct().count() for c in Cohort.objects.filter(pk__in=self.cohortids())]) |
|||
|
|||
def get_all_courses(self, only_visible=False): |
|||
if only_visible: |
|||
q = self.courses.filter(visible=1) |
|||
else: |
|||
q = self.courses.all() |
|||
for c in self.children.all(): |
|||
q = q | c.get_all_courses(only_visible=only_visible) |
|||
return q |
|||
|
|||
|
|||
class CourseCompletions(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
user = models.ForeignKey('User', db_column='userid') |
|||
course = models.ForeignKey('Course', db_column='course') |
|||
timeenrolled = models.BigIntegerField() |
|||
timestarted = models.BigIntegerField() |
|||
timecompleted = models.BigIntegerField(blank=True, null=True) |
|||
reaggregate = models.BigIntegerField() |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_course_completions' |
|||
|
|||
|
|||
class Enrol(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
enrol = models.CharField(max_length=20) |
|||
status = models.BigIntegerField() |
|||
course = models.ForeignKey('Course', db_column='courseid', related_name='enrols') |
|||
sortorder = models.BigIntegerField() |
|||
name = models.CharField(max_length=255, blank=True) |
|||
enrolperiod = models.BigIntegerField(blank=True, null=True) |
|||
enrolstartdate = models.BigIntegerField(blank=True, null=True) |
|||
enrolenddate = models.BigIntegerField(blank=True, null=True) |
|||
expirynotify = models.SmallIntegerField(blank=True, null=True) |
|||
expirythreshold = models.BigIntegerField(blank=True, null=True) |
|||
notifyall = models.SmallIntegerField(blank=True, null=True) |
|||
password = models.CharField(max_length=50, blank=True) |
|||
cost = models.CharField(max_length=20, blank=True) |
|||
currency = models.CharField(max_length=3, blank=True) |
|||
roleid = models.BigIntegerField(blank=True, null=True) |
|||
customint1 = models.BigIntegerField(blank=True, null=True) |
|||
customint2 = models.BigIntegerField(blank=True, null=True) |
|||
customint3 = models.BigIntegerField(blank=True, null=True) |
|||
customint4 = models.BigIntegerField(blank=True, null=True) |
|||
customchar1 = models.CharField(max_length=255, blank=True) |
|||
customchar2 = models.CharField(max_length=255, blank=True) |
|||
customdec1 = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) |
|||
customdec2 = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) |
|||
customtext1 = models.TextField(blank=True) |
|||
customtext2 = models.TextField(blank=True) |
|||
timecreated = models.BigIntegerField() |
|||
timemodified = models.BigIntegerField() |
|||
customint5 = models.BigIntegerField(blank=True, null=True) |
|||
customint6 = models.BigIntegerField(blank=True, null=True) |
|||
customint7 = models.BigIntegerField(blank=True, null=True) |
|||
customint8 = models.BigIntegerField(blank=True, null=True) |
|||
customchar3 = models.CharField(max_length=1333, blank=True) |
|||
customtext3 = models.TextField(blank=True) |
|||
customtext4 = models.TextField(blank=True) |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_enrol' |
|||
ordering = ['sortorder', ] |
|||
|
|||
def __unicode__(self): |
|||
if not self.name: |
|||
return self.enrol |
|||
return self.name |
|||
|
|||
|
|||
class User(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
auth = models.CharField(max_length=20) |
|||
confirmed = models.SmallIntegerField() |
|||
policyagreed = models.SmallIntegerField() |
|||
deleted = models.SmallIntegerField() |
|||
mnethostid = models.BigIntegerField() |
|||
username = models.CharField(max_length=100) |
|||
password = models.CharField(max_length=255) |
|||
firstname = models.CharField(max_length=100) |
|||
lastname = models.CharField(max_length=100) |
|||
email = models.CharField(max_length=100) |
|||
emailstop = models.SmallIntegerField() |
|||
icq = models.CharField(max_length=15) |
|||
skype = models.CharField(max_length=50) |
|||
yahoo = models.CharField(max_length=50) |
|||
aim = models.CharField(max_length=50) |
|||
msn = models.CharField(max_length=50) |
|||
phone1 = models.CharField(max_length=20) |
|||
phone2 = models.CharField(max_length=20) |
|||
institution = models.CharField(max_length=255) |
|||
department = models.CharField(max_length=255) |
|||
address = models.CharField(max_length=255) |
|||
city = models.CharField(max_length=120) |
|||
country = models.CharField(max_length=2) |
|||
lang = models.CharField(max_length=30) |
|||
theme = models.CharField(max_length=50) |
|||
timezone = models.CharField(max_length=100) |
|||
firstaccess = models.BigIntegerField() |
|||
lastaccess = models.BigIntegerField() |
|||
lastlogin = models.BigIntegerField() |
|||
currentlogin = models.BigIntegerField() |
|||
lastip = models.CharField(max_length=45) |
|||
secret = models.CharField(max_length=15) |
|||
picture = models.BigIntegerField() |
|||
url = models.CharField(max_length=255) |
|||
description = models.TextField(blank=True) |
|||
mailformat = models.SmallIntegerField() |
|||
maildigest = models.SmallIntegerField() |
|||
maildisplay = models.SmallIntegerField() |
|||
autosubscribe = models.SmallIntegerField() |
|||
trackforums = models.SmallIntegerField() |
|||
timemodified = models.BigIntegerField() |
|||
trustbitmask = models.BigIntegerField() |
|||
imagealt = models.CharField(max_length=255, blank=True) |
|||
idnumber = models.CharField(max_length=255) |
|||
descriptionformat = models.SmallIntegerField() |
|||
timecreated = models.BigIntegerField() |
|||
suspended = models.SmallIntegerField() |
|||
lastnamephonetic = models.CharField(max_length=255, blank=True) |
|||
firstnamephonetic = models.CharField(max_length=255, blank=True) |
|||
middlename = models.CharField(max_length=255, blank=True) |
|||
alternatename = models.CharField(max_length=255, blank=True) |
|||
calendartype = models.CharField(max_length=30) |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_user' |
|||
|
|||
def __unicode__(self): |
|||
return u'%s %s' % (self.firstname, self.lastname) |
|||
|
|||
|
|||
class UserEnrolments(models.Model): |
|||
id = models.BigIntegerField(primary_key=True) |
|||
status = models.BigIntegerField() |
|||
enrol = models.ForeignKey('Enrol', db_column='enrolid', related_name='user_enrolments') |
|||
user = models.ForeignKey('User', db_column='userid', related_name='Enrolments') |
|||
timestart = models.BigIntegerField() |
|||
timeend = models.BigIntegerField() |
|||
modifierid = models.BigIntegerField() |
|||
timecreated = models.BigIntegerField() |
|||
timemodified = models.BigIntegerField() |
|||
|
|||
class Meta: |
|||
managed = False |
|||
db_table = 'mdl_user_enrolments' |
@ -1,3 +0,0 @@ |
|||
from django.shortcuts import render |
|||
|
|||
# Create your views here. |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import models, migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('metas', '0001_initial'), |
|||
('casas', '0014_auto_20210406_1945'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='planodiretor', |
|||
name='casa_legislativa', |
|||
field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), |
|||
preserve_default=True, |
|||
), |
|||
] |
@ -0,0 +1,58 @@ |
|||
body, html, .mapbox, #map { |
|||
height: 100%; |
|||
} |
|||
.filterwrap { |
|||
background-color: rgba(255,255,255,0.5); |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
z-index: 314159; |
|||
height: 100%; |
|||
max-height: 100%; |
|||
overflow-y: auto; |
|||
} |
|||
.sigi-logo { |
|||
pointer-events: none; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
z-index: 314159; |
|||
background-color: transparent; |
|||
width: 100%; |
|||
text-align: right; |
|||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; |
|||
padding-right: 20px; |
|||
} |
|||
.sigi-logo h3 { |
|||
font-weight: bolder; |
|||
margin-bottom: 0px; |
|||
} |
|||
.sigi-logo a { |
|||
pointer-events: auto; |
|||
} |
|||
.sigi-logo div { |
|||
float: right; |
|||
} |
|||
.sigi-logo img { |
|||
margin: 15px; |
|||
width: 60px; |
|||
height: 60px; |
|||
} |
|||
.region-ufs { |
|||
margin-left: 15px; |
|||
} |
|||
#search-text { |
|||
min-width: 300px; |
|||
} |
|||
.ui-autocomplete { |
|||
max-width: 300px; |
|||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); |
|||
box-shadow: 0 1px 2px rgba(0,0,0,.05); |
|||
border-color: #ddd; |
|||
margin-bottom: 20px; |
|||
background-color: #fff; |
|||
border: 1px solid transparent; |
|||
border-radius: 4px; |
|||
padding: 15px; |
|||
font-size: 10px; |
|||
} |
@ -0,0 +1,93 @@ |
|||
{% extends "base_report.html" %} |
|||
{% load mapa_tags %} |
|||
{% load i18n %} |
|||
|
|||
{% block extra_head %} |
|||
<style> |
|||
table.data, table.data td, table.data th { |
|||
border: 1px solid #CCCCCC; |
|||
border-collapse: collapse; |
|||
font-size: 10px; |
|||
padding: 2px; |
|||
} |
|||
|
|||
table.filters, table.filters td, table.filters th { |
|||
border-bottom: 1px solid #CCCCCC; |
|||
font-size: 10px; |
|||
padding-top: 3px; |
|||
vertical-align: bottom; |
|||
text-align: left; |
|||
line-height: 16px; |
|||
} |
|||
|
|||
table.filters th { |
|||
width: 12%; |
|||
} |
|||
|
|||
td.nome_uf { |
|||
padding: 0 5px !important; |
|||
} |
|||
|
|||
ul { |
|||
list-style-type: none; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
} |
|||
</style> |
|||
{% endblock %} |
|||
|
|||
{% block pagesize %}A4 landscape{% endblock pagesize %} |
|||
{% block title %}{% trans 'Lista de Casas atendidas' %}{% endblock title %} |
|||
|
|||
{% block report %} |
|||
<h1>{% trans 'Lista de Casas atendidas' %}</h1> |
|||
<table class="filters"> |
|||
{% if tipos_orgao %} |
|||
<tr><th>{% trans 'Tipos de órgão' %}</th><td>{% for t in tipos_orgao %}{{ t.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}</td></tr> |
|||
{% endif %} |
|||
{% if tipos_servico %} |
|||
<tr><th>{% trans 'Tipos de serviço' %}</th><td>{% for s in tipos_servico %}{{ s.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}</td></tr> |
|||
{% endif %} |
|||
{% if tipos_convenio %} |
|||
<tr><th>{% trans 'Tipos de convênio' %}</th><td>{% for c in tipos_convenio %}{{ c.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}</td></tr> |
|||
{% endif %} |
|||
{% if gerentes %} |
|||
<tr><th>{% trans 'Gerentes Interlegis' %}</th><td>{% for g in gerentes %}{{ g.nome_completo }}{% if not forloop.last %}, {% endif %}{% endfor %}</td></tr> |
|||
{% endif %} |
|||
{% if ufs %} |
|||
<tr><th>{% trans 'Estados' %}</th><td>{% for uf in ufs %}{{ uf.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}</td></tr> |
|||
{% endif %} |
|||
</table> |
|||
|
|||
<br/> |
|||
<table class="data" repeat="1"> |
|||
<tr> |
|||
<th>{% trans 'Casa Legislativa' %}</th> |
|||
<th>{% trans 'Estado' %}</th> |
|||
<th>{% trans 'Região' %}</th> |
|||
<th>{% trans 'Serviços' %}</th> |
|||
<th>{% trans 'Convênios' %}</th> |
|||
<th>{% trans 'Gerente(s)' %}</th> |
|||
</tr> |
|||
{% for casa in casas %} |
|||
<tr> |
|||
<td>{{ casa.nome }} </td> |
|||
<td>{{ casa.municipio.uf.nome }}</td> |
|||
<td>{{ casa.municipio.uf.get_regiao_display }}</td> |
|||
<td><ul>{% for s in casa.servico_set.all %} |
|||
{% if s.data_desativacao == None %} |
|||
<li>{{ s }}</li> |
|||
{% endif %} |
|||
{% endfor %}</ul></td> |
|||
<td><ul>{% for c in casa.convenio_set.all %} |
|||
<li>{{ c }}</li> |
|||
{% endfor %} |
|||
</ul></td> |
|||
<td><ul>{% for g in casa.gerentes_interlegis.all %} |
|||
<li>{{ g }}</li> |
|||
{% endfor %}</ul> |
|||
</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
{% endblock %} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue