From 0a3e08f377556780764222a3ab1764f20f85c370 Mon Sep 17 00:00:00 2001 From: LeandroJatai Date: Mon, 19 Sep 2022 17:09:47 -0300 Subject: [PATCH] fix: ajusta nome alternativo e add migrates --- .../migrations/0053_auto_20220919_1705.py | 18 ++++++++++ sapl/base/models.py | 2 +- sapl/context_processors.py | 2 +- .../migrations/0043_viewnormasestatisticas.py | 35 +++++++++++++++++++ .../migrations/0043_auto_20220919_1705.py | 17 +++++++++ .../migrations/0069_auto_20220919_1705.py | 19 ++++++++++ sapl/templates/base.html | 2 +- 7 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 sapl/base/migrations/0053_auto_20220919_1705.py create mode 100644 sapl/norma/migrations/0043_viewnormasestatisticas.py create mode 100644 sapl/protocoloadm/migrations/0043_auto_20220919_1705.py create mode 100644 sapl/sessao/migrations/0069_auto_20220919_1705.py diff --git a/sapl/base/migrations/0053_auto_20220919_1705.py b/sapl/base/migrations/0053_auto_20220919_1705.py new file mode 100644 index 000000000..590f064c8 --- /dev/null +++ b/sapl/base/migrations/0053_auto_20220919_1705.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.28 on 2022-09-19 20:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0052_auto_20220914_1125'), + ] + + operations = [ + migrations.AlterField( + model_name='appconfig', + name='sapl_as_sapn', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Utilizar SAPL apenas como SAPL-Normas?'), + ), + ] diff --git a/sapl/base/models.py b/sapl/base/models.py index f6bec5faf..8dc7b7c70 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -104,7 +104,7 @@ class AppConfig(models.Model): choices=ESFERA_FEDERACAO_CHOICES) sapl_as_sapn = models.BooleanField( verbose_name=_( - 'Utilizar SAPL como SAPN?'), + 'Utilizar SAPL apenas como SAPL-Normas?'), choices=YES_NO_CHOICES, default=False) # MÓDULO PARLAMENTARES diff --git a/sapl/context_processors.py b/sapl/context_processors.py index 046cd8ab0..86110cd4f 100644 --- a/sapl/context_processors.py +++ b/sapl/context_processors.py @@ -41,5 +41,5 @@ def sapl_as_sapn(request): 'sapl_as_sapn': sapl_as_sapn_utils(), 'nome_sistema': _('Sistema de Apoio ao Processo Legislativo') if not sapl_as_sapn_utils() - else _('Sistema de Apoio a Publicação de Normas') + else _('Sistema de Apoio à Publicação de Leis e Normas') } diff --git a/sapl/norma/migrations/0043_viewnormasestatisticas.py b/sapl/norma/migrations/0043_viewnormasestatisticas.py new file mode 100644 index 000000000..b14a92645 --- /dev/null +++ b/sapl/norma/migrations/0043_viewnormasestatisticas.py @@ -0,0 +1,35 @@ +# Generated by Django 2.2.28 on 2022-09-19 20:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0042_norma_viewnormasestatisticas'), + ] + + operations = [ + migrations.CreateModel( + name='ViewNormasEstatisticas', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('mais_acessadas', models.PositiveSmallIntegerField(verbose_name='Mais Acessadas')), + ('ano_est', models.PositiveSmallIntegerField(verbose_name='Ano do Registro de Acesso')), + ('mes_est', models.PositiveSmallIntegerField(verbose_name='Mês do Registro de Acesso')), + ('norma_id', models.BigIntegerField(verbose_name='Id da Norma')), + ('norma_count', models.PositiveSmallIntegerField(verbose_name='Mês do Registro de Acesso')), + ('norma_numero', models.CharField(max_length=8, verbose_name='Número da Norma')), + ('norma_ano', models.PositiveSmallIntegerField(verbose_name='Ano da Norma')), + ('norma_ementa', models.TextField(verbose_name='Ementa')), + ('norma_observacao', models.TextField(blank=True, verbose_name='Observação')), + ('norma_tipo_sigla', models.CharField(max_length=3, verbose_name='Sigla do Tipo da Norma')), + ('norma_tipo_descricao', models.CharField(max_length=50, verbose_name='Descrição do Tipo da Norma')), + ('norma_data', models.DateField(verbose_name='Data da Norma')), + ], + options={ + 'db_table': 'norma_viewnormasestatisticas', + 'managed': False, + }, + ), + ] diff --git a/sapl/protocoloadm/migrations/0043_auto_20220919_1705.py b/sapl/protocoloadm/migrations/0043_auto_20220919_1705.py new file mode 100644 index 000000000..adcfd7b18 --- /dev/null +++ b/sapl/protocoloadm/migrations/0043_auto_20220919_1705.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.28 on 2022-09-19 20:05 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0042_auto_20220805_1236'), + ] + + operations = [ + migrations.AlterModelOptions( + name='documentoadministrativo', + options={'ordering': ('ano', 'numero', 'id'), 'verbose_name': 'Documento Administrativo', 'verbose_name_plural': 'Documentos Administrativos'}, + ), + ] diff --git a/sapl/sessao/migrations/0069_auto_20220919_1705.py b/sapl/sessao/migrations/0069_auto_20220919_1705.py new file mode 100644 index 000000000..f37236d3d --- /dev/null +++ b/sapl/sessao/migrations/0069_auto_20220919_1705.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.28 on 2022-09-19 20:05 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('sessao', '0068_auto_20220816_1237'), + ] + + operations = [ + migrations.AlterField( + model_name='correspondencia', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='correspondencia_set', to='sessao.SessaoPlenaria', verbose_name='Sessão Plenária'), + ), + ] diff --git a/sapl/templates/base.html b/sapl/templates/base.html index 936d762b7..96fc0141d 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -11,7 +11,7 @@ - {% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %} + {% block head_title %}{% if sapl_as_sapn %}SAPL-Normas - {% else %}SAPL - {%endif%}{{nome_sistema}}{% endblock %}