collections.html 15 KB

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