{% extends "partials/layout.html" %} {% block pageContent %} {% if errors %} {% include "partials/packages/search.html" %} {% elif not packages_count %} {% include "partials/packages/search.html" %}

{{ "No packages matched your search criteria." | tr }}

{% if success %} {% endif %} {% else %} {% set pages = (packages_count / PP) | ceil %} {% set page = O / PP %} {% if success %} {% endif %} {# Search form #} {% include "partials/packages/search.html" %}
{# /packages does things a bit roundabout-wise: If SeB is not given, "nd" is the default. If SB is not given, "p" is the default. If SO is not given, "d" is the default. However, we depend on flipping SO for column sorting. This section sets those defaults for the context if they are not already setup. #} {% if not SeB %} {% set SeB = "nd" %} {% endif %} {% if not SB %} {% set SB = "p" %} {% endif %} {% if not SO %} {% set SO = "d" %} {% endif %} {# Pagination widget #} {% with total = packages_count, singular = "%d package found.", plural = "%d packages found.", prefix = "/packages" %} {% include "partials/pager.html" %} {% endwith %} {# Package action form: persists query parameters. #}
{# Search results #} {% with voted = packages_voted, notified = packages_notified %} {% include "partials/packages/search_results.html" %} {% endwith %} {# Pagination widget #} {% with total = packages_count, singular = "%d package found.", plural = "%d packages found.", prefix = "/packages" %} {% include "partials/pager.html" %} {% endwith %} {% if request.user.is_authenticated() %} {# Package actions #} {% include "partials/packages/search_actions.html" %} {% endif %}
{% endif %} {% endblock %}