collections.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. {% extends "tables/editor_table.html" %}
  2. {% block table_body %}
  3. <script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
  4. <script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script><!-- Image -->
  5. <script type="text/javascript" src="/static/js/yo.js"></script>
  6. {% for idx in range(0, length) %}
  7. {% if collections[idx].url != '/collection' %}
  8. <tbody>
  9. <tr>
  10. <td class="table__data">{{ idx + 1 }}</td>
  11. <td class="table__data">{{ collections[idx].title }}</td>
  12. <td class="table__data">{{ collections[idx].date }}</td>
  13. <!-- <td class="table__data">1</td> -->
  14. <td class="table__data"><input type="checkbox" {{ 'checked' if (collections[idx].draft.lower()=='false' ) }}
  15. onclick="toggleDraft(this,'{{ collections[idx].url }}');" /></td>
  16. <td>
  17. <div class="d-flex justify-content-center">
  18. <button class="btn btn_light mr-1" onclick="getHeader('{{ collections[idx].url }}');"><b>主資訊</b> <i
  19. class="fas fa-pencil-alt"></i></button>
  20. <a class="m-1 btn__edit" href="{{ url_for('editor.editor', url=collections[idx].url) }}"><i
  21. class="fas fa-edit"></i></a>
  22. <form action="{{ url_for('collections.remove', url=collections[idx].url) }}" method="POST" method="POST"
  23. class="m-1 inline_block">
  24. <button class="btn__delete" type="submit" value="delete" onclick="return confirm('確定要刪除此作品?');"><i
  25. class="fas fa-trash-alt"></i></button>
  26. </form>
  27. </div>
  28. </td>
  29. </tr>
  30. </tbody>
  31. {% endif %}
  32. {% endfor %}
  33. {% endblock table_body %}
  34. <!-- Modal -->
  35. {% block modal_body %}
  36. <form action="{{ url_for('collections.create') }}" method="POST" enctype="multipart/form-data">
  37. <div class="form-group">
  38. {{ form.title.label(class="form-control-label modal__label mb-1") }} <span class="text-danger">(建議字數:15 字內)</span>
  39. {{ form.title(class="form-control form-control-lg") }}
  40. {{ form.description.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議字數:
  41. 50字內)</span>
  42. {{ form.description(class="form-control form-control-lg textarea") }}
  43. {{ form.collectiontitle.label(class="form-control-label modal__label mb-1") }}
  44. {{ form.collectiontitle(class="form-control form-control-lg") }}
  45. {{ form.collectiondesc.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議字數:
  46. 50字內)</span>
  47. {{ form.collectiondesc(class="form-control form-control-lg textarea") }}
  48. {{ form.image.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議尺寸/比例:
  49. 寬2048px * 高1365px)</span>
  50. {{ form.image(class="form-control form-control-lg modal__file") }}
  51. {{ form.tags.label(class="form-control-label modal__label mb-1") }}
  52. {{ form.tags(class="form-control form-control-lg") }}
  53. {{ form.coverimg.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議尺寸/比例:
  54. 寬____px * 高____px)</span>
  55. {{ form.coverimg(class="form-control form-control-lg modal__file") }}
  56. {{ form.bannerimgtext.label(class="form-control-label modal__label mt-3 mb-1") }}
  57. {{ form.bannerimgtext(class="form-control form-control-lg") }}
  58. {{ form.homeowner.label(class="form-control-label modal__label mt-3 mb-1") }}
  59. {{ form.homeowner(class="form-control form-control-lg") }}
  60. {{ form.size.label(class="form-control-label modal__label mt-3 mb-1") }}
  61. {{ form.size(class="form-control form-control-lg") }}
  62. {{ form.bednum.label(class="form-control-label modal__label mt-3 mb-1") }}
  63. {{ form.bednum(class="form-control form-control-lg") }}
  64. {{ form.housetype.label(class="form-control-label modal__label mt-3 mb-1") }}
  65. {{ form.housetype(class="form-control form-control-lg") }}
  66. {{ form.space.label(class="form-control-label modal__label mt-3 mb-1") }}
  67. {{ form.space(class="form-control form-control-lg") }}
  68. {{ form.loc.label(class="form-control-label modal__label mt-3 mb-1") }}
  69. {{ form.loc(class="form-control form-control-lg") }}
  70. {{ form.designer.label(class="form-control-label modal__label mt-3 mb-1") }}
  71. {{ form.designer(class="form-control form-control-lg") }}
  72. {{ form.budget.label(class="form-control-label modal__label mt-3 mb-1") }}
  73. {{ form.budget(class="form-control form-control-lg") }}
  74. {{ form.construction.label(class="form-control-label modal__label mt-3 mb-1") }}
  75. {{ form.construction(class="form-control form-control-lg") }}
  76. {{ form.comment.label(class="form-control-label modal__label mt-3 mb-1") }}
  77. {{ form.comment(class="form-control form-control-lg modal__file") }}
  78. </div>
  79. <div class="modal-footer pb-0 border-0">
  80. <button type="button" class="btn btn__cancel" data-dismiss="modal">取消</button>
  81. <input class="btn btn__submitadd" type="submit" value="完成">
  82. </div>
  83. </form>
  84. {% endblock modal_body %}
  85. {% block main_info_modal_body %}
  86. <div class="modal fade" id="myModal">
  87. <div class="modal-dialog">
  88. <div class="modal-content">
  89. <div class="modal-header">
  90. <h4 class="modal-title">作品集-主資訊修改</h4>
  91. <button type="button" class="close" data-dismiss="modal">×</button>
  92. </div>
  93. <div class="modal-body">
  94. <table class="table table-bordered">
  95. <tbody>
  96. <tr>
  97. <td>
  98. <h4>標題</h4>
  99. </td>
  100. <td><input class="form-control" id="ctitle" type="text" />
  101. <div class="mt-1 text-danger">(建議字數:15 字內)</div>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td>
  106. <h4>Meta 標題</h4>
  107. </td>
  108. <td><input class="form-control" id="cmetattl" type="text" />
  109. </td>
  110. </tr>
  111. <tr>
  112. <td>
  113. <h4>Meta 說明</h4>
  114. </td>
  115. <td><input class="form-control" id="cmetadsc" type="text" />
  116. </td>
  117. </tr>
  118. <tr id='sdesc'>
  119. <td>
  120. <h4>描述</h4>
  121. </td>
  122. <td><textarea class="form-control" rows="3" id="cdescription"></textarea>
  123. <div class="mt-1 text-danger">(建議字數:50 字內)</div>
  124. </td>
  125. </tr>
  126. <tr>
  127. <td>
  128. <h4>作品集標題</h4>
  129. </td>
  130. <td><input class="form-control" id="ccollname" type="text" />
  131. </td>
  132. </tr>
  133. <tr>
  134. <td>
  135. <h4>日期</h4>
  136. </td>
  137. <td><input class="form-control" id="cdate" type="text" /></td>
  138. </tr>
  139. <tr>
  140. <tr>
  141. <td>
  142. <h4>作品集描述</h4>
  143. </td>
  144. <td><textarea class="form-control" rows="3" id="ccolldesc"></textarea>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>
  149. <h4>圖片</h4>
  150. </td>
  151. <td>
  152. <input class="form-control" id="cfile" type="file" />
  153. <div class="mt-1 text-danger">(建議尺寸/比例:寬 2048px * 高 1365px)</div>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td>
  158. <h4>分類</h4>
  159. </td>
  160. <td><input class="form-control" id="ctags" type="text" />
  161. </td>
  162. </tr>
  163. <tr>
  164. <td>
  165. <h4>封面圖片</h4>
  166. </td>
  167. <td>
  168. <input class="form-control" id="cnewcoverimg" type="file" />
  169. <div class="mt-1 text-danger">(建議尺寸/比例:寬 ____px * 高 ____px)</div>
  170. </td>
  171. </tr>
  172. <tr>
  173. <td>
  174. <h4>封面圖片說明</h4>
  175. </td>
  176. <td><input class="form-control" id="ccoverimgtxt" type="text" />
  177. </td>
  178. </tr>
  179. <tr>
  180. <td>
  181. <h4>屋主</h4>
  182. </td>
  183. <td><input class="form-control" id="chomeowner" type="text" />
  184. </td>
  185. </tr>
  186. <tr>
  187. <td>
  188. <h4>坪數</h4>
  189. </td>
  190. <td><input class="form-control" id="csize" type="text" />
  191. </td>
  192. </tr>
  193. <tr>
  194. <td>
  195. <h4>格局</h4>
  196. </td>
  197. <td><select id="cbednum">
  198. <option value="">格局</option>
  199. <option value="1房">1房</option>
  200. <option value="2房">2房</option>
  201. <option value="3房">3房</option>
  202. <option value="兩房一廳">兩房一廳</option>
  203. <option value="三房兩廳">三房兩廳</option>
  204. <option value="四房兩廳">四房兩廳</option>
  205. </select></td>
  206. </tr>
  207. <tr>
  208. <td>
  209. <h4>類型</h4>
  210. </td>
  211. <td><select id="chousetype">
  212. <option value="">類型</option>
  213. <option value="大樓">大樓</option>
  214. <option value="透天">透天</option>
  215. </select></td>
  216. </tr>
  217. <tr>
  218. <td>
  219. <h4>設計師</h4>
  220. </td>
  221. <td><input class="form-control" id="cdesigner" type="text" /></td>
  222. </tr>
  223. <tr>
  224. <td>
  225. <h4>設計空間</h4>
  226. </td>
  227. <td><textarea class="form-control" id="cspace" rows="2" type="text"></textarea></td>
  228. </tr>
  229. <tr>
  230. <td>
  231. <h4>地點</h4>
  232. </td>
  233. <td><select id="cloc">
  234. <option value="台北">台北</option>
  235. <option value="新北">新北</option>
  236. <option value="基隆">基隆</option>
  237. <option value="桃園">桃園</option>
  238. <option value="新竹">新竹</option>
  239. <option value="苗栗">苗栗</option>
  240. <option value="台中">台中</option>
  241. <option value="南投">南投</option>
  242. <option value="彰化">彰化</option>
  243. <option value="雲林">雲林</option>
  244. <option value="嘉義">嘉義</option>
  245. <option value="台南">台南</option>
  246. <option value="高雄">高雄</option>
  247. <option value="屏東">屏東</option>
  248. <option value="宜蘭">宜蘭</option>
  249. <option value="花蓮">花蓮</option>
  250. <option value="台東">台東</option>
  251. <option value="澎湖">澎湖</option>
  252. <option value="金門">金門</option>
  253. <option value="馬祖">馬祖</option>
  254. <option value="其他">其他</option>
  255. </select></td>
  256. </tr>
  257. <tr>
  258. <td>
  259. <h4>預算</h4>
  260. </td>
  261. <td><input class="form-control" id="cbudget" type="text" /></td>
  262. </tr>
  263. <tr>
  264. <td>
  265. <h4>建案名稱</h4>
  266. </td>
  267. <td><input class="form-control" id="cconstruction" type="text" /></td>
  268. </tr>
  269. <!-- <td>
  270. <h4>作品集圖片集1</h4>
  271. </td>
  272. <td>
  273. <div class="form-control" id="editorjs1" style='border:inset 1px;'></div>
  274. </td> -->
  275. <tr>
  276. <td>
  277. <h4>是否顯示</h4>
  278. </td>
  279. <td><input id="cdraft" type="checkbox" checked="true" /></td>
  280. </tr>
  281. <tr>
  282. <td>
  283. <h4>Comment</h4>
  284. </td>
  285. <td>
  286. <input class="form-control" id="cnewcomment" type="file" />
  287. <div class="mt-1 text-danger">(建議尺寸/比例:寬 2048px * 高 1365px)</div>
  288. </td>
  289. </tr>
  290. </tbody>
  291. </table>
  292. <div class="d-none">
  293. <input id="ctype" type="text" /><br />
  294. <input id="curl" type="text" /><br />
  295. <input id="cimage" type="text" /><br />
  296. <input id="cweight" type="text" /><br />
  297. <input id="ctag" type="text" /><br />
  298. <input id="ctags" type="text" /><br />
  299. <input id="ccategories" type="text" /><br />
  300. <input id="ccol1" type="text" /><br />
  301. <input id="ccol2" type="text" /><br />
  302. <input id="ccoverimg" type="text" /><br />
  303. <input id="ccollslider" type="text" /><br />
  304. <input id="ccomment" type="text" /><br />
  305. <input id="cfile" type="text" /><br />
  306. </div>
  307. </div>
  308. <div class="modal-footer">
  309. <button type="button" id="uptbtn" class="btn btn-danger" onclick="updateHeader();">完成修改</button>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <script>
  315. </script>
  316. {% endblock %}