index.j2 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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>
  10. <div class="card-body">
  11. <table class="table table-striped table-sm">
  12. <thead>
  13. <tr>
  14. <th>Action</th>
  15. <th>Title</th>
  16. <th>Private</th>
  17. <th>Author</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. {%- for page in pages recursive -%}
  22. <tr>
  23. <td>
  24. <div class="btn-group">
  25. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  26. Action
  27. </button>
  28. <div class="dropdown-menu">
  29. <a class="dropdown-item" href="{{ url_for('backend_page.view', page_id=page.id) }}">View</a>
  30. <a class="dropdown-item" href="{{ url_for('backend_page.edit', page_id=page.id) }}">Edit</a>
  31. <a class="dropdown-item" href="{{ url_for('backend_page.remove', page_id=page.id) }}">Remove</a>
  32. </div>
  33. </div>
  34. </td>
  35. <td>
  36. {{ '> ' * (loop.depth - 1) }}<a href="{{ url_for('backend_page.view', page_id=page.id) }}">
  37. {{ page.title if page.title else 'page %s' % page.id }}
  38. </a>
  39. </td>
  40. <td>{{ page.private }}</td>
  41. <td>{{ page.user.name }}</td>
  42. </tr>
  43. {{ loop(page.children) }}
  44. {%- endfor -%}
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="col-sm">
  51. <div class="card">
  52. <div class="card-header">
  53. Files
  54. </div>
  55. <div class="card-body">
  56. <table class="table table-striped table-sm">
  57. <thead>
  58. <tr>
  59. <th>Action</th>
  60. <th>Title</th>
  61. <th>Extension</th>
  62. <th>Author</th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. {% for file in files %}
  67. <tr>
  68. <td>
  69. <div class="btn-group">
  70. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  71. Action
  72. </button>
  73. <div class="dropdown-menu">
  74. <a class="dropdown-item" href="{{ url_for('backend_file.view', file_id=file.id) }}">View</a>
  75. <a class="dropdown-item" href="{{ url_for('backend_file.edit', file_id=file.id) }}">Edit</a>
  76. <a class="dropdown-item" href="{{ url_for('backend_file.remove', file_id=file.id) }}">Remove</a>
  77. </div>
  78. </div>
  79. </td>
  80. <td>
  81. <a href="{{ url_for('backend_file.view', file_id=file.id) }}">
  82. {{ file.title if file.title else 'file %s' % file.id }}
  83. </a>
  84. </td>
  85. <td>{{ file.extension() }}</td>
  86. <td>{{ file.user.name }}</td>
  87. </tr>
  88. {%- endfor -%}
  89. </tbody>
  90. </table>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. {% endblock %}