Login

BetterPaginator Template Code

Author:
spankalee
Posted:
May 7, 2007
Language:
Python
Version:
.96
Score:
-1 (after 1 ratings)

Example usage of BetterPaginator

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
		{% spaceless %}
			{% if paginator.has_previous_page %}
				<a class="paginator arrow" href="{{ paginator.previous_link }}">&#171; Previous</a>
			{% else %}
				<span class="paginator disabled arrow">&#171; Previous</span>
			{% endif %}
			<!-- {{ paginator.start_index }} - {{ paginator.end_index }} of {{ paginator.hits }} -->
			{% for set in paginator.windowed_page_links %}
				{% if not forloop.first %}...{% endif %}
				{% for p in set %}
					{% if p.2 %}
						<span class="paginator current_page">{{ p.0 }}</span>
					{% else %}
						<a class="paginator" href ="{{ p.1 }}">{{ p.0 }}</a>
					{% endif %}
				{% endfor %}
			{% endfor %}
			{% if paginator.has_next_page %}
				<a class="paginator arrow" href="{{ paginator.next_link }}">Next &#187;</a>
			{% else %}
				<span class="paginator disabled arrow">Next &#187;</span>
			{% endif %}
		{% endspaceless %}

More like this

  1. Template tag - list punctuation for a list of items by shapiromatron 10 months, 3 weeks ago
  2. JSONRequestMiddleware adds a .json() method to your HttpRequests by cdcarter 11 months ago
  3. Serializer factory with Django Rest Framework by julio 1 year, 5 months ago
  4. Image compression before saving the new model / work with JPG, PNG by Schleidens 1 year, 6 months ago
  5. Help text hyperlinks by sa2812 1 year, 7 months ago

Comments

Please login first before commenting.