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.

78 lines
2.3 KiB

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