CostHive/app/utils/routes_utils.py
Lunaresk b705f82ecb major: refactor, renaming, huge changes
Everything kinda changed. Huge refactoring.
Website now has sidebar instead of top navigation.
Database got huge changes.
More forms!
2022-02-20 02:04:16 +01:00

18 lines
577 B
Python

from datetime import date
from flask import render_template
from flask_login import current_user
def get_base_infos():
infos = {}
infos['now'] = date.today()
infos['current_user'] = current_user
if current_user.is_authenticated:
tokens = current_user.LoginToken.all()
establishments = [logintoken.Establishment for logintoken in tokens]
if establishments:
infos['establishments'] = establishments
return infos
def render_custom_template(*args, **kwargs):
return render_template(*args, **kwargs, **get_base_infos())