Skip to content

Commit

Permalink
global: route blueprint migrated to config-tugraz
Browse files Browse the repository at this point in the history
This is required to make sure config module is independent
  • Loading branch information
mb-wali committed Jun 4, 2021
1 parent 4aa72c0 commit b76f27c
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 38 deletions.
3 changes: 0 additions & 3 deletions invenio_theme_tugraz/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,4 @@
TUG_ROUTES = {
"index": "/",
"comingsoon": "/comingsoon",
"guide": "/guide",
"terms": "/terms",
"gdpr": "/gdpr",
}
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.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2>{{_ ("Repository")}}</h2>
{{_ ("Documentation")}} <i class="external alternate icon"></i>
</a>
<br>
<a href="{{ url_for('invenio_theme_tugraz.guide') }}"
<a href="{{ url_for('invenio_config_tugraz.guide') }}"
title="Quick guide" target="_blank">
{{_ ("Reference Guide")}} <i class="download icon"></i>
</a>
Expand All @@ -44,12 +44,12 @@ <h2>{{_ ("Repository")}}</h2>
{{_ ("Search Guide")}}<i class="angle right icon"></i>
</a>
<br>
<a href="{{ url_for('invenio_theme_tugraz.gdpr') }}"
<a href="{{ url_for('invenio_config_tugraz.gdpr') }}"
title="General Data Protection Rights" target="_blank">
{{_ ("Data Protection")}} <i class="download icon"></i>
</a>
<br>
<a href="{{ url_for('invenio_theme_tugraz.terms') }}"
<a href="{{ url_for('invenio_config_tugraz.terms') }}"
title="Terms and Conditions" target="_blank">
{{_ ("Terms and Conditions")}} <i class="download icon"></i>
</a>
Expand Down
33 changes: 1 addition & 32 deletions invenio_theme_tugraz/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
from os import environ
from typing import Dict

import requests
from elasticsearch_dsl.utils import AttrDict
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 flask import Blueprint, render_template
from invenio_app_rdm.records_ui.views.decorators import (
pass_is_preview,
pass_record_files,
Expand All @@ -41,9 +37,6 @@ 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.app_template_filter("make_dict_like")
def make_dict_like(value: str, key: str) -> Dict[str, str]:
Expand Down Expand Up @@ -84,30 +77,6 @@ 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_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))


@pass_is_preview
@pass_record_or_draft
@pass_record_files
Expand Down

0 comments on commit b76f27c

Please sign in to comment.