Browse Source

add context_processor para sapl as sapn

pull/3357/head
Leandro Roberto 5 years ago
parent
commit
6b0868ea6e
  1. 10
      sapl/context_processors.py
  2. 1
      sapl/settings.py
  3. 4
      sapl/templates/base.html

10
sapl/context_processors.py

@ -1,5 +1,6 @@
import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from sapl.utils import google_recaptcha_configured as google_recaptcha_configured_utils
@ -32,3 +33,12 @@ def google_recaptcha_configured(request):
logger.warning(_('Google Recaptcha não configurado.'))
return {'google_recaptcha_configured': False}
return {'google_recaptcha_configured': True}
def sapl_as_sapn(request):
return {
'sapl_as_sapn': settings.SAPL_AS_SAPN,
'nome_sistema': _('Sistema de Apoio ao Processo Legislativo')
if not settings.SAPL_AS_SAPN
else _('Sistema de Apoio a Publicação de Normas')
}

1
sapl/settings.py

@ -197,6 +197,7 @@ TEMPLATES = [
'sapl.context_processors.parliament_info',
'sapl.context_processors.mail_service_configured',
'sapl.context_processors.google_recaptcha_configured',
'sapl.context_processors.sapl_as_sapn',
],
'debug': DEBUG

4
sapl/templates/base.html

@ -90,7 +90,7 @@
<img src="{% if logotipo %}{{ MEDIA_URL }}{{ logotipo }}{% else %}{% webpack_static 'img/logo.png' %}{% endif %}"
alt="Logo" class="img-responsive" >
<span class="vcenter">{% if nome %}{{ nome }}{% else %}{% trans 'Câmara/Assembléia não configurada'%}{% endif %}
<br/><small>{% trans 'Sistema de Apoio ao Processo Legislativo' %}</small>
<br/><small>{{nome_sistema}}</small>
</span>
</a>
</div>
@ -226,7 +226,7 @@
{% block webpack_loader_js %}
{% render_chunk_vendors 'js' %}
{% render_bundle 'global' 'js' %}
{% render_bundle 'global' 'js' %}
{% endblock webpack_loader_js %}
{% block webpack_loader_chunks_js %}

Loading…
Cancel
Save