diff options
author | Dan McGee <dan@archlinux.org> | 2012-03-08 06:44:52 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-03-08 18:42:51 +0100 |
commit | c919e337bf6afff22172a4a1f03581bc389431cd (patch) | |
tree | 6eb92ae0cc1e6fb6412ac606767ff1fa534271ac /templates/packages | |
parent | 1cc2b42fa117ac7469e8b2036bce11a349ac635e (diff) | |
download | archweb-c919e337bf6afff22172a4a1f03581bc389431cd.tar.gz archweb-c919e337bf6afff22172a4a1f03581bc389431cd.tar.xz |
Break out search paginator into template
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/packages')
-rw-r--r-- | templates/packages/search.html | 50 | ||||
-rw-r--r-- | templates/packages/search_paginator.html | 27 |
2 files changed, 29 insertions, 48 deletions
diff --git a/templates/packages/search.html b/templates/packages/search.html index 0c67b86..ae67b18 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -52,31 +52,7 @@ {% if package_list %} <div id="pkglist-results" class="box"> - - {% if paginator %} - <div id="pkglist-stats-top"> - - <p>{{paginator.count}} packages found. - Page {{page_obj.number}} of {{paginator.num_pages}}.</p> - - <p class="pkglist-nav"> - {% if page_obj.has_previous %} - <a class="prev" href="/packages/{{page_obj.previous_page_number}}/?{{current_query}}" - title="Go to previous page">< Prev</a> - {% else %} - <span class="prev">< Prev</span> - {% endif %} - {% if page_obj.has_next %} - <a class="next" href="/packages/{{page_obj.next_page_number}}/?{{current_query}}" - title="Go to next page">Next ></a> - {% else %} - <span class="next">Next ></span> - {% endif %} - </p> - - </div> - {% endif %} - + {% include "packages/search_paginator.html" %} <form id="pkglist-results-form" method="post" action="/packages/update/">{% csrf_token %} <table class="results"> @@ -120,29 +96,7 @@ {% endfor %} </tbody> </table> - - {% if paginator %} - <div id="pkglist-stats-bottom"> - - <p>{{paginator.count}} packages found. Page {{page_obj.number}} of {{paginator.num_pages}}.</p> - - <p class="pkglist-nav"> - {% if page_obj.has_previous %} - <a class="prev" href="/packages/{{page_obj.previous_page_number}}/?{{current_query}}" - title="Go to previous page">< Prev</a> - {% else %} - <span class="prev">< Prev</span> - {% endif %} - {% if page_obj.has_next %} - <a class="next" href="/packages/{{page_obj.next_page_number}}/?{{current_query}}" - title="Go to next page">Next ></a> - {% else %} - <span class="next">Next ></span> - {% endif %} - </p> - - </div> - {% endif %} + {% include "packages/search_paginator.html" %} {% if perms.main.change_package %} <p><input title="Adopt selected packages" type="submit" id="adopt-btn" diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html new file mode 100644 index 0000000..362b7cb --- /dev/null +++ b/templates/packages/search_paginator.html @@ -0,0 +1,27 @@ +<div class="pkglist-stats"> + {% if is_paginated %} + <p>{{paginator.count}} packages found. + Page {{page_obj.number}} of {{paginator.num_pages}}.</p> + + <div class="pkglist-nav"> + <span class="prev"> + {% if page_obj.has_previous %} + <a href="/packages/{{page_obj.previous_page_number}}/?{{current_query}}" + title="Go to previous page">< Prev</a> + {% else %} + < Prev + {% endif %} + </span> + <span class="next"> + {% if page_obj.has_next %} + <a href="/packages/{{page_obj.next_page_number}}/?{{current_query}}" + title="Go to next page">Next ></a> + {% else %} + Next > + {% endif %} + </span> + </div> + {% else %} + <p>{{ package_list.count }} packages found.</p> + {% endif %} +</div> |