You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.3 KiB

  1. {% extends "admin/admin_base.html" %}
  2. {% load static %}
  3. {% block content-area %}
  4. <div class="card">
  5. <header class="card-header">
  6. <p class="card-header-title">
  7. Dataset
  8. </p>
  9. <a href="#" class="card-header-icon" aria-label="more options">
  10. <span class="icon">
  11. <i class="fas fa-angle-down" aria-hidden="true"></i>
  12. </span>
  13. </a>
  14. </header>
  15. <div class="card-content">
  16. <table class="table is-fullwidth is-hoverable">
  17. <thead>
  18. <tr>
  19. <th>#</th>
  20. <th>Text</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {% for doc in object_list %}
  25. <tr>
  26. <td>{{ forloop.counter0|add:page_obj.start_index }}</td>
  27. <td>{{ doc.text|truncatechars:200 }}</td>
  28. </tr>
  29. {% endfor %}
  30. </tbody>
  31. </table>
  32. </div>
  33. </div>
  34. {% if is_paginated %}
  35. <nav class="pagination is-left" role="navigation" aria-label="pagination">
  36. <ul class="pagination-list">
  37. {% if page_obj.number == 1 %}
  38. <li class="pagination-link" disabled><span></span></li>
  39. {% else %}
  40. <li>
  41. <a class="pagination-link" href="?page=1"></a>
  42. </li>
  43. {% endif %}
  44. {% if page_obj.has_previous %}
  45. <li>
  46. <a class="pagination-link" href="?page={{ page_obj.previous_page_number }}">&laquo;</a>
  47. </li>
  48. {% else %}
  49. <li class="pagination-link" disabled><span>&laquo;</span></li>
  50. {% endif %}
  51. {% for i in paginator.page_range %}
  52. {% if page_obj.number == i %}
  53. <li>
  54. <a class="pagination-link is-current" aria-label="Goto page {{ i }}">{{ i }}</a>
  55. </li>
  56. {% elif i > page_obj.number|add:'-5' and i < page_obj.number|add:'5' %}
  57. <li>
  58. <a href="?page={{ i }}" class="pagination-link" aria-label="Goto page {{ i }}">{{ i }}</a>
  59. </li>
  60. {% endif %}
  61. {% endfor %}
  62. {% if page_obj.has_next %}
  63. <li>
  64. <a class="pagination-link" href="?page={{ page_obj.next_page_number }}">&raquo;</a>
  65. </li>
  66. {% else %}
  67. <li class="pagination-link" disabled><span>&raquo;</span></li>
  68. {% endif %}
  69. {% if page_obj.number == paginator.num_pages %}
  70. <li class="pagination-link" disabled><span></span></li>
  71. {% else %}
  72. <li>
  73. <a class="pagination-link" href="?page={{ paginator.num_pages }}"></a>
  74. </li>
  75. {% endif %}
  76. </ul>
  77. </nav>
  78. {% endif %}
  79. {% endblock %}