home.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% extends "layout.html" %}
  2. {% block main %}
  3. <h1>{{ title }}</h1>
  4. {% for content in contents %}
  5. <form action="{{ url_for('home.update', page='home', section_class=content.sectionClass) }}" method="POST">
  6. <table id="example" class="table table-striped table-bordered" cellspacing="0" width="60%">
  7. <thead>
  8. <tr>
  9. <th>數量</th>
  10. <th>類型</th>
  11. <th>內容</th>
  12. <th style="text-align:center;width:100px;">
  13. <input class="btn btn-primary" type="submit" value="提交">
  14. </th>
  15. </tr>
  16. </thead>
  17. {% for key, value in content.items() %}
  18. {% if key != 'sectionClass' %}
  19. {% for data in value %}
  20. <tbody>
  21. <tr>
  22. <td>{{ loop.index }}</td>
  23. <td>{{ key }}</td>
  24. <td>
  25. <input name="{{ key }}-{{ loop.index }}" class="form-control form-control-lg" value="{{ data }}">
  26. </td>
  27. <td>
  28. <div>
  29. <a class="btn btn-secondary btn-sm m-1" href="#">編輯</a>
  30. <form action="#" method="POST">
  31. <input class="btn btn-danger" type="submit" value="刪除">
  32. </form>
  33. </div>
  34. </td>
  35. </tr>
  36. </tbody>
  37. {% endfor %}
  38. {% endif %}
  39. {% endfor %}
  40. </table>
  41. </form>
  42. {% endfor %}
  43. {% endblock main %}