diff --git a/sapl/painel/forms.py b/sapl/painel/forms.py index 3366b7384..008243ee1 100644 --- a/sapl/painel/forms.py +++ b/sapl/painel/forms.py @@ -21,7 +21,8 @@ class ConfiguracoesPainelForm(forms.ModelForm): fields = ['cronometro_ordem', 'disparo_cronometro', 'tempo_disparo_antecedencia', - 'tempo_disparo_termino'] + 'tempo_disparo_termino', + 'exibir_nome_casa'] def __init__(self, *args, **kwargs): super(ConfiguracoesPainelForm, self).__init__(*args, **kwargs) diff --git a/sapl/painel/migrations/0008_painelconfig_exibir_nome_casa.py b/sapl/painel/migrations/0008_painelconfig_exibir_nome_casa.py new file mode 100644 index 000000000..01fb863f7 --- /dev/null +++ b/sapl/painel/migrations/0008_painelconfig_exibir_nome_casa.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-06-26 14:49 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('painel', '0007_painelconfig_tempo_disparo_termino'), + ] + + operations = [ + migrations.AddField( + model_name='painelconfig', + name='exibir_nome_casa', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Exibir nome da Casa Legislativa no painel?'), + ), + ] diff --git a/sapl/painel/models.py b/sapl/painel/models.py index 97ed3b138..d3420e284 100644 --- a/sapl/painel/models.py +++ b/sapl/painel/models.py @@ -90,6 +90,10 @@ class PainelConfig(models.Model): blank=True, null=True) + exibir_nome_casa = models.BooleanField( + verbose_name=_('Exibir nome da Casa Legislativa no painel?'), + choices=YES_NO_CHOICES, default=True) + class Meta: verbose_name = _('Configurações do Painel') verbose_name_plural = _('Configurações do Painel') diff --git a/sapl/painel/views.py b/sapl/painel/views.py index c79336937..b42bcfc78 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -339,7 +339,8 @@ def painel_view(request, pk): context = {'head_title': str(_('Painel Plenário')), 'sessao_id': pk, 'cronometros': Cronometro.objects.filter(ativo=True).order_by('ordenacao'), - 'painel_config': PainelConfig.objects.first() + 'painel_config': PainelConfig.objects.first(), + 'casa': CasaLegislativa.objects.last() } return render(request, 'painel/index.html', context) diff --git a/sapl/templates/painel/index.html b/sapl/templates/painel/index.html index b6007a163..4e146ba0a 100644 --- a/sapl/templates/painel/index.html +++ b/sapl/templates/painel/index.html @@ -36,6 +36,11 @@
+ {% if painel_config.exibir_nome_casa %} +