Adding flash functionality, had to make my own decorator

This commit is contained in:
2025-04-17 15:15:05 +02:00
parent 669d73b18a
commit 587fb649a6
4 changed files with 38 additions and 10 deletions

View File

@@ -38,20 +38,37 @@
</ul>
{% if current_user.is_authenticated %}
<div class="dropstart">
<button class="btn btn-outline-info" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-outline-info" type="button" id="dropdownMenuButton1"
data-bs-toggle="dropdown" aria-expanded="false">
Profile
</button>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-lg-start" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-lg-start"
aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item">Username: {{current_user.username}}</a></li>
<li><a class="dropdown-item {% if active_page == 'update' %}active{% endif %}" href="{{url_for('auth.update')}}">Change password</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" style="color: tomato;" data-bs-theme="dark" href="{{url_for('auth.logout')}}">Logout</a></li>
<li><a class="dropdown-item {% if active_page == 'update' %}active{% endif %}"
href="{{url_for('auth.update')}}">Change password</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" style="color: tomato;" data-bs-theme="dark"
href="{{url_for('auth.logout')}}">Logout</a></li>
</ul>
</div>
{% endif %}
</div>
</div>
</nav>
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1050;">
{% for message in get_flashed_messages() %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
{{message}}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
</div>
{% block content %}
{% endblock %}
</body>