diff --git a/invenio_theme_tugraz/config.py b/invenio_theme_tugraz/config.py index 9c96d64..1a49435 100644 --- a/invenio_theme_tugraz/config.py +++ b/invenio_theme_tugraz/config.py @@ -119,6 +119,9 @@ DEPOSITS_HEADER_TEMPLATE = "invenio_theme_tugraz/header.html" TUG_ROUTES = { "index": "/", "comingsoon": "/comingsoon", + "guide": "/guide", + "terms": "/terms", + "gdpr": "/gdpr", "deposit_create": "/uploads/new", "deposit_edit": "/uploads/", "getdoi": "/getdoi", diff --git a/invenio_theme_tugraz/static/documents/TUGraz_Repository_General_Data_Protection_Rights_en.pdf b/invenio_theme_tugraz/static/documents/TUGraz_Repository_General_Data_Protection_Rights_en.pdf new file mode 100644 index 0000000..c65a678 Binary files /dev/null and b/invenio_theme_tugraz/static/documents/TUGraz_Repository_General_Data_Protection_Rights_en.pdf differ diff --git a/invenio_theme_tugraz/static/documents/TUGraz_Repository_Guide_01_en.pdf b/invenio_theme_tugraz/static/documents/TUGraz_Repository_Guide_01_en.pdf new file mode 100644 index 0000000..1201a23 Binary files /dev/null and b/invenio_theme_tugraz/static/documents/TUGraz_Repository_Guide_01_en.pdf differ diff --git a/invenio_theme_tugraz/static/documents/TUGraz_Repository_Terms_And_Conditions_en.pdf b/invenio_theme_tugraz/static/documents/TUGraz_Repository_Terms_And_Conditions_en.pdf new file mode 100644 index 0000000..0af7e4a Binary files /dev/null and b/invenio_theme_tugraz/static/documents/TUGraz_Repository_Terms_And_Conditions_en.pdf differ diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html index a240cd5..1c87b27 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html @@ -34,17 +34,17 @@ details. {{_ ("Documentation")}}
- {{_ ("Reference Guide")}}
- {{_ ("Data Protection")}}
- {{_ ("Terms and Conditions")}} diff --git a/invenio_theme_tugraz/views.py b/invenio_theme_tugraz/views.py index 1c15bc8..22d0386 100644 --- a/invenio_theme_tugraz/views.py +++ b/invenio_theme_tugraz/views.py @@ -14,7 +14,8 @@ from typing import Dict import requests from elasticsearch_dsl.utils import AttrDict -from flask import Blueprint, current_app, g, render_template, request +from flask import Blueprint, current_app, g, redirect, render_template, request, url_for +from flask_babelex import get_locale from flask_login import login_required from flask_menu import current_menu from invenio_app_rdm.records_ui.views.decorators import ( @@ -49,6 +50,9 @@ def ui_blueprint(app): blueprint.add_url_rule(routes["index"], view_func=index) blueprint.add_url_rule(routes["comingsoon"], view_func=comingsoon) + 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.add_url_rule(routes["deposit_create"], view_func=deposit_create) blueprint.add_url_rule(routes["record_detail"], view_func=record_detail) blueprint.add_url_rule(routes["getdoi"], view_func=retrieve_doi, methods=["POST"]) @@ -82,6 +86,30 @@ def comingsoon(): return render_template("invenio_theme_tugraz/comingsoon.html") +def guide(): + """TUGraz_Repository_Guide.""" + locale = get_locale() + return redirect(url_for('static', + filename=f'documents/TUGraz_Repository_Guide_01_{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)) + + def get_datacite_details(): """Application credentials for DOI.""" prefix = environ.get("INVENIO_DATACITE_PREFIX")