KKP4

Untitled

Jan 4th, 2022
1,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.50 KB | None | 0 0
  1. {% extends "base.html" %}
  2. {% block title %}Artist: {{ camp.name }}{% endblock title %}
  3. {% block content %}
  4.  
  5. <h2 class="camp-name"><a href="{{ camp.url }}">{{ camp.name }}</a></h2>
  6. <hr class="mt-2 mb-5">
  7.   <div class="row text-center text-lg-left">
  8.     {% for data in object_list %}
  9.         <div class="col-lg-3 col-md-4 col-6">
  10.         <h6>{{ data.item_name|slice:":33" }}</h6>
  11.         <a href={{ data.url }} class="d-block mb-4 h-100">
  12.                 <img class="img-fluid img-thumbnail" src={{data.img_url}} alt="">
  13.             </a>
  14.         </div>
  15.     {% endfor %}
  16.     </div>
  17. </div>
  18. <!--Pagination-->
  19. {% if is_paginated %}
  20.     <nav aria-label="Page navigation example">
  21.         <ul class="pagination justify-content-center">
  22.         {% if page_obj.has_previous %}
  23.             <li class="page-item">
  24.             <a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
  25.           </li>
  26.         {% else %}
  27.             <li class="page-item disabled">
  28.             <a class="page-link" href="#" tabindex="-1" aria-disabled="True">Previous</a>
  29.           </li>
  30.         {% endif %}
  31.  
  32.         {% if page_obj.number|add:'-4' > 1 %}
  33.             <li class="page-item"><a class="page-link" href="?page={{ page_obj.number|add:'-5' }}">&hellip;</a></li>
  34.         {% endif %}
  35.  
  36.         {% for i in page_obj.paginator.page_range %}
  37.             {% if page_obj.number == i %}
  38.                 <li class="page-item active" aria-current="page">
  39.               <span class="page-link">
  40.                 {{ i }}
  41.                 <span class="sr-only">(current)</span>
  42.               </span>
  43.             </li>
  44.             {% elif i > page_obj.number|add:'-5' and i < page_obj.number|add:'5' %}
  45.                 <li class="page-item"><a class="page-link" href="?page={{ i }}">{{ i }}</a></li>
  46.             {% endif %}
  47.         {% endfor %}
  48.  
  49.         {% if page_obj.paginator.num_pages > page_obj.number|add:'4' %}
  50.            <li class="page-item"><a class="page-link" href="?page={{ page_obj.number|add:'5' }}">&hellip;</a></li>
  51.         {% endif %}
  52.  
  53.         {% if page_obj.has_next %}
  54.             <li class="page-item">
  55.             <a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
  56.           </li>
  57.         {% else %}
  58.             <li class="page-item disabled">
  59.             <a class="page-link" href="#" tabindex="-1" aria-disabled="True">Next</a>
  60.           </li>
  61.         {% endif %}
  62.       </ul>
  63.     </nav>
  64.     {% endif %}
  65.     <!--end of Pagination-->
  66. {% endblock content %}
Advertisement
Add Comment
Please, Sign In to add comment