Major Refactor: Refactor the codebase to improve readability and maintainability
This commit is contained in:
22
templates/macros/ui.html
Normal file
22
templates/macros/ui.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% macro flashed_messages() %}
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }}">{{ message|safe }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro back_link(url, text='Volver', icon='bi-arrow-left') %}
|
||||
<a href="{{ url }}" class="btn btn-outline-secondary btn-sm mb-2">
|
||||
<i class="bi {{ icon }}"></i> {{ text }}
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro page_header(title, icon='', actions='') %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>{% if icon %}<i class="bi {{ icon }} me-2"></i>{% endif %}{{ title }}</h2>
|
||||
{% if actions %}{{ actions|safe }}{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user