diff --git a/src/postorius/static/postorius/css/style.css b/src/postorius/static/postorius/css/style.css index 29acf1b..c4bb03b 100755 --- a/src/postorius/static/postorius/css/style.css +++ b/src/postorius/static/postorius/css/style.css @@ -307,3 +307,19 @@ .well .archival-options-form li { display: block; } + + +/* Pagination */ +.pager .pager-content { + margin: 0 1em; +} +.pager .pager-content span { + border: none; + cursor: pointer; +} +.pager .pager-content form { + display: none; +} +.pager .pager-content form select { + width: 4em; +} diff --git a/src/postorius/static/postorius/js/script.js b/src/postorius/static/postorius/js/script.js index e69de29..604c7ac 100755 --- a/src/postorius/static/postorius/js/script.js +++ b/src/postorius/static/postorius/js/script.js @@ -0,0 +1,35 @@ +/* + * Postorius + * + * Copyright (C) 1998-2015 by the Free Software Foundation, Inc. + * + * This file is part of Postorius. + * + * Postorius is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Postorius is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * Postorius. If not, see . + * + */ + + +$(function() { + + /* Pagination */ + $(".pager .pager-content span").click(function() { + $(this).hide(); + $(this).next().css("display", "inline-block"); + }); + $(".pager .pager-content form select").change(function() { + $(this).closest("form").submit(); + }); + +}); diff --git a/src/postorius/templates/postorius/_pagination.html b/src/postorius/templates/postorius/_pagination.html new file mode 100644 index 0000000..4b6192a --- /dev/null +++ b/src/postorius/templates/postorius/_pagination.html @@ -0,0 +1,57 @@ +{% load url from future %} +{% load i18n %} + +{% if page.paginator.num_pages > 1 %} + {% if page.paginator.num_pages > 10 %} + + {% else %} + + {% endif %} +{% endif %} diff --git a/src/postorius/templates/postorius/base.html b/src/postorius/templates/postorius/base.html index 80acfcc..c546c0b 100644 --- a/src/postorius/templates/postorius/base.html +++ b/src/postorius/templates/postorius/base.html @@ -65,5 +65,6 @@ + {% block additionaljs %}{% endblock %} diff --git a/src/postorius/templates/postorius/lists/index.html b/src/postorius/templates/postorius/lists/index.html index fe8ab78..a4224e5 100644 --- a/src/postorius/templates/postorius/lists/index.html +++ b/src/postorius/templates/postorius/lists/index.html @@ -51,27 +51,7 @@ * {% trans 'Only admins see unadvertised lists in the list index.' %} {% endif %} - + {% include 'postorius/_pagination.html' with page=lists %} {% else %}