Skip to content

Commit

Permalink
Deixa a mensagem no topo da home configurável e com possibilidade de …
Browse files Browse the repository at this point in the history
…acrescentar um link para a versão anterior do website. (#1897)
  • Loading branch information
robertatakenaka committed May 21, 2021
1 parent 370934d commit dfd284a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
20 changes: 12 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ Guia de configuração do site
Pode acessar `nossa wiki <https://github.com/scieloorg/opac/wiki/Configura%C3%A7%C3%A3o-padr%C3%A3o-e-vari%C3%A1veis-de-ambiente>`_ para ter uma guia completa e como ajustar a configuração a partir de un arquivo de configuração em cada instância ou utilizando variáveis de ambiente.


Caso queira apresentar na home do website que o atual tem versão anterior

PREVIOUS_WEBSITE_URI=https://old.scielo.br


Caso queira apresentar na home do website qualquer mensagem de texto

ALERT_MSG_PT=Novo portal pode conter incorreções
ALERT_MSG_EN=New portal may contain inaccuracies
ALERT_MSG_ES=Nuevo portal puede contener incorrecciones


======================
Como executar os tests
======================
Expand Down Expand Up @@ -127,11 +139,3 @@ Reportar problemas, ou solicitar mudanças

Para reportar problemas, bugs, ou simplesmente solicitar alguma nova funcionalidade, pode `criar um ticket <https://github.com/scieloorg/opac/issues>`_ com seus pedidos.


=========================================
Equipe responsável por instalação, desenvolvimento e manutenção
=========================================

- Jamil Atta Junior (Desenvolvimento) <jamil.atta@scielo.org>
- Juan Funez (Desenvolvimento) <juan.funez@scielo.org>
- Rondineli Gama Saad (Infraestrutura) <rondineli.saad@scielo.org>
9 changes: 9 additions & 0 deletions opac/webapp/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,3 +524,12 @@
APM_DISABLE_SEND = os.environ.get("OPAC_APM_DISABLE_SEND", False)
APM_INSTRUMENT = os.environ.get("OPAC_APM_INSTRUMENT", True)
APM_VERIFY_SERVER_CERT = os.environ.get("OPAC_APM_APM_VERIFY_SERVER_CERT", True)

# Caso queira apresentar na home do website que o atual tem versão anterior
PREVIOUS_WEBSITE_URI = os.environ.get("PREVIOUS_WEBSITE_URI", '')

# Caso queira apresentar na home do website qualquer mensagem de texto
ALERT_MSG_PT = os.environ.get("ALERT_MSG_PT", '')
ALERT_MSG_EN = os.environ.get("ALERT_MSG_EN", '')
ALERT_MSG_ES = os.environ.get("ALERT_MSG_ES", '')
ALERT_MSG = bool(ALERT_MSG_PT or ALERT_MSG_EN or ALERT_MSG_ES)
28 changes: 22 additions & 6 deletions opac/webapp/templates/collection/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@
{% block content %}
<div class="alert-warning" style="padding: 0 5px; text-align: center">
{% with html_lang=session.get('lang', config.get('BABEL_DEFAULT_LOCALE')) %}
{% if html_lang == 'pt_BR' %}
<strong>Novo portal</strong> - pode conter incorreções
{% elif html_lang == 'en' %}
<strong>New portal</strong> - may contain inaccuracies
{% elif html_lang == 'es' %}
<strong>Nuevo portal</strong> - puede contener incorrecciones
{% if config.get('ALERT_MSG') %}
<span>
{% if html_lang == 'pt_BR' %}
{{ config.get('ALERT_MSG_PT') }}
{% elif html_lang == 'es' %}
{{ config.get('ALERT_MSG_ES') }}
{% else %}
{{ config.get('ALERT_MSG_EN') }}
{% endif %}
</span>
{% endif %}

{% if config.get('PREVIOUS_WEBSITE_URI') %}
{% if '://' in config.get('PREVIOUS_WEBSITE_URI') %}
<a href="{{ config.get('PREVIOUS_WEBSITE_URI') }}">
{{ config.get('PREVIOUS_WEBSITE_URI') }}
</a>
{% else %}
<a href="https://{{ config.get('PREVIOUS_WEBSITE_URI') }}">
{{ config.get('PREVIOUS_WEBSITE_URI') }}
</a>
{% endif %}
{% endif %}
{% endwith %}
</div>
Expand Down

0 comments on commit dfd284a

Please sign in to comment.