diff options
author | Marius Peter <marius.peter@tutanota.com> | 2022-05-15 13:16:37 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2022-05-15 13:16:37 +0200 |
commit | 1dad22d3e45d6506c8624e3a7111240fcc4ab786 (patch) | |
tree | 35d2c1e84215c6e6a52979bbff0cbc2e8cf77ace /app/templates/base.html | |
parent | 3aee6067123cd8afd985f68847e6bb476a853bb0 (diff) |
Templates.
Diffstat (limited to 'app/templates/base.html')
-rw-r--r-- | app/templates/base.html | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/app/templates/base.html b/app/templates/base.html index b5f507d..e847149 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -13,26 +13,51 @@ <link rel="stylesheet" href="{{ url_for('static', filename='styles/style.css') }}"> </head> <body> - <nav> - <a href="/" class="button">Home</a> - <h1>{% block title %}{% endblock %}</h1> + <nav id="user"> + <div style="display: flex; align-items: baseline;"> + <ul> + <li><a href="{{ url_for('main.home') }}" class="button">Home</a></li> + </ul> + <h1>{% block title %}{% endblock %}</h1> + </div> + <ul> + {% if current_user.is_authenticated %} + <li><a href="{{ url_for('common.settings') }}" class="button">Settings</a></li> + <li><a href="{{ url_for('auth.logout') }}" class="button">Logout</a></li> + {% else %} + <li><a href="{{ url_for('auth.login') }}" class="button">Login</a></li> + <li><a href="{{ url_for('auth.register') }}" class="button">Register</a></li> + {% endif %} + </ul> + </nav> + {% if current_user.is_authenticated %} + <nav id="modules"> <ul> {% for module in modules %} <li><a href="/modules/{{ module.name }}" class="button">{{ module.name }}</a></li> {% endfor %} + + </ul> + </nav> + <nav id="actions"> + <ul> + {% block actions %}{% endblock %} </ul> </nav> + {% endif %} <div id="content"> {% block content %}{% endblock %} </div> {# Flashed messages added last, so that they appear on top of the content. #} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} - <ul class="flashes"> - {% for category, message in messages %} - <li class="alert alert-{{ category }}">{{ message }}</li> - {% endfor %} - </ul> + <div id="flash"> + <ul> + {% for category, message in messages %} + <li class="alert alert-{{ category }}">{{ message }}</li> + {% endfor %} + </ul> + </div> {% endif %} {% endwith %} <!-- <script src="js/scripts.js"></script> --> |