Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: fix global homepage #570

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 80 additions & 66 deletions rero_ils/templates/rero_ils/frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,65 +53,100 @@ <h2>{{ _('A wealth of knowledge just a click away') }}</h2>
<div class="container">
<article class="row mt-4">
<section class="col-md-4">
<h3>RERO ILS</h3>
{% if current_i18n.language == 'en' %}
<h3>The project</h3>
<p>The RERO ILS project aims at creating the future RERO Integrated Library System, using components of the <a href="https://inveniosoftware.org" class="rero-ils-external-link">Invenio</a> framework. This site provides a permanent, public demonstration instance of the software under development, with daily integration of new features.</p>
<p>This project is developed using Agile principles, namely <a href="https://www.scrumguides.org/scrum-guide.html" class="rero-ils-external-link">Scrum</a>, pair programming and continuous integration.</p>
{% endif %}
{% if current_i18n.language == 'fr' %}
<h3>Le projet</h3>
<p>Le projet RERO ILS a pour but de créer le futur système de gestion de bibliothèque de RERO basé sur le framework <a href="https://inveniosoftware.org" class="rero-ils-external-link">Invenio</a>. Ce site propose une instance publique et permanente du logiciel en cours de développement, avec une intégration continue des nouvelles fonctionnalités.</p>
<p>Ce projet est développé selon des principes agiles, à savoir <a href="https://www.scrumguides.org/scrum-guide.html" class="rero-ils-external-link">Scrum</a>, en programmation par paires et en intégration continue.</p>
{% endif %}

{% if current_i18n.language == 'de' %}
<h3>Das Projekt</h3>
<p>Das Projekt RERO ILS zielt darauf ab, das zukünftige Bibliotheksverwaltungssystem von RERO auf der Basis des <a href="https://inveniosoftware.org" class="rero-ils-external-link">Invenio</a> Frameworks zu erschaffen. Diese Website bietet eine permanente, öffentliche Demonstration der Software in Entwicklung an. Neue Funktionen werden täglich integriert.</p>
<p>Das Projekt ist nach agilen Prinzipien (<a href="https://www.scrumguides.org/scrum-guide.html" class="rero-ils-external-link">Scrum</a>), in Peer Programming und mit kontinuierlicher Integration, entwickelt.</p>
{% endif %}

