2022-08-06 21:49:52 +02:00
|
|
|
<nav class="navbar is-dark mb-4" role="navigation" aria-label="main navigation">
|
|
|
|
<div class="navbar-brand">
|
|
|
|
<a class="navbar-item" href="/admin/">
|
|
|
|
Actix Admin
|
|
|
|
</a>
|
|
|
|
|
2023-01-13 21:11:42 +01:00
|
|
|
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbar">
|
2022-08-06 21:49:52 +02:00
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2023-01-13 21:11:42 +01:00
|
|
|
<div id="navbar" class="navbar-menu">
|
2022-08-06 21:49:52 +02:00
|
|
|
<div class="navbar-start">
|
2022-09-12 21:22:25 +02:00
|
|
|
{% for category, entities in entity_names %}
|
|
|
|
{% if category == "" %}
|
2022-09-29 16:23:49 +02:00
|
|
|
{% for menu_element in entities %}
|
|
|
|
{% if menu_element.is_custom_handler %}
|
2022-10-07 21:32:59 +02:00
|
|
|
<a href="/admin/{{ menu_element.link }}" hx-boost="true" hx-indicator="#loading" class="navbar-item {% if entity_name and entity_name == menu_element.name %}is-active{% endif %}">{{ menu_element.name }}</a>
|
2022-09-29 16:23:49 +02:00
|
|
|
{% else %}
|
2022-10-07 21:32:59 +02:00
|
|
|
<a href="/admin/{{ menu_element.link }}/list" hx-boost="true" hx-indicator="#loading" class="navbar-item {% if entity_name and entity_name == menu_element.name %}is-active{% endif %}">{{ menu_element.name | title }}</a>
|
2022-09-29 16:23:49 +02:00
|
|
|
{% endif %}
|
2022-09-12 21:22:25 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{% else %}
|
|
|
|
<div class="navbar-item has-dropdown is-hoverable">
|
2022-09-13 15:45:20 +02:00
|
|
|
<a class="navbar-link {% if entity_name and entity_name in entities %}is-active{% endif %}">
|
2022-09-12 21:22:25 +02:00
|
|
|
{{ category }}
|
|
|
|
</a>
|
|
|
|
<div class="navbar-dropdown">
|
2022-09-29 16:23:49 +02:00
|
|
|
{% for menu_element in entities %}
|
|
|
|
{% if menu_element.is_custom_handler %}
|
2022-10-07 21:32:59 +02:00
|
|
|
<a href="/admin/{{ menu_element.link }}" hx-boost="true" hx-indicator="#loading" class="navbar-item {% if entity_name and entity_name == menu_element.name %}is-active{% endif %}">{{ menu_element.name }}</a>
|
2022-09-29 16:23:49 +02:00
|
|
|
{% else %}
|
2022-10-07 21:32:59 +02:00
|
|
|
<a href="/admin/{{ menu_element.link }}/list" hx-boost="true" hx-indicator="#loading" class="navbar-item {% if entity_name and entity_name == menu_element.name %}is-active{% endif %}">{{ menu_element.name | title }}</a>
|
2022-09-29 16:23:49 +02:00
|
|
|
{% endif %}
|
2022-09-12 21:22:25 +02:00
|
|
|
{%- endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2022-08-06 21:49:52 +02:00
|
|
|
{%- endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="navbar-end">
|
|
|
|
<div class="navbar-item">
|
|
|
|
<div class="buttons">
|
|
|
|
{% if enable_auth %}
|
|
|
|
{% if user_is_logged_in %}
|
2022-10-07 21:32:59 +02:00
|
|
|
<a href="{{ logout_link }}" hx-boost="true" hx-indicator="#loading" class="button is-light">
|
2022-08-06 21:49:52 +02:00
|
|
|
Log out
|
2022-08-04 09:21:40 +02:00
|
|
|
</a>
|
2022-08-06 21:49:52 +02:00
|
|
|
{% else %}
|
2022-10-07 21:32:59 +02:00
|
|
|
<a href="{{ login_link }}" hx-boost="true" hx-indicator="#loading" class="button is-light">
|
2022-08-06 21:49:52 +02:00
|
|
|
Log in
|
2022-08-04 09:21:40 +02:00
|
|
|
</a>
|
2022-08-06 21:49:52 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2022-08-04 09:21:40 +02:00
|
|
|
</div>
|
2022-08-06 21:49:52 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|