mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
Implement Flask-Breadcrumbs
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from flask import flash, redirect, render_template, url_for
|
||||
from flask_breadcrumbs import register_breadcrumb
|
||||
from flask_login import current_user, login_required, login_user
|
||||
from app.auth.forms import LoginForm
|
||||
from app.models import Corpus, User
|
||||
@ -6,6 +7,7 @@ from . import bp
|
||||
|
||||
|
||||
@bp.route('', methods=['GET', 'POST'])
|
||||
@register_breadcrumb(bp, '.', '<i class="material-icons">home</i>')
|
||||
def index():
|
||||
form = LoginForm(prefix='login-form')
|
||||
if form.validate_on_submit():
|
||||
@ -20,37 +22,44 @@ def index():
|
||||
|
||||
|
||||
@bp.route('/faq')
|
||||
@register_breadcrumb(bp, '.faq', 'Frequently Asked Questions')
|
||||
def faq():
|
||||
return render_template('main/faq.html.j2', title='Frequently Asked Questions')
|
||||
|
||||
|
||||
@bp.route('/dashboard')
|
||||
@register_breadcrumb(bp, '.dashboard', 'Dashboard')
|
||||
@login_required
|
||||
def dashboard():
|
||||
return render_template('main/dashboard.html.j2', title='Dashboard')
|
||||
|
||||
|
||||
@bp.route('/user_manual')
|
||||
@register_breadcrumb(bp, '.user_manual', 'User manual')
|
||||
def user_manual():
|
||||
return render_template('main/user_manual.html.j2', title='User manual')
|
||||
|
||||
|
||||
@bp.route('/news')
|
||||
@register_breadcrumb(bp, '.news', 'News')
|
||||
def news():
|
||||
return render_template('main/news.html.j2', title='News')
|
||||
|
||||
|
||||
@bp.route('/privacy_policy')
|
||||
@register_breadcrumb(bp, '.privacy_policy', 'Private statement (GDPR)')
|
||||
def privacy_policy():
|
||||
return render_template('main/privacy_policy.html.j2', title='Privacy statement (GDPR)')
|
||||
|
||||
|
||||
@bp.route('/terms_of_use')
|
||||
@register_breadcrumb(bp, '.terms_of_use', 'Terms of Use')
|
||||
def terms_of_use():
|
||||
return render_template('main/terms_of_use.html.j2', title='Terms of Use')
|
||||
|
||||
|
||||
@bp.route('/social-area')
|
||||
@register_breadcrumb(bp, '.social_area', 'Social Area')
|
||||
def social_area():
|
||||
users = [
|
||||
u.to_json_serializeable(relationships=True, filter_by_privacy_settings=True,) for u
|
||||
|
Reference in New Issue
Block a user