Posted By

pats on 08/23/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

NARKOZ


pagination


 / Published in: Django
 

  1. {% load addparam %}
  2. <div class="listing">
  3. {% if page_obj.has_previous %}
  4. <a href="{% addparam "page" page_obj.previous_page_number %}" title="Poprzednia strona">
  5. <img src="{{ MEDIA_URL }}img/aleft.jpg" alt="Poprzednia strona" />
  6. Poprzednia strona
  7. </a>
  8. <img src="{{ MEDIA_URL }}img/sep.jpg" alt="" />
  9. {% endif %}
  10.  
  11. {% for num in page_obj.page_range %}
  12. {% if not num %} ...
  13. {% else %}
  14. <a href="{% addparam "page" num %}" class="black {% ifequal num page_obj.number %}selected{% endifequal %}" title="Strona {{ num }}">{{ num }}</a>
  15. {% endif %}
  16. {% endfor %}
  17.  
  18. {% if page_obj.has_next %}
  19. ... <img src="{{ MEDIA_URL }}img/sep.jpg" alt="" />
  20. <a href="{% addparam "page" page_obj.next_page_number %}" title="Następna strona">Następna strona <img src="{{ MEDIA_URL }}img/aright.jpg" alt="Poprzednia strona" /></a>
  21. {% endif %}
  22. <div class="clear"></div>
  23. </div>

Report this snippet  

You need to login to post a comment.