mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-22 21:11:57 +00:00
global: adds routes for tug
This: migrated from invenio-theme-tugraz
This commit is contained in:
@@ -49,3 +49,6 @@ recursive-include invenio_config_tugraz *.html
|
||||
|
||||
# added by check-manifest
|
||||
recursive-include invenio_config_tugraz *.csv
|
||||
|
||||
# added by check-manifest
|
||||
recursive-include invenio_config_tugraz *.pdf
|
||||
|
||||
@@ -38,6 +38,8 @@ Override configs from diffrent invenio modules to meet TU Graz requirement:
|
||||
* Invenio-Mail
|
||||
* Invenio-shibboleth
|
||||
* Invenio-accounts
|
||||
* Flask-security
|
||||
* Defined routes for TUG
|
||||
|
||||
Further documentation is available on
|
||||
https://invenio-config-tugraz.readthedocs.io/
|
||||
|
||||
@@ -29,6 +29,13 @@ INVENIO_CONFIG_TUGRAZ_IP_RANGES =
|
||||
[["127.0.0.2", "127.0.0.99"], ["127.0.1.3", "127.0.1.5"]]
|
||||
"""
|
||||
|
||||
CONFIG_TUGRAZ_ROUTES = {
|
||||
"guide": "/guide",
|
||||
"terms": "/terms",
|
||||
"gdpr": "/gdpr",
|
||||
}
|
||||
"""Defined routes for TUG."""
|
||||
|
||||
# Invenio-App
|
||||
# ===========
|
||||
# See https://invenio-app.readthedocs.io/en/latest/configuration.html
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,10 +4,10 @@
|
||||
|
||||
{{ _('To help you get started, here are some useful links:') }}
|
||||
|
||||
- {{ _('Guidelines:')}} {{ _('Repository Guide')}} ({{ _('how to upload files')}}) (https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.guide') }})
|
||||
- {{ _('Guidelines:')}} {{ _('Repository Guide')}} ({{ _('how to upload files')}}) (https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_config_tugraz.guide') }})
|
||||
- {{ _('Search Guide')}} (https://{{ config.SITE_HOSTNAME }}{{url_for('invenio_app_rdm.help_search')}})
|
||||
- {{ _('Terms And Conditions') }} (https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.terms') }})
|
||||
- {{ _('Data Protection Rights')}} (https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.gdpr') }})
|
||||
- {{ _('Terms And Conditions') }} (https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_config_tugraz.terms') }})
|
||||
- {{ _('Data Protection Rights')}} (https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_config_tugraz.gdpr') }})
|
||||
{% if security.confirmable %}
|
||||
{{ _('You can confirm your email through the link below:') }}
|
||||
{{ confirmation_link }}">
|
||||
|
||||
@@ -12,17 +12,25 @@ from os import environ
|
||||
from typing import Dict
|
||||
|
||||
from elasticsearch_dsl.utils import AttrDict
|
||||
from flask import Blueprint, current_app
|
||||
from flask import Blueprint, current_app, redirect, url_for
|
||||
from flask_babelex import get_locale
|
||||
|
||||
|
||||
def ui_blueprint(app):
|
||||
"""Blueprint for the routes and resources provided by invenio-config-tugraz."""
|
||||
routes = app.config.get("CONFIG_TUGRAZ_ROUTES")
|
||||
|
||||
blueprint = Blueprint(
|
||||
"invenio_config_tugraz",
|
||||
__name__,
|
||||
template_folder="templates",
|
||||
static_folder="static",
|
||||
)
|
||||
|
||||
blueprint.add_url_rule(routes["guide"], view_func=guide)
|
||||
blueprint.add_url_rule(routes["terms"], view_func=terms)
|
||||
blueprint.add_url_rule(routes["gdpr"], view_func=gdpr)
|
||||
|
||||
@blueprint.before_app_first_request
|
||||
def rank_higher():
|
||||
"""Rank this modules blueprint higher than blueprint of security module."""
|
||||
@@ -42,3 +50,27 @@ def ui_blueprint(app):
|
||||
blueprints[our_index] = temp
|
||||
|
||||
return blueprint
|
||||
|
||||
|
||||
def guide():
|
||||
"""TUGraz_Repository_Guide."""
|
||||
locale = get_locale()
|
||||
return redirect(url_for('static',
|
||||
filename=f'documents/TUGraz_Repository_Guide_02_{locale}.pdf',
|
||||
_external=True))
|
||||
|
||||
|
||||
def terms():
|
||||
"""Terms_And_Conditions."""
|
||||
locale = get_locale()
|
||||
return redirect(url_for('static',
|
||||
filename=f'documents/TUGraz_Repository_Terms_And_Conditions_{locale}.pdf',
|
||||
_external=True))
|
||||
|
||||
|
||||
def gdpr():
|
||||
"""General_Data_Protection_Rights."""
|
||||
locale = get_locale()
|
||||
return redirect(url_for('static',
|
||||
filename=f'documents/TUGraz_Repository_General_Data_Protection_Rights_{locale}.pdf',
|
||||
_external=True))
|
||||
|
||||
Reference in New Issue
Block a user