index.j2 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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>Author</th>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. {% for file in files %}
  66. <tr>
  67. <td>
  68. <div class="btn-group">
  69. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  70. Action
  71. </button>
  72. <div class="dropdown-menu">
  73. <a class="dropdown-item" href="{{ url_for('backend_file.view', file_id=file.id) }}">View</a>
  74. <a class="dropdown-item" href="{{ url_for('backend_file.edit', file_id=file.id) }}">Edit</a>
  75. <a class="dropdown-item" href="{{ url_for('backend_file.remove', file_id=file.id) }}">Remove</a>
  76. </div>
  77. </div>
  78. </td>
  79. <td>
  80. <a href="{{ url_for('backend_file.view', file_id=file.id) }}">
  81. {{ file.title if file.title else 'file %s' % file.id }}
  82. </a>
  83. </td>
  84. <td>{{ file.user.name }}</td>
  85. </tr>
  86. {%- endfor -%}
  87. </tbody>
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. {% endblock %}