{% load i18n %}
<ul class="dropdown-menu dropdown-menu-end" id="favoritelist">
    {% if preferences.favorites %}
        {% for fav in preferences.favorites|sort_dictionary_by_key %}
        <li><a class="dropdown-item" onclick="event.stopPropagation(); favorite.open(event)">{{fav}}<div style="float:right"><span class="fa fa-trash-o" onclick="favorite.remove(event)"></span></div></a></li>
        {% endfor %}
    {% endif %}
    <li>
        <a class="dropdown-item d-flex" >
        <button id="favoritesave" onclick="favorite.save()" type="button" disabled class="flex-fill btn btn-primary btn-sm me-1">{% trans "save"|capfirst %}</button>
        <input class="form-control form-control-sm" id="favoritename" oninput="favorite.check()" type="text" size="15">
        </a>
    </li>
</ul>
<button class="{% if search %}input-group-text{% else %}btn btn-sm btn-primary{% endif %}" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <div data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" data-bs-title="{% trans 'Bookmark your favorite report configurations'|capfirst|force_escape %}" data-bs-offset="0,12">
        <i class="fa fa-star"></i>
    </div>
</button>