diff --git a/sapl/base/forms.py b/sapl/base/forms.py index 8a28dabbe..8bff1f4fa 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -242,6 +242,7 @@ class CasaLegislativaForm(ModelForm): model = CasaLegislativa fields = ['codigo', + 'tipo', 'nome', 'sigla', 'endereco', @@ -257,6 +258,7 @@ class CasaLegislativaForm(ModelForm): widgets = { 'uf': forms.Select(attrs={'class': 'selector'}), + 'tipo': forms.Select(attrs={'class': 'selector'}), 'cep': forms.TextInput(attrs={'class': 'cep'}), 'telefone': forms.TextInput(attrs={'class': 'telefone'}), 'fax': forms.TextInput(attrs={'class': 'telefone'}), diff --git a/sapl/base/migrations/0017_casalegislativa_tipo.py b/sapl/base/migrations/0017_casalegislativa_tipo.py new file mode 100644 index 000000000..abfd7c961 --- /dev/null +++ b/sapl/base/migrations/0017_casalegislativa_tipo.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-09-19 13:26 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0016_auto_20160701_0940'), + ] + + operations = [ + migrations.AddField( + model_name='casalegislativa', + name='tipo', + field=models.CharField(blank=True, choices=[('A', 'Assembleia Legislativa'), ('C', 'Casa Legislativa')], max_length=1, verbose_name='Tipo'), + ), + ] diff --git a/sapl/base/migrations/0018_auto_20160919_1036.py b/sapl/base/migrations/0018_auto_20160919_1036.py new file mode 100644 index 000000000..1c69b27ad --- /dev/null +++ b/sapl/base/migrations/0018_auto_20160919_1036.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-09-19 13:36 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0017_casalegislativa_tipo'), + ] + + operations = [ + migrations.AlterField( + model_name='casalegislativa', + name='tipo', + field=models.CharField(choices=[('A', 'Assembleia Legislativa'), ('C', 'Casa Legislativa')], max_length=1, verbose_name='Tipo'), + ), + ] diff --git a/sapl/base/migrations/0019_auto_20160919_1040.py b/sapl/base/migrations/0019_auto_20160919_1040.py new file mode 100644 index 000000000..c7849471b --- /dev/null +++ b/sapl/base/migrations/0019_auto_20160919_1040.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-09-19 13:40 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0018_auto_20160919_1036'), + ] + + operations = [ + migrations.AlterField( + model_name='casalegislativa', + name='tipo', + field=models.CharField(choices=[('A', 'Assembleia Legislativa'), ('C', 'Casa Legislativa')], default='C', max_length=1, verbose_name='Tipo'), + ), + ] diff --git a/sapl/base/migrations/0020_merge.py b/sapl/base/migrations/0020_merge.py new file mode 100644 index 000000000..5ffa8a55a --- /dev/null +++ b/sapl/base/migrations/0020_merge.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-09-19 16:34 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0018_auto_20160919_1333'), + ('base', '0019_auto_20160919_1040'), + ] + + operations = [ + ] diff --git a/sapl/base/models.py b/sapl/base/models.py index 86a685ef4..6feb82ad8 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -3,7 +3,7 @@ from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ -from sapl.utils import UF, YES_NO_CHOICES +from sapl.utils import UF, YES_NO_CHOICES, CASA_CHOICES TIPO_DOCUMENTO_ADMINISTRATIVO = (('O', _('Ostensivo')), ('R', _('Restritivo'))) @@ -50,6 +50,11 @@ class CasaLegislativa(models.Model): blank=True, verbose_name=_('Informação Geral')) + # Determina se é Assembleia ou Casa + tipo = models.CharField( + max_length=1, verbose_name=_('Tipo'), + choices=CASA_CHOICES, default='C') + class Meta: verbose_name = _('Casa Legislativa') verbose_name_plural = _('Casa Legislativa') diff --git a/sapl/templates/base.html b/sapl/templates/base.html index 03617f5ac..36a87b954 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -164,6 +164,7 @@ alt="Logo" class="img-responsive visible-lg-inline-block vcenter" > {# XXX Make better use of translation tags in html blocks ie. actually use the proper blocktrans tag efficiently #} + {% if tipo == 'C' %} Casa Municipal {% else %} Assembleia Legislativa {% endif %} {% if nome %} {{ nome }} {% trans 'de' %} {{ municipio }} - {{ uf }} {% else %} @@ -224,56 +225,7 @@ {% endblock content_container %} - - + {% include 'rodape.html' %} {% block foot_js %} diff --git a/sapl/templates/base/layouts.yaml b/sapl/templates/base/layouts.yaml index ebe0abc8b..fecd5b06d 100644 --- a/sapl/templates/base/layouts.yaml +++ b/sapl/templates/base/layouts.yaml @@ -1,7 +1,8 @@ {% load i18n %} + CasaLegislativa: {% trans 'Casa Legislativa' %}: - - codigo:2 nome sigla + - codigo:1 tipo:3 nome sigla - endereco:8 cep - municipio:10 uf - telefone fax diff --git a/sapl/templates/rodape.html b/sapl/templates/rodape.html new file mode 100644 index 000000000..a327d3145 --- /dev/null +++ b/sapl/templates/rodape.html @@ -0,0 +1,61 @@ +{% load i18n staticfiles sass_tags menus %} +{% load common_tags %} + + diff --git a/sapl/utils.py b/sapl/utils.py index 3f63c30df..53ce7f64c 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -111,6 +111,11 @@ TURNO_TRAMITACAO_CHOICES = [ ('C', _('2ª e 3ª Votação')), ] +CASA_CHOICES = [ + ('A', _('Assembleia Legislativa')), + ('C', _('Casa Legislativa')), +] + def listify(function): @wraps(function)