index.j2 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% extends "layout/backend.j2" %}
  2. {% block content %}
  3. <h1>Backend</h1>
  4. <p>List of pages</p>
  5. <div class="table-responsive">
  6. <table class="table table-striped table-sm">
  7. <thead>
  8. <tr>
  9. <th>Action</th>
  10. <th>Title</th>
  11. <th>Datum</th>
  12. <th>Author</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. {%- for page in pages recursive -%}
  17. <tr>
  18. <td>
  19. <div class="btn-group">
  20. <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  21. Action
  22. </button>
  23. <div class="dropdown-menu">
  24. <a class="dropdown-item" href="{{ url_for('backend_page.view', page_id=page.id) }}">View</a>
  25. <a class="dropdown-item" href="{{ url_for('backend_page.edit', page_id=page.id) }}">Edit</a>
  26. <a class="dropdown-item" href="{{ url_for('backend_page.remove', page_id=page.id) }}">Remove</a>
  27. </div>
  28. </div>
  29. </td>
  30. <td>
  31. {{ '> ' * (loop.depth - 1) }}<a href="{{ url_for('backend_page.view', page_id=page.id) }}">
  32. {{ page.title if page.title else 'page %s' % page.id }}
  33. </a>
  34. </td>
  35. <td>{{ page.datetime }}</td>
  36. <td>{{ page.user.name }}</td>
  37. </tr>
  38. {{ loop(page.children) }}
  39. {%- endfor -%}
  40. </tbody>
  41. </table>
  42. </div>
  43. {% endblock %}