Features: - Added page for an overview of establishments with a possibility to request a membership. - Added page for admins of an establishment to accept or deny those candidates. This is currently only usable via URL, the navigation to this site is not yet implemented in the HTML files. - Added page to add new establishments by providing a name. Improvements: - Better folder structure. - The establishment-specific overview can now be viewed with another URL, as well as some other pages. Bugfixes: - Seriously I don't know anymore what I fixed and what not. But it works just better now :) Future: - Angular has been added to separate the Flask-Backend with the frontend. Angular is currently not connected to the backend, but this will change in the future.
18 lines
590 B
Python
18 lines
590 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['current_user_establishments'] = establishments
|
|
return infos
|
|
|
|
def render_custom_template(*args, **kwargs):
|
|
return render_template(*args, **kwargs, **get_base_infos()) |