collections.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {% extends "tables/editor_table.html" %}
  2. {% block table_body %}
  3. {% for idx in range(0, length) %}
  4. {% if collections[idx].url != '/collection' %}
  5. <tbody>
  6. <tr>
  7. <td class="table__data">{{ idx + 1 }}</td>
  8. <td class="table__data">{{ collections[idx].title }}</td>
  9. <td class="table__data">{{ collections[idx].date }}</td>
  10. <!-- <td class="table__data">1</td> -->
  11. <td class="table__data"><input type="checkbox" {{ 'checked' if (collections[idx].draft.lower()=='false') }} onclick="toggleDraft(this,'{{ collections[idx].url }}');" /></td>
  12. <td>
  13. <div class="d-flex justify-content-center">
  14. <button class="btn btn_light mr-1" onclick="getHeader('{{ collections[idx].url }}');" ><b>主資訊</b> <i class="fas fa-pencil-alt"></i></button>
  15. <a class="m-1 btn__edit" href="{{ url_for('editor.editor', url=collections[idx].url) }}"><i class="fas fa-edit"></i></a>
  16. <form action="{{ url_for('collections.remove', url=collections[idx].url) }}" method="POST" method="POST" class="m-1 inline_block">
  17. <button class="btn__delete" type="submit" value="delete" onclick=" return confirm('確定要刪除此作品?');"><i class="fas fa-trash-alt"></i></button>
  18. </form>
  19. </div>
  20. </td>
  21. </tr>
  22. </tbody>
  23. {% endif %}
  24. {% endfor %}
  25. {% endblock table_body %}
  26. <!-- Modal -->
  27. {% block modal_body %}
  28. <form action="{{ url_for('collections.create') }}" method="POST" enctype="multipart/form-data">
  29. <div class="form-group">
  30. {{ form.title.label(class="form-control-label modal__label mb-1") }} <span class="text-danger">(建議字數: 15字內)</span>
  31. {{ form.title(class="form-control form-control-lg") }}
  32. {{ form.image.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議尺寸/比例: 寬2048px * 高1365px)</span>
  33. {{ form.image(class="form-control form-control-lg modal__file") }}
  34. {{ form.description.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議字數: 50字內)</span>
  35. {{ form.description(class="form-control form-control-lg textarea") }}
  36. </div>
  37. <div class="modal-footer pb-0 border-0">
  38. <button type="button" class="btn btn__cancel" data-dismiss="modal">取消</button>
  39. <input class="btn btn__submitadd" type="submit" value="完成">
  40. </div>
  41. </form>
  42. {% endblock modal_body %}
  43. {% block main_info_modal_body %}
  44. <div class="modal fade" id="myModal">
  45. <div class="modal-dialog">
  46. <div class="modal-content">
  47. <div class="modal-header">
  48. <h4 class="modal-title">作品集-主資訊修改</h4>
  49. <button type="button" class="close" data-dismiss="modal">×</button>
  50. </div>
  51. <div class="modal-body">
  52. <table class="table table-bordered">
  53. <tbody>
  54. <tr>
  55. <td>
  56. <h4>標題</h4>
  57. </td>
  58. <td><input class="form-control" id="ctitle" type="text" />
  59. <div class="mt-1 text-danger">(建議字數: 15字內)</div>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td>
  64. <h4>圖片</h4>
  65. </td>
  66. <td>
  67. <input class="form-control" id="cfile" type="file" />
  68. <div class="mt-1 text-danger">(建議尺寸/比例: 寬2048px * 高1365px)</div>
  69. </td>
  70. </tr>
  71. <tr id='sdesc'>
  72. <td>
  73. <h4>描述</h4>
  74. </td>
  75. <td><textarea class="form-control" rows="3" id="cdescription"></textarea>
  76. <div class="mt-1 text-danger">(建議字數: 50字內)</div>
  77. </td>
  78. </tr>
  79. <tr>
  80. <td>
  81. <h4>日期</h4>
  82. </td>
  83. <td><input class="form-control" id="cdate" type="text" /></td>
  84. </tr>
  85. <tr>
  86. <td>
  87. <h4>是否顯示</h4>
  88. </td>
  89. <td><input id="cdraft" type="checkbox" checked="true" /></td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <div class="d-none">
  94. <input id="ctype" type="text" /><br />
  95. <input id="curl" type="text" /><br />
  96. <input id="cimage" type="text" /><br />
  97. <input id="cweight" type="text" /><br />
  98. <input id="ctag" type="text" /><br />
  99. <input id="ccategories" type="text" /><br />
  100. <input id="ccol1" type="text" /><br />
  101. <input id="ccol2" type="text" /><br />
  102. </div>
  103. </div>
  104. <div class="modal-footer">
  105. <button type="button" id="uptbtn" class="btn btn-danger" onclick="updateHeader();">完成修改</button>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. {% endblock %}