rDrama/files/templates/component/sorting_time.html
justcool393 6c2876ea6b no t
2023-02-17 01:00:38 -06:00

14 lines
831 B
HTML

{%- macro sort_dropdown(sort, t, all_sorts, extra_query='') -%}
<div class="dropdown dropdown-actions">
<button class="btn btn-secondary dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas {{all_sorts[sort]}} mr-1"></i> {{sort|capitalize}}
</button>
<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translateY(31px);">
{% for possible_sort in all_sorts %}
{%- if sort != possible_sort -%}
<a class="dropdown-item" href="?{{extra_query ~ '&' if extra_query else ''}}sort={{possible_sort}}{% if t %}&t={{t}}{% endif %}"><i class="fas {{all_sorts[possible_sort]}} mr-1"></i> {{possible_sort | capitalize}}</a>
{%- endif -%}
{% endfor %}
</div>
</div>
{%- endmacro -%}