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