From 77e15302398ba26dc209521e257adbc1bed3e710 Mon Sep 17 00:00:00 2001 From: Chaoyi Zha Date: Jun 18 2014 13:05:22 +0000 Subject: pagination UI fixes --- diff --git a/pkgdb2/templates/list_packagers.html b/pkgdb2/templates/list_packagers.html index 61a5e0b..c4db39a 100644 --- a/pkgdb2/templates/list_packagers.html +++ b/pkgdb2/templates/list_packagers.html @@ -12,7 +12,7 @@ +
- {% if page > 1%} + {% if page > 1 %} < Previous @@ -30,17 +30,26 @@ Next > {% endif %}
{% endif %} {% endblock %} diff --git a/pkgdb2/templates/list_packages.html b/pkgdb2/templates/list_packages.html index 086fa6c..306b76b 100644 --- a/pkgdb2/templates/list_packages.html +++ b/pkgdb2/templates/list_packages.html @@ -52,7 +52,7 @@ or orphaned packages

- {% if page > 1%} + {% if page > 1 %} < Previous @@ -77,25 +77,33 @@ or orphaned packages

{% endif %}
    -{% for pkg in packages %} -
  • - - {{ pkg.name }} - -- {{ pkg.summary }} - ( - {% for listing in pkg.listings | sort(attribute="collection.branchname", reverse=True) - %} {% if listing.collection.status != 'EOL' %} - {% if origin == 'list_packages' and listing.status == 'Approved' %} - {{ listing.collection.branchname }} - {% elif origin == 'list_retired' and listing.status == 'Retired' %} - {{ listing.collection.branchname }} - {% elif origin == 'list_orphaned' and listing.status == 'Orphaned' %} - {{ listing.collection.branchname }} - {% endif %} - {% endif %}{% endfor %} - ) +{% if total_page >= page and page > 0 %} + {% for pkg in packages %} +
  • + + {{ pkg.name }} + -- {{ pkg.summary }} + ( + {% for listing in pkg.listings | sort(attribute="collection.branchname", reverse=True) + %} {% if listing.collection.status != 'EOL' %} + {% if origin == 'list_packages' and listing.status == 'Approved' %} + {{ listing.collection.branchname }} + {% elif origin == 'list_retired' and listing.status == 'Retired' %} + {{ listing.collection.branchname }} + {% elif origin == 'list_orphaned' and listing.status == 'Orphaned' %} + {{ listing.collection.branchname }} + {% endif %} + {% endif %}{% endfor %} + ) +
  • + {% endfor %} +{% else %} +
  • Sorry, but the page you are requesting is unavailable.
    + + Back to the list +
  • -{% endfor %} +{% endif %}
{% endblock %}