
{% block submenu_dashboard %}
    <div class="container" id="dashboard-nav">
    
    <h1>{{ rstate|capitalize }} {{ table_title }}</h1>
    <div class="row">  
        <div class="col-6">
            <ul class="nav nav-pills">
            {% for key, item in dashboard.items() %}
                <li class="nav-item">
                    <a class="nav-link {{ css_classes[key] }}" href="{{ url_for('dashboard.index', rtype=key, rstate=rstate) }}" >
                    {{ item.name }} 
                    {% if count_match %}
                        ({{ count_match[key] }})
                    {% endif %}
                    </a>
                </li>
            {% endfor %}    
            </ul>
        </div>
        <div class="col-6">
            <ul class="nav nav-pills justify-content-end">
                <li class="nav-item"> 
                    <form id="dashboard-search" class="navbar-form mx-3" role="search" action="{{ url_for('dashboard.index', rtype=rtype, rstate=rstate) }}">
                     <div class="input-group">
                        <input 
                            class="form-control"
                            type="search" 
                            name="squery"
                            {% if search_query %}
                                value="{{search_query}}"
                            {% else %}
                                placeholder="Search..."
                            {% endif %}    
                        >
                        <button class="btn btn-outline-secondary" type="submit">
                            <i class="bi bi-search"></i>
                        </button>
                    
                    </div>
                    <input
                            type="hidden"
                            name="sort"
                            value={{ sort_key }}
                        />
                        <input
                            type="hidden"
                            name="order"
                            value={{ sort_order }}
                        />
                </form>
                </li>
                <li class="nav-item">
                    <a class="nav-link {{ css_classes['active'] }}" href="{{ url_for('dashboard.index', rtype=rtype, rstate='active') }}" >Active</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {{ css_classes['expired'] }}" href="{{ url_for('dashboard.index', rtype=rtype, rstate='expired') }}" >Expired</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {{ css_classes['all'] }}" href="{{ url_for('dashboard.index', rtype=rtype, rstate='all') }}" >All</a>
                </li>
            </ul>
        </div>
    </div>
    <hr />

{% endblock %}