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.

89 lines
2.7 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. <th></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:100 }}</td>
  28. <td>
  29. <p class="control">
  30. <button class="button is-text delete-document-button" data-delete-document-id="{{ doc.id }}">
  31. <span class="icon is-small">
  32. <i class="fas fa-trash"></i>
  33. </span>
  34. <span>Delete</span>
  35. </button>
  36. </p>
  37. </td>
  38. </tr>
  39. {% endfor %}
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. {% if is_paginated %}
  45. <nav class="pagination is-left" role="navigation" aria-label="pagination">
  46. <ul class="pagination-list">
  47. {% if page_obj.number == 1 %}
  48. <li class="pagination-link" disabled><span></span></li>
  49. {% else %}
  50. <li>
  51. <a class="pagination-link" href="?page=1"></a>
  52. </li>
  53. {% endif %}
  54. {% if page_obj.has_previous %}
  55. <li>
  56. <a class="pagination-link" href="?page={{ page_obj.previous_page_number }}">&laquo;</a>
  57. </li>
  58. {% else %}
  59. <li class="pagination-link" disabled><span>&laquo;</span></li>
  60. {% endif %}
  61. {% for i in paginator.page_range %}
  62. {% if page_obj.number == i %}
  63. <li>
  64. <a class="pagination-link is-current" aria-label="Goto page {{ i }}">{{ i }}</a>
  65. </li>
  66. {% elif i > page_obj.number|add:'-5' and i < page_obj.number|add:'5' %} <li>
  67. <a href="?page={{ i }}" class="pagination-link" aria-label="Goto page {{ i }}">{{ i }}</a>
  68. </li>
  69. {% endif %}
  70. {% endfor %}
  71. {% if page_obj.has_next %}
  72. <li>
  73. <a class="pagination-link" href="?page={{ page_obj.next_page_number }}">&raquo;</a>
  74. </li>
  75. {% else %}
  76. <li class="pagination-link" disabled><span>&raquo;</span></li>
  77. {% endif %}
  78. {% if page_obj.number == paginator.num_pages %}
  79. <li class="pagination-link" disabled><span></span></li>
  80. {% else %}
  81. <li>
  82. <a class="pagination-link" href="?page={{ paginator.num_pages }}"></a>
  83. </li>
  84. {% endif %}
  85. </ul>
  86. </nav>
  87. {% endif %}
  88. {% endblock %}