{% macro listPackages(packages, paginate) %}
    <ul class="packages">
        {% for package in packages %}
            <li>
                <h1><a href="{{ path('view_package', { 'name' : package.name }) }}">{{ package.name }}</a></h1>
                {% if package.description %}
                    <p class="package-description">{{ package.description }}</p>
                {% endif %}
            </li>
        {% endfor %}

        {% if paginate is defined and paginate and packages.nbPages > 1 %}
            {{ pagerfanta(packages, 'default', {'proximity': 2}) }}
        {% endif %}
    </ul>
{% endmacro %}
