inventory/templates/fragments/_link_fragment.html

40 lines
1.2 KiB
HTML

{% import "fragments/_icon_fragment.html" as icons %}
{% macro category_link(endpoint, label, icon_html=none, arguments={}) %}
<!-- Category Link Fragment -->
<div class="col text-center">
<a href="{{ url_for('main.' + endpoint, **arguments) }}"
class="d-flex flex-column justify-content-center link-success link-underline-opacity-0">
{% if icon_html %}
{{ icon_html | safe }}
{% endif %}
{{ label }}
</a>
</div>
{% endmacro %}
{% macro navigation_link(endpoint, label, icon_html=none, arguments={}, active=false) %}
<!-- Navigation Link Fragment -->
{% if not active %}
{% set active = request.endpoint == 'main.' + endpoint %}
{% endif %}
<li class="nav-item">
<a href="{{ url_for('main.' + endpoint, **arguments) }}" class="nav-link{% if active %} active{% endif %}">
{% if icon_html %}
{{ icon_html | safe }}
{% endif %}
{{ label }}
</a>
</li>
{% endmacro %}
{% macro entry_link(endpoint, id) %}
<!-- Entry Link Fragment -->
<a href="{{ url_for('main.' + endpoint, id=id) }}" class="link-success link-underline-opacity-0">
{{ icons.render_icon('link', 12) }}
</a>
{% endmacro %}