collections.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {% extends "layout.html" %}
  2. {% block main %}
  3. <h1 class="h3"><i class="fas fa-ruler-combined mr-2"></i>{{ title }}</h1>
  4. <table id="example" class="table table-striped table-bordered" cellspacing="0" width="60%">
  5. <thead>
  6. <tr>
  7. <th>數量</th>
  8. <th>標題</th>
  9. <th>順序</th>
  10. <th>顯示</th>
  11. <<<<<<< HEAD
  12. <th style="text-align:center;width:100px;">
  13. <button type="button" class="btn btn-primary btn-sm m-1" data-toggle="modal" data-target="#createModal">新增</button>
  14. </th>
  15. </tr>
  16. </thead>
  17. {% for idx in range(0, length) %}
  18. <tbody>
  19. <tr>
  20. <td>{{ idx }}</td>
  21. <td>{{ collections[idx].title }}</td>
  22. <td>1</td>
  23. <td>on</td>
  24. <td>
  25. <div>
  26. <a class="btn btn-secondary btn-sm m-1" href="{{ url_for('editor.editor', url=collections[idx].url) }}">編輯</a>
  27. <form action="{{ url_for('collections.remove', url=collections[idx].url) }}" method="POST">
  28. <input class="btn btn-danger" type="submit" value="Delete">
  29. </form>
  30. </div>
  31. </td>
  32. </tr>
  33. </tbody>
  34. =======
  35. >>>>>>> modified ui in editor
  36. {% endfor %}
  37. </table>
  38. <!-- Modal -->
  39. <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-labelledby="createModalLabel" aria-hidden="true">
  40. <div class="modal-dialog" role="document">
  41. <div class="modal-content">
  42. <div class="modal-header">
  43. <h5 class="modal-title" id="createModalLabel">Create new content</h5>
  44. </div>
  45. <form action="{{ url_for('collections.create') }}" method="POST" enctype="multipart/form-data">
  46. <div class="form-group">
  47. {{ form.title.label(class="form-control-label") }}
  48. {{ form.title(class="form-control form-control-lg") }}
  49. {{ form.image.label(class="form-control-label") }}
  50. {{ form.image(class="form-control form-control-lg") }}
  51. {{ form.description.label(class="form-control-label") }}
  52. {{ form.description(class="form-control form-control-lg") }}
  53. </div>
  54. <div class="modal-footer">
  55. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  56. <input class="btn btn-primary" type="submit" value="Create">
  57. </div>
  58. </form>
  59. </div>
  60. </div>
  61. </div>
  62. {% endblock main %}