From aa170a9b65c2049474950246a7d24926ca25cd57 Mon Sep 17 00:00:00 2001 From: bashmak Date: Fri, 18 Aug 2017 14:21:31 +0300 Subject: [PATCH] =?UTF-8?q?FIXBUG:=20=D0=BA=D1=80=D0=B8=D0=B2=D0=BE=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BB=20=D0=BF=D0=B0=D0=B3?= =?UTF-8?q?=D0=B8=D0=BD=D0=B0=D1=82=D0=BE=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templatetags/__init__.py | 0 abonapp/templatetags/dpagination.py | 10 ++++ templates/toolbar_page.html | 51 +++++++++---------- 3 files changed, 33 insertions(+), 28 deletions(-) rename djing/utils/save_from_nodeny.py => abonapp/templatetags/__init__.py (100%) mode change 100755 => 100644 create mode 100644 abonapp/templatetags/dpagination.py diff --git a/djing/utils/save_from_nodeny.py b/abonapp/templatetags/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from djing/utils/save_from_nodeny.py rename to abonapp/templatetags/__init__.py diff --git a/abonapp/templatetags/dpagination.py b/abonapp/templatetags/dpagination.py new file mode 100644 index 0000000..582009b --- /dev/null +++ b/abonapp/templatetags/dpagination.py @@ -0,0 +1,10 @@ +from django import template + +register = template.Library() + + +@register.simple_tag +def url_page_replace(request, field, value): + dict_ = request.GET.copy() + dict_[field] = value + return dict_.urlencode() diff --git a/templates/toolbar_page.html b/templates/toolbar_page.html index 5d1e9a1..7e98819 100644 --- a/templates/toolbar_page.html +++ b/templates/toolbar_page.html @@ -1,29 +1,24 @@ -{% with request.GET.urlencode|yesno:'&,' as start_divide %} -{% with request.GET.urlencode as url %} -{% if pag.paginator.num_pages > 1 %} -
-
- -
+{% load dpagination %} +
+
+
-{% endif %} -{% endwith %} -{% endwith %} \ No newline at end of file +