edit.j2 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Edit: {{ page.title }}</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. </head>
  7. <body>
  8. {% with messages = get_flashed_messages(with_categories=true) %}
  9. {% if messages %}
  10. {% for category, message in messages %}
  11. <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
  12. {{ message }}
  13. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  14. <span aria-hidden="true">&times;</span>
  15. </button>
  16. </div>
  17. {% endfor %}
  18. {% endif %}
  19. {% endwith %}
  20. <ul>
  21. {%- for item in current_menu.children recursive -%}
  22. <li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ item.text }}">
  23. <a class="nav-link" href="{{ item.url}}">
  24. <span class="nav-link-text">{{ item.text }}</span>
  25. </a>
  26. </li>
  27. {%- endfor -%}
  28. </ul>
  29. <h1>Edit: {{ page.title }}</h1>
  30. <form method="post">
  31. <div class="form-group">
  32. <label class="text-normal text-dark">title</label>
  33. <input type="text" class="form-control" name="title" placeholder="title" value="{{ page.title }}">
  34. </div>
  35. <div class="form-group">
  36. <label class="text-normal text-dark">Source</label>
  37. <textarea class="form-control" name="source">{{ page.source }}</textarea>
  38. </div>
  39. <div class="form-group">
  40. <label class="text-normal text-dark">Parent</label>
  41. <select class="form-control" name="parent_id">
  42. <option></option>
  43. {% for parent_page in pages %}
  44. {% if parent_page.id == page.parent_id %}
  45. <option value="{{ parent_page.id }}" selected>{{ parent_page.title }}</option>
  46. {% else %}
  47. <option value="{{ parent_page.id }}">{{ parent_page.title }}</option>
  48. {% endif %}
  49. {% endfor %}
  50. </select>
  51. </div>
  52. <div class="form-group pull-right">
  53. <button class="btn btn-primary">Save</button>
  54. </div>
  55. </form>
  56. <p>{{ page.content() }}</p>
  57. </body>