fnp
/
fnpdjango.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
37f4488
)
Make prevnext respect get pars
0.1.5
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 22 Feb 2013 12:31:14 +0000
(13:31 +0100)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 22 Feb 2013 12:31:14 +0000
(13:31 +0100)
CHANGES.txt
patch
|
blob
|
history
fnpdjango/templates/fnpdjango/prevnext/next.html
patch
|
blob
|
history
fnpdjango/templates/fnpdjango/prevnext/previous.html
patch
|
blob
|
history
fnpdjango/templates/fnpdjango/prevnext/prevnext.html
patch
|
blob
|
history
fnpdjango/templatetags/fnp_prevnext.py
patch
|
blob
|
history
setup.py
patch
|
blob
|
history
diff --git
a/CHANGES.txt
b/CHANGES.txt
index
71a81a1
..
f32039e
100644
(file)
--- a/
CHANGES.txt
+++ b/
CHANGES.txt
@@
-1,3
+1,5
@@
+v0.1.5 2013-02-22
+ - Make prevnext respect current GET parameters.
- Add a management command for localizing contrib apps.
- Fix deployment sudo problem.
- Add a management command for localizing contrib apps.
- Fix deployment sudo problem.
diff --git
a/fnpdjango/templates/fnpdjango/prevnext/next.html
b/fnpdjango/templates/fnpdjango/prevnext/next.html
index
928011f
..
afcc88d
100644
(file)
--- a/
fnpdjango/templates/fnpdjango/prevnext/next.html
+++ b/
fnpdjango/templates/fnpdjango/prevnext/next.html
@@
-2,7
+2,7
@@
{% load i18n %}
<a class="next_page"
{% if number %}
{% load i18n %}
<a class="next_page"
{% if number %}
- href="?
page={{ number
}}"
+ href="?
{{ get_dict
}}"
{% else %}
href="{{ url }}"
{% endif %}
{% else %}
href="{{ url }}"
{% endif %}
@@
-13,4
+13,4
@@
{% trans "next" %}
{% endif %}
</a>
{% trans "next" %}
{% endif %}
</a>
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git
a/fnpdjango/templates/fnpdjango/prevnext/previous.html
b/fnpdjango/templates/fnpdjango/prevnext/previous.html
index
88a656b
..
3b0f059
100644
(file)
--- a/
fnpdjango/templates/fnpdjango/prevnext/previous.html
+++ b/
fnpdjango/templates/fnpdjango/prevnext/previous.html
@@
-2,7
+2,7
@@
{% load i18n %}
<a class="previous_page"
{% if number %}
{% load i18n %}
<a class="previous_page"
{% if number %}
- href="?page={{
number
}}"
+ href="?page={{
get_dict
}}"
{% else %}
href="{{ url }}"
{% endif %}
{% else %}
href="{{ url }}"
{% endif %}
@@
-13,4
+13,4
@@
{% trans "previous" %}
{% endif %}
</a>
{% trans "previous" %}
{% endif %}
</a>
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git
a/fnpdjango/templates/fnpdjango/prevnext/prevnext.html
b/fnpdjango/templates/fnpdjango/prevnext/prevnext.html
index
fd3f9b3
..
c57d229
100644
(file)
--- a/
fnpdjango/templates/fnpdjango/prevnext/prevnext.html
+++ b/
fnpdjango/templates/fnpdjango/prevnext/prevnext.html
@@
-2,4
+2,4
@@
<p class="prevnext">
{% next_page %}
{% previous_page %}
<p class="prevnext">
{% next_page %}
{% previous_page %}
-</p>
\ No newline at end of file
+</p>
diff --git
a/fnpdjango/templatetags/fnp_prevnext.py
b/fnpdjango/templatetags/fnp_prevnext.py
index
4cfbb08
..
294cd12
100644
(file)
--- a/
fnpdjango/templatetags/fnp_prevnext.py
+++ b/
fnpdjango/templatetags/fnp_prevnext.py
@@
-1,3
+1,5
@@
+from copy import copy
+from urllib import urlencode
from django.template import Library
register = Library()
from django.template import Library
register = Library()
@@
-7,7
+9,11
@@
register = Library()
def previous_page(context, fallback=None, fallback_title=None):
current = context['page_obj'].number
if current > 1:
def previous_page(context, fallback=None, fallback_title=None):
current = context['page_obj'].number
if current > 1:
- return {'number': current - 1, 'title': None, 'url': None}
+ get_dict = copy(context['request'].GET)
+ get_dict['page'] = current - 1
+ print get_dict
+ return {'number': current - 1, 'title': None, 'url': None,
+ 'get_dict': urlencode(get_dict)}
else:
return {'number': None, 'title': fallback_title, 'url': fallback}
else:
return {'number': None, 'title': fallback_title, 'url': fallback}
@@
-17,7
+23,11
@@
def next_page(context, fallback=None, fallback_title=None):
current = context['page_obj'].number
page_range = context['paginator'].page_range
if current < page_range[-1]:
current = context['page_obj'].number
page_range = context['paginator'].page_range
if current < page_range[-1]:
- return {'number': current + 1, 'title': None, 'url': None}
+ get_dict = copy(context['request'].GET)
+ get_dict['page'] = current + 1
+ print get_dict
+ return {'number': current + 1, 'title': None, 'url': None,
+ 'get_dict': urlencode(get_dict)}
else:
return {'number': None, 'title': fallback_title, 'url': fallback}
else:
return {'number': None, 'title': fallback_title, 'url': fallback}
diff --git
a/setup.py
b/setup.py
index
b00ffd4
..
174c6c0
100755
(executable)
--- a/
setup.py
+++ b/
setup.py
@@
-22,7
+22,7
@@
def whole_trees(package_dir, paths):
setup(
name='fnpdjango',
setup(
name='fnpdjango',
- version='0.1.
4
',
+ version='0.1.
5
',
author='Radek Czajka',
author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
url = '',
author='Radek Czajka',
author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
url = '',