{% if current_i18n.language == 'it' %}
<h3>Il progetto</h3>
<p>Il progetto RERO ILS mira a creare il futuro Sistema di Biblioteca Integrato RERO, utilizzando componenti del framework <a href="https://inveniosoftware.org" class="rero-ils-external-link">Invenio</a>. Questo sito fornisce una dimostrazione permanente e pubblica delsoftware in fase di sviluppo, con integrazione quotidiana di nuove funzionalità.</p>
<p>Il progetto è sviluppato utilizzando i principi Agile, cioè <a href="https://www.scrumguides.org/scrum-guide.html" class="rero-ils-external-link">Scrum</a>, programmazione di coppia e integrazione continua.</p>
{% endif %}
<a href="http://www.rero21.ch" class="rero-ils-external-link">rero21.ch</a>
<section class="mt-4">
<section class="d-flex flex-row mb-2">
<a href="https://tree.taiga.io/project/rero21-reroils/backlog" class="align-self-center" title="{{ _('Link to the RERO ILS backlog on Taiga') }}">
<img class="card-img-top rero-ils-list-logo" src="{{ url_for('static', filename='images/logo-taiga-color.png') }}" alt="Taiga logo, star made of different greens">
</a>
<p class="card-text pl-2 align-self-center">
{{_('Scrum process')}}
<a href="https://tree.taiga.io/project/rero21-reroils/backlog" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS backlog on Taiga') }}">{{_('on Taiga')}}</a>
</p>
</section>
<section class="d-flex flex-row">
<a href="https://github.com/rero/rero-ils" class="align-self-center" title="{{ _('Link to the RERO ILS code source on GitHub') }}">
<i class="fa fa-2x fa-github card-img-top text-dark"></i>
</a>
<p class="card-text pl-2 align-self-center">
{{_('Software source code')}}
<a href="https://github.com/rero/rero-ils" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS code source on GitHub') }}">{{_('on GitHub')}}</a>, {{ _('version') }}
{% if config.RERO_ILS_APP_GIT_HASH %}
<a href="https://github.com/rero/rero-ils/commit/{{ config.RERO_ILS_APP_GIT_HASH }}" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS code source on Github, current used version') }}">{{ config.RERO_ILS_APP_GIT_HASH[:8] }}</a>
{% else %}
<a href="https://github.com/rero/rero-ils/releases/tag/v{{ version }}" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS code source on GitHub, current used version') }}">{{ version }}</a>
{% endif %}
</p>
</section>
<section class="d-flex flex-row">
<a href="http://twitter.com/rero_centrale" class="align-self-center" title="{{ _('Link to the RERO Twitter account') }}">
<i class="fa fa-2x fa-twitter card-img-top text-dark"></i>
</a>
<p class="card-text pl-2 align-self-center">
<a href="http://twitter.com/rero_centrale" class="rero-ils-external-link" title="{{ _('Link to the RERO Twitter account') }}">@rero_centrale</a>
</p>
</section>
</section>
</section>
<section class="col-md-4 bg-dark text-white rounded" >
{% if current_i18n.language == 'en' %}
<h3>Test RERO ILS</h3>
<p>As an anonymous user
<p>As a patron, login with: </br>
reroilstest+giulia@gmail.com / 123456</p>
<p>As a system librarian: </br>
reroilstest@gmail.com / 123456</p>
<h4>Help</h4>
<p>More test logins and documentation is available on the <a href="https://github.com/rero/rero-ils/wiki/Public-demo-help" class="rero-ils-external-link">help page</a></p>
{% endif %}
{% if current_i18n.language == 'fr' %}
<h3>Testez RERO ILS</h3>
<p>En tant qu'utilisateur anonyme
<p>En tant que lecteur, connectez-vous avec: </br>
reroilstest+giulia@gmail.com / 123456</p>
<p>En tant que libraire système: </br>
reroilstest@gmail.com / 123456</p>
<h4>Aide</h4>
<p>Plus de tests et d'informations disponible sur la <a href="https://github.com/rero/rero-ils/wiki/Public-demo-help" class="rero-ils-external-link">page d'aide</a></p>
{% endif %}
{% if current_i18n.language == 'de' %}
<h3>Testen Sie RERO ILS</h3>
<p>Als anonymer Benutzer
<p>Melden Sie sich als Benutzer an mit: </br>
reroilstest+giulia@gmail.com / 123456</p>
<p>Als Systembibliothekar: </br>
reroilstest@gmail.com / 123456</p>
<h4>Hilfe</h4>
<p>Weitere Testanmeldungen und Dokumentationen finden Sie auf der <a href="https://github.com/rero/rero-ils/wiki/Public-demo-help" class="rero-ils-external-link">Hilfeseite</a></p>
{% endif %}
{% if current_i18n.language == 'it' %}
<h3>Testare il progetto</h3>
<p>Come utente anonimo
<p>Come utente, accedi con: </br>
reroilstest+giulia@gmail.com / 123456</p>
<p>Come bibliotecario di sistema: </br>
reroilstest@gmail.com / 123456</p>
<h4>Aiuto</h4>
<p>Ulteriori accessi di prova e documentazione sono disponibili nella <a href="https://github.com/rero/rero-ils/wiki/Public-demo-help" class="rero-ils-external-link">pagina di aiuto</a></p>
{% endif %}
</section>
<section class="col-md-4">
<section class="mb-4">
<h3>{{ _('Follow Us') }}</h3>
<section class="d-flex flex-row mb-2">
<a href="https://tree.taiga.io/project/rero21-reroils/backlog" class="align-self-center" title="{{ _('Link to the RERO ILS backlog on Taiga') }}">
<img class="card-img-top rero-ils-list-logo" src="{{ url_for('static', filename='images/logo-taiga-color.png') }}" alt="Taiga logo, star made of different greens">
</a>
<p class="card-text pl-2 align-self-center">
{{_('Scrum process')}}
<a href="https://tree.taiga.io/project/rero21-reroils/backlog" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS backlog on Taiga') }}">{{_('on Taiga')}}</a>
</p>
</section>
<section class="d-flex flex-row">
<a href="https://github.com/rero/rero-ils" class="align-self-center" title="{{ _('Link to the RERO ILS code source on GitHub') }}">
<i class="fa fa-2x fa-github card-img-top text-dark"></i>
</a>
<p class="card-text pl-2 align-self-center">
{{_('Software source code')}}
<a href="https://github.com/rero/rero-ils" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS code source on GitHub') }}">{{_('on GitHub')}}</a>, {{ _('version') }}
{% if config.RERO_ILS_APP_GIT_HASH %}
<a href="https://github.com/rero/rero-ils/commit/{{ config.RERO_ILS_APP_GIT_HASH }}" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS code source on GitHub, current used version') }}">{{ config.RERO_ILS_APP_GIT_HASH[:8] }}</a>
{% else %}
<a href="https://github.com/rero/rero-ils/releases/tag/v{{ version }}" class="rero-ils-external-link" title="{{ _('Link to the RERO ILS code source on GitHub, current used version') }}">{{ version }}</a>
{% endif %}
</p>
</section>
<section class="d-flex flex-row">
<a href="http://twitter.com/rero_centrale" class="align-self-center" title="{{ _('Link to the RERO Twitter account') }}">
<i class="fa fa-2x fa-twitter card-img-top text-dark"></i>
</a>
<p class="card-text pl-2 align-self-center">
<a href="http://twitter.com/rero_centrale" class="rero-ils-external-link" title="{{ _('Link to the RERO Twitter account') }}">@rero_centrale</a>
</p>
</section>
</section>
<section class="mb-4">
<h3>{{_('Help')}}</h3>
<p>{{_('See the')}} <a href="{{ url_for('rero_ils.help') }}" class="rero-ils-external-link" title="{{ _('Link to the help page for this demonstration Website') }}">{{_('help page')}}</a></p>
</section>
<section>
{% if viewcode == config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE %}
<h3>{{ _('Organisations\' catalogues') }}</h3>
Expand All @@ -126,27 +161,6 @@ <h3>{{ _('Union catalogue') }}</h3>
{% endif %}
</section>
</section>
<section class="col-md-4">
<section class="mb-4">
<h3 class="mb-0">{{ _('Future') }}</h3>
<a href="https://rero21.ch" class="mb-2" title="{{ _('Link to the RERO 21 blog') }}">
<img src="{{ url_for('static', filename='images/rero21.svg') }}" alt="RERO 21 logo" class="rero-ils-rero21-logo">
</a>
</section>
<section class="mt-2 rero-ils-rero-logo">
<h3 class="mb-0">{{ _('Present') }}</h3>
<a href="https://explore.rero.ch" class="btn btn-rero btn-lg mb-2" title="{{ _('Link to RERO Explore') }}">
<img src="{{ url_for('static', filename='images/logo_explore_height_119.png') }}" alt="RERO Explore logo">
</a>
<a href="https://doc.rero.ch" class="btn btn-rero btn-lg mb-2" title="{{ _('Link to RERO DOC') }}">
<img src="{{ url_for('static', filename='images/logo_rerodoc_height_119.png') }}" alt="RERO DOC logo">
</a>
<h4>
<a href="https://rero.ch" class="rero-ils-external-link" title="{{ _('Link to the RERO Website') }}">
www.rero.ch</a>
</h4>
</section>
</section>
</article>
</div>
{%- endblock body %}
Expand Down
13 changes: 10 additions & 3 deletions rero_ils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,16 @@ def index():
@check_organisation_viewcode
def index_with_view_code(viewcode):
"""Home Page."""
return render_template('rero_ils/frontpage.html',
version=__version__,
viewcode=viewcode)
if viewcode == current_app.config.get('RERO_ILS_SEARCH_GLOBAL_VIEW_CODE'):
return redirect(url_for(
'rero_ils.index'
))
else:
return render_template(
'rero_ils/frontpage.html',
version=__version__,
viewcode=viewcode
)


@blueprint.route('/help')
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_view_parameter_exists(client):
'rero_ils.index_with_view_code',
viewcode='global'
))
assert result.status_code == 200
assert result.status_code == 302


def test_view_parameter_notfound(client):
Expand Down