index.j2 4.2 KB

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