Browse Source

Merge c440a1a1d5 into 0d185b2c67

pull/588/merge
Eduardo Edson Batista Cordeiro Alves 9 years ago
committed by GitHub
parent
commit
4f9525ccfc
  1. 2
      sapl/base/forms.py
  2. 20
      sapl/base/migrations/0017_casalegislativa_tipo.py
  3. 20
      sapl/base/migrations/0018_auto_20160919_1036.py
  4. 20
      sapl/base/migrations/0019_auto_20160919_1040.py
  5. 16
      sapl/base/migrations/0020_merge.py
  6. 7
      sapl/base/models.py
  7. 52
      sapl/templates/base.html
  8. 3
      sapl/templates/base/layouts.yaml
  9. 61
      sapl/templates/rodape.html
  10. 5
      sapl/utils.py

2
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'}),

20
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'),
),
]

20
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'),
),
]

20
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'),
),
]

16
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 = [
]

7
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')

52
sapl/templates/base.html

@ -164,6 +164,7 @@
alt="Logo" class="img-responsive visible-lg-inline-block vcenter" >
<span class="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 @@
</main>
{% endblock content_container %}
<footer id="footer" class="footer page__row">
<div class="container">
<div class="row">
<div class="col-md-4">
<a class="footer__logo" href="#">
<img src="{% static 'img/logo_interlegis.png' %}" alt="{% trans 'Logo do Interlegis' %} ">
</a>
<p>
<small>
Desenvolvido pelo <a href="#">Interlegis</a> em software livre e aberto.
</small>
</p>
</div>
<div class="col-md-4">
<a class="footer__logo" href="#">
<img src="{% static 'img/logo_cc.png' %}" alt="{% trans 'Logo do Creative Commons BY SA' %}">
</a>
<p>
<small>
Conteúdo e dados sob licença <a href="#">Creative Commons</a> 4.0 <a href="#">Atribuir Fonte - Compartilhar Igual</a>
</small>
</p>
</div>
<div class="col-md-4">
{% if nome %}
<address>
<small>
<strong>
<span class="org">{{ nome }}</span> de <span class="locality">{{ municipio }}</span> - <abbr class="region" title="{{ state }}">{{ uf }}</abbr>
</strong>
<br>
<span class="street-address">{{ endereco }}</span>
<br> CEP: <span class="postal-code">{{ cep }}</span> | Telefone: <span>{{ telefone }}</span>
<br>
<a href="{{endereco_web}}" class="url">{% trans 'Site da Câmara' %}</a> |
<a href="{{email}}" class="email">{% trans 'Fale Conosco' %}</a>
</small>
</address>
{% else %}
Casa Legislativa não configurada.
<br>
<a href="/casa_legislativa">Favor configurar clicando aqui</a>
{% endif %}
</div>
</div>
</div>
</footer>
{% include 'rodape.html' %}
</div>
{% block foot_js %}

3
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

61
sapl/templates/rodape.html

@ -0,0 +1,61 @@
{% load i18n staticfiles sass_tags menus %}
{% load common_tags %}
<footer id="footer" class="footer page__row">
<div class="container">
<div class="row">
<div class="col-md-4">
<a class="footer__logo" href="#">
<img src="{% static 'img/logo_interlegis.png' %}" alt="{% trans 'Logo do Interlegis' %} ">
</a>
<p>
<small>
Desenvolvido pelo <a href="#">Interlegis</a> em software livre e aberto.
</small>
</p>
</div>
<div class="col-md-4">
<a class="footer__logo" href="#">
<img src="{% static 'img/logo_cc.png' %}" alt="{% trans 'Logo do Creative Commons BY SA' %}">
</a>
<p>
<small>
Conteúdo e dados sob licença <a href="#">Creative Commons</a> 4.0 <a href="#">Atribuir Fonte - Compartilhar Igual</a>
</small>
</p>
</div>
<div class="col-md-4">
{% if nome %}
<address>
<small>
<strong>
{% if tipo == 'A' %}
<span class="org">Assembleia Legislativa</span> de <span class="locality">{{ municipio }}</span> - <abbr class="region" title="{{ state }}">{{ uf }}</abbr>
{% else %}
<span class="org">Câmara Municipal</span> de <span class="locality">{{ municipio }}</span> - <abbr class="region" title="{{ state }}">{{ uf }}</abbr>
{% endif %}
</strong>
<br>
<span class="street-address">{{ endereco }}</span>
<br> CEP: <span class="postal-code">{{ cep }}</span> | Telefone: <span>{{ telefone }}</span>
<br>
<a href="{{endereco_web}}" class="url">
{% if tipo == 'A' %}
{% trans 'Site da Assembleia' %}
{% else %}
{% trans 'Site da Câmara' %}
{% endif %}</a> |
<a href="{{email}}" class="email">{% trans 'Fale Conosco' %}</a>
</small>
</address>
{% else %}
Casa/Assembleia Legislativa não configurada.
<br>
<a href="/casa_legislativa">Favor configurar clicando aqui</a>
{% endif %}
</div>
</div>
</div>
</footer>

5
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)

Loading…
Cancel
Save