blogs.html 4.5 KB

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