index.j2 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {% extends "layout/backend.j2" %}
  2. {% block content %}
  3. <h1>Backend</h1>
  4. <div class="row">
  5. <div class="col-sm">
  6. <div class="card">
  7. <div class="card-header">
  8. Pages
  9. <div class="float-right">
  10. <a href="{{ url_for('backend_page.create') }}" class="btn btn-secondary btn-sm">Create</a>
  11. </div>
  12. </div>
  13. <div class="card-body">
  14. <table class="table table-striped table-sm">
  15. <thead>
  16. <tr>
  17. <th>Action</th>
  18. <th>Title</th>
  19. <th>Private</th>
  20. <th>Author</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {%- for page in pages recursive -%}
  25. <tr>
  26. <td>
  27. <div class="btn-group">
  28. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  29. Action
  30. </button>
  31. <div class="dropdown-menu">
  32. <a class="dropdown-item" href="{{ url_for('backend_page.view', page_id=page.id) }}">View</a>
  33. <a class="dropdown-item" href="{{ url_for('backend_page.edit', page_id=page.id) }}">Edit</a>
  34. <a class="dropdown-item" href="{{ url_for('backend_page.remove', page_id=page.id) }}">Remove</a>
  35. </div>
  36. </div>
  37. </td>
  38. <td>
  39. {{ '> ' * (loop.depth - 1) }}<a href="{{ url_for('backend_page.view', page_id=page.id) }}">
  40. {{ page.title if page.title else 'page %s' % page.id }}
  41. </a>
  42. </td>
  43. <td>{{ page.private }}</td>
  44. <td>{{ page.user.name }}</td>
  45. </tr>
  46. {{ loop(page.children) }}
  47. {%- endfor -%}
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="col-sm">
  54. <div class="card">
  55. <div class="card-header">
  56. Files
  57. <div class="float-right">
  58. <a href="{{ url_for('backend_file.create') }}" class="btn btn-secondary btn-sm">Upload</a>
  59. </div>
  60. </div>
  61. <div class="card-body">
  62. <table class="table table-striped table-sm">
  63. <thead>
  64. <tr>
  65. <th>Action</th>
  66. <th>Title</th>
  67. <th>Extension</th>
  68. <th>Author</th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. {% for file in files %}
  73. <tr>
  74. <td>
  75. <div class="btn-group">
  76. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  77. Action
  78. </button>
  79. <div class="dropdown-menu">
  80. <a class="dropdown-item" href="{{ url_for('backend_file.view', file_id=file.id) }}">View</a>
  81. <a class="dropdown-item" href="{{ url_for('backend_file.edit', file_id=file.id) }}">Edit</a>
  82. <a class="dropdown-item" href="{{ url_for('backend_file.remove', file_id=file.id) }}">Remove</a>
  83. </div>
  84. </div>
  85. </td>
  86. <td>
  87. <a href="{{ url_for('backend_file.view', file_id=file.id) }}">
  88. {{ file.title if file.title else 'file %s' % file.id }}
  89. </a>
  90. </td>
  91. <td>{{ file.extension() }}</td>
  92. <td>{{ file.user.name }}</td>
  93. </tr>
  94. {%- endfor -%}
  95. </tbody>
  96. </table>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="col-sm">
  101. <div class="card">
  102. <div class="card-header">
  103. Users
  104. </div>
  105. <div class="card-body">
  106. <table class="table table-striped table-sm">
  107. <thead>
  108. <tr>
  109. <th>Action</th>
  110. <th>Name</th>
  111. <th>Approved</th>
  112. <th>Registration</th>
  113. </tr>
  114. </thead>
  115. <tbody>
  116. {% for user in users %}
  117. <tr>
  118. <td>
  119. <div class="btn-group">
  120. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  121. Action
  122. </button>
  123. <div class="dropdown-menu">
  124. <a class="dropdown-item" href="{{ url_for('backend_user.view', user_id=user.id) }}">View</a>
  125. {% if not user.approved %}
  126. <a class="dropdown-item" href="{{ url_for('backend_user.approve', user_id=user.id) }}">Approve</a>
  127. {% endif %}
  128. </div>
  129. </div>
  130. </td>
  131. <td>
  132. <a href="{{ url_for('backend_user.view', user_id=user.id) }}">
  133. {{ user.name }}
  134. </a>
  135. </td>
  136. <td>{{ user.approved }}</td>
  137. <td>{{ user.registration_at }}</td>
  138. </tr>
  139. {%- endfor -%}
  140. </tbody>
  141. </table>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. {% endblock %}