python - styling issue in navigation bar with django -


i have styling issue in navigation bar

when next button enabled, has issue

error in next page button:

error in next page button

but when button disabled, got fixed

error fixed:

error fixed

here code navigation.html

    <div class="col-6 col-offset-3 text-center pagination-set">     <nav aria-label="">         {% if queryset.has_other_pages %}          <ul class="pagination">             {% if queryset.has_previous %}                 <li class="page-item">                     <a class="page_link" href="?page={{ queryset.previous_page_number }}">&laquo;</a>                 </li>                {% else %}                 <li class="page-item disabled">                    <a class="page-link"><span class="page-link">&laquo;</span></a>                 </li>              {% endif %}                {% in page_range %}                 {% if queryset.numbers == %}                     <li class="page-item active">                         <a class="page-link">{{ }}                             <span class="src-only">(current)                             </span>                         </a>                     </li>                 {% else %}                     <li class="page-item">                         <a class="page-link" href="?page={{ }}">{{ }}</a>                     </li>                 {% endif %}               {% endfor %}                 {% if queryset.has_next %}                     <li class="page-item">                         <a class="page-link" href="?page={{queryset.next_page_number}}"></a>&raquo;                     </li>                  {% else %}                     <li class="page-item disabled">                         <a class="page-link"><span>&raquo;</span></a>                     </li>                 {% endif %}          </ul>     </nav> </div> 

{% endif %}

and code pagination in views.py:

    paginator = paginator(queryset_list, 2) # show 2 contacts per page  page = request.get.get('page') try:     queryset = paginator.page(page) except pagenotaninteger:     # if page not integer, deliver first page.     queryset = paginator.page(1) except emptypage:     # if page out of range (e.g. 9999), deliver last page of results.     queryset = paginator.page(paginator.num_pages)  index = queryset.number -1 max_index = len(paginator.page_range) start_index = index - 5 if index <= max_index - 5 else 0 end_index = index + 5 if index <= max_index - 5 else max_index page_range = paginator.page_range[start_index:end_index] 

i grab code django documentaion


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -