File: nav.html

package info (click to toggle)
bootstrap-flask 2.4.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 28,784 kB
  • sloc: python: 2,334; makefile: 30
file content (11 lines) | stat: -rw-r--r-- 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
{% extends 'base/nav.html' %}

{% macro render_nav_item(endpoint, text, _badge='', _use_li=False, _badge_classes='badge text-bg-light') %}
    {% set active = True if request.endpoint and request.endpoint == endpoint else False %}
    {% if _use_li %}<li class="nav-item">{% endif %}
    <a class="{% if not _use_li %}nav-item {% endif %}nav-link{% if active %} active" aria-current="page{% endif %}"
       href="{{ url_for(endpoint, **kwargs) }}">
        {{ text }} {% if _badge %}<span class="{{ _badge_classes }}">{{ _badge }}</span>{% endif %}
    </a>
    {% if _use_li %}</li>{% endif %}
{% endmacro %}