adding instances

This commit is contained in:
2025-06-09 09:54:37 +02:00
parent 7aa96119a9
commit 112a99ffcb
9 changed files with 523 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
{% macro header(title, description="", button_text="", button_url="", icon="fa-folder", button_class="", button_icon="fa-plus", button_style="") %}
{% macro header(title, description="", button_text="", button_url="", icon="fa-folder", button_class="", button_icon="fa-plus", button_style="", buttons=None) %}
<header class="py-4">
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center">
@@ -11,8 +11,31 @@
<p class="text-muted mb-0 mt-2 small">{{ description }}</p>
{% endif %}
</div>
{% if button_text and button_url %}
<div>
<div class="d-flex gap-2">
{% if buttons %}
{% for button in buttons %}
{% if button.url == "#" %}
<button id="{{ button.id if button.id else '' }}"
class="btn {{ button.class if button.class else '' }}"
style="{{ 'background-color: var(--primary-color); color: white;' if not button.class else '' }}{{ '; ' + button.style if button.style else '' }}"
onclick="{{ button.onclick if button.onclick else '' }}">
{% if button.icon %}
<i class="fas {{ button.icon }} me-1"></i>
{% endif %}
{{ button.text }}
</button>
{% else %}
<button onclick="window.location.href='{{ button.url }}'"
class="btn {{ button.class if button.class else '' }}"
style="{{ 'background-color: var(--primary-color); color: white;' if not button.class else '' }}{{ '; ' + button.style if button.style else '' }}">
{% if button.icon %}
<i class="fas {{ button.icon }} me-1"></i>
{% endif %}
{{ button.text }}
</button>
{% endif %}
{% endfor %}
{% elif button_text and button_url %}
{% if button_url == "#" %}
<button id="emptyTrashBtn"
class="btn {{ button_class if button_class else '' }}"
@@ -33,8 +56,8 @@
{{ button_text }}
</button>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
</header>