Add sorting links to profile page

This commit is contained in:
rubenwardy 2023-08-13 13:29:32 +01:00
parent 32a305c9d8
commit f1b2465e82

@ -199,19 +199,37 @@
</div> </div>
{% endif %} {% endif %}
{% if current_user == user or user.check_perm(current_user, "CHANGE_AUTHOR") %} <div class="float-right">
<a class="float-right btn btn-sm btn-primary" {% if packages %}
href="{{ url_for('packages.create_edit', author=user.username) }}"> <div class="btn-group btn-group-sm mr-2" role="group" aria-label="Sorting">
<i class="fas fa-plus mr-1"></i> <span class="btn btn-sm btn-primary">
{{ _("Create package") }} {{ _("Alphabetical") }}
</a> </span>
{% endif %} <a href="{{ url_for('packages.list_all', author=user.username, sort='downloads', order='desc') }}"
{% if current_user == user or (current_user.is_authenticated and current_user.rank.at_least(current_user.rank.EDITOR)) %} class="btn btn-sm btn-secondary">
<a class="float-right btn btn-sm btn-secondary mr-2" {{ _("Downloads") }}
href="{{ url_for('todo.tags', author=user.username) }}"> </a>
{{ _("View list of tags") }} <a href="{{ url_for('packages.list_all', author=user.username, sort='approved_at', order='desc') }}"
</a> class="btn btn-sm btn-secondary">
{% endif %} {{ _("Newest") }}
</a>
</div>
{% if current_user == user or (current_user.is_authenticated and current_user.rank.at_least(current_user.rank.EDITOR)) %}
<a class="btn btn-sm btn-secondary mr-2"
href="{{ url_for('todo.tags', author=user.username) }}">
{{ _("View list of tags") }}
</a>
{% endif %}
{% endif %}
{% if current_user == user or user.check_perm(current_user, "CHANGE_AUTHOR") %}
<a class="btn btn-sm btn-primary"
href="{{ url_for('packages.create_edit', author=user.username) }}">
<i class="fas fa-plus mr-1"></i>
{{ _("Create package") }}
</a>
{% endif %}
</div>
<h2 class="my-3">{{ _("Packages") }}</h2> <h2 class="my-3">{{ _("Packages") }}</h2>
{% from "macros/packagegridtile.html" import render_pkggrid %} {% from "macros/packagegridtile.html" import render_pkggrid %}