page.html 655 B

123456789101112131415161718192021222324252627
  1. {% if data['page']['total'] > 1 %}
  2. {%set current = int(data['page']['current']) %}
  3. {% if current > 1 %}
  4. {%set prev = current-1 %}
  5. {% else %}
  6. {%set prev = 1 %}
  7. {% end %}
  8. {% if current >= data['page']['total'] %}
  9. {%set next = data['page']['total'] %}
  10. {% else %}
  11. {%set next = current+1 %}
  12. {% end %}
  13. {% if '?' in url %}
  14. {%set cUrl = url +'&page=' %}
  15. {% else %}
  16. {%set cUrl = url +'?page=' %}
  17. {% end %}
  18. <div class="paging">
  19. <a href="{{cUrl}}{{prev}}" class="prev"></a>
  20. <em>{{data['page']['current']}}</em><span>/</span><span>{{data['page']['total']}}</span>
  21. <a href="{{cUrl}}{{next}}" class="next"></a>
  22. </div>
  23. {% end %}