From 08adf4571d0ecb58129d23cf81692a27c3b1e838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Solard?= Date: Tue, 12 Aug 2014 16:23:12 +0200 Subject: [PATCH] Modify the "change page buttons" in order to operate the links "next" and "previous" --- .../webmail/static/webmail/js/webmail.js | 1 + .../webmail/templates/webmail/index.html | 9 ------ modoboa/static/js/listing.js | 4 +++ modoboa/templates/common/pagination_bar.html | 29 ++++++++++++++----- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js index 76b3751d3..5e3bcd783 100644 --- a/modoboa/extensions/webmail/static/webmail/js/webmail.js +++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js @@ -308,6 +308,7 @@ Webmail.prototype = { } if (response.navbar) { $("#bottom-bar-right").html(response.navbar); + $("#pagination-responsive").html(response.navbar); } $("#listing").html(response.listing); $("#listing").css({ diff --git a/modoboa/extensions/webmail/templates/webmail/index.html b/modoboa/extensions/webmail/templates/webmail/index.html index 3d72111b4..cebac040d 100644 --- a/modoboa/extensions/webmail/templates/webmail/index.html +++ b/modoboa/extensions/webmail/templates/webmail/index.html @@ -30,15 +30,6 @@ $(document).ready(function() { {% endblock %} -{% block pagination_responsive %} -
- - - - -
-{% endblock %} - {% block fixed_content %}
diff --git a/modoboa/static/js/listing.js b/modoboa/static/js/listing.js index 8edc63e04..5e5443bce 100644 --- a/modoboa/static/js/listing.js +++ b/modoboa/static/js/listing.js @@ -6,6 +6,7 @@ Listing.prototype = { constructor: Listing, listing_defaults: { + presp_container: '#pagination-responsive', pbar_container: '#bottom-bar-right', pbar_id: '#pagination_bar', sortable_selector: '.sortable' @@ -15,6 +16,8 @@ Listing.prototype = { this.options = $.extend({}, this.listing_defaults, options); $(document).on("click", this.options.pbar_container + " a", $.proxy(this.load_page, this)); + $(document).on("click", this.options.presp_container + " a", + $.proxy(this.load_page, this)); }, load_page: function(e) { @@ -26,6 +29,7 @@ Listing.prototype = { update_listing: function(data) { if (data.paginbar) { $(this.options.pbar_container).html(data.paginbar); + $(this.options.presp_container).html(data.paginbar); $(this.options.pbar_id).find(".disabled a").click(function(e) { e.preventDefault(); }); diff --git a/modoboa/templates/common/pagination_bar.html b/modoboa/templates/common/pagination_bar.html index 3c6e18310..1ae30be3b 100644 --- a/modoboa/templates/common/pagination_bar.html +++ b/modoboa/templates/common/pagination_bar.html @@ -1,27 +1,40 @@
    -
  • +
  • {% if page.has_previous %} {% else %} {% endif %}
  • -
  • +
  • {% if page.has_previous %} - {% else %} - {% endif %} + {% else %} + {% endif %}
  • {% if page.has_next %} - {% else %} - {% endif %} + {% else %} + {% endif %}
  • {% if page.has_next %} - {% else %} - {% endif %} + {% else %} + {% endif %}
+ +
+ {% if page.has_previous %} + + {% else %} + + {% endif %} + {% if page.has_next %} + + {% else %} + + {% endif %} +
\ No newline at end of file