diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-06-06 20:07:06 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-06-06 20:07:06 +0200 |
commit | 28ebf918ca25ba170bb8ad0ac3e2c740d34f9301 (patch) | |
tree | 6808590c2f6ba39b1e48a789a9d790e9b0968d5c /hyperkitty/templates | |
parent | c0047ae6ec63a5ed745f733efca51ce332a296da (diff) | |
download | hyperkitty-28ebf918ca25ba170bb8ad0ac3e2c740d34f9301.tar.gz hyperkitty-28ebf918ca25ba170bb8ad0ac3e2c740d34f9301.tar.xz hyperkitty-28ebf918ca25ba170bb8ad0ac3e2c740d34f9301.zip |
Greatly improve the pager
Diffstat (limited to 'hyperkitty/templates')
-rw-r--r-- | hyperkitty/templates/paginator.html | 9 | ||||
-rw-r--r-- | hyperkitty/templates/search_results.html | 30 |
2 files changed, 8 insertions, 31 deletions
diff --git a/hyperkitty/templates/paginator.html b/hyperkitty/templates/paginator.html index 0b4e0d7..efbce86 100644 --- a/hyperkitty/templates/paginator.html +++ b/hyperkitty/templates/paginator.html @@ -10,12 +10,17 @@ <li class="disabled"> <a href="#"> {% endif %} - ← Newer</a> + ← {% if notbydate %}Previous{% else %}Newer{% endif %} + </a> </li> {% for pagenum in pager.page_range %} <li{% if pagenum == pager.number %} class="active"{% endif %}> + {% if pagenum == "..." %} + <a href="#" class="disabled">...</a> + {% else %} <a href="?{% add_to_query_string page_key|default:'page' pagenum %}">{{ pagenum }}</a> + {% endif %} </li> {% endfor %} @@ -26,7 +31,7 @@ <li class="disabled"> <a href="#"> {% endif %} - Older →</a> + {% if notbydate %}Next{% else %}Older{% endif %} →</a> </li> </ul> </div> diff --git a/hyperkitty/templates/search_results.html b/hyperkitty/templates/search_results.html index c9cc754..f91d664 100644 --- a/hyperkitty/templates/search_results.html +++ b/hyperkitty/templates/search_results.html @@ -44,35 +44,7 @@ Search results for "{{ query }}"{% if mlist %} - {{ mlist.display_name|default:m <p>Sorry no email could be found for this query.</p> {% endfor %} - <div class="pagination pagination-centered"> - <ul> - {% if messages.has_previous %} - <li> - <a href="?{% add_to_query_string page=messages.previous_page_number %}"> - {% else %} - <li class="disabled"> - <a href="#"> - {% endif %} - ← Previous</a> - </li> - - {% for pagenum in messages.page_range %} - <li{% if pagenum == messages.number %} class="active"{% endif %}> - <a href="?{% add_to_query_string page=pagenum %}">{{ pagenum }}</a> - </li> - {% endfor %} - - {% if messages.has_next %} - <li> - <a href="?{% add_to_query_string page=messages.next_page_number %}"> - {% else %} - <li class="disabled"> - <a href="#"> - {% endif %} - Next →</a> - </li> - </ul> - </div> + {% include "paginator.html" with pager=messages notbydate=True %} </div> |