further.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {% extends "layout.html" %}
  2. {% block main %}
  3. <!-- <script type="text/javascript" src="/static/config.js"></script> -->
  4. <script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
  5. <script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script><!-- Image -->
  6. <script type="text/javascript" src="/static/js/yo.js"></script>
  7. <style>
  8. .table__data {
  9. padding: 5px;
  10. }
  11. </style>
  12. <table>
  13. <tbody id='contactData'>
  14. <h1 class="h3"><i class="fas fa-pen mr-3 mb-3"></i>{{ title }}</h1>
  15. <tr>
  16. <td>文章名稱</td>
  17. <td>文章連結 <span class="text-danger">(請務必填寫文章連結,否則此項文章不予載入)</span></td>
  18. </tr>
  19. <tr>
  20. <td class="table__data"><input class="form-control" id="data01" type="text" style="width: 600px;"
  21. placeholder="文章內容" disabled/></td>
  22. <td class="table__data"><input class="form-control" id="data00" type="text" style="width: 600px;"
  23. placeholder="文章連結" /></td>
  24. </tr>
  25. <tr>
  26. <td class="table__data"><input class="form-control" id="data11" type="text" style="width: 600px;"
  27. placeholder="文章內容" disabled/></td>
  28. <td class="table__data"><input class="form-control" id="data10" type="text" style="width: 600px;"
  29. placeholder="文章連結" /></td>
  30. </tr>
  31. <tr>
  32. <td class="table__data"><input class="form-control" id="data21" type="text" style="width: 600px;"
  33. placeholder="文章內容" disabled/></td>
  34. <td class="table__data"><input class="form-control" id="data20" type="text" style="width: 600px;"
  35. placeholder="文章連結" /></td>
  36. </tr>
  37. <tr>
  38. <td class="table__data"><input class="form-control" id="data31" type="text" style="width: 600px;"
  39. placeholder="文章內容" disabled/></td>
  40. <td class="table__data"><input class="form-control" id="data30" type="text" style="width: 600px;"
  41. placeholder="文章連結" /></td>
  42. </tr>
  43. <tr>
  44. <td class="table__data"><input class="form-control" id="data41" type="text" style="width: 600px;"
  45. placeholder="文章內容" disabled/></td>
  46. <td class="table__data"><input class="form-control" id="data40" type="text" style="width: 600px;"
  47. placeholder="文章連結" /></td>
  48. </tr>
  49. <tr>
  50. <td>
  51. <div class="d-flex justify-content-center mt-3" style="width: 200%;">
  52. <button class="btn btn_light mr-1" onclick="changeArticles();"><b>儲存</b> <i
  53. class="fas fa-pencil-alt"></i></button>
  54. </div>
  55. </td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. <script>
  60. $(function () {
  61. axios.get('/backstage/edit_blog_getfurther').then(({ data }) => {
  62. $('#data00').val(data.data[0][0]);
  63. $('#data01').val(data.data[0][1]);
  64. $('#data10').val(data.data[1][0]);
  65. $('#data11').val(data.data[1][1]);
  66. $('#data20').val(data.data[2][0]);
  67. $('#data21').val(data.data[2][1]);
  68. $('#data30').val(data.data[3][0]);
  69. $('#data31').val(data.data[3][1]);
  70. $('#data40').val(data.data[4][0]);
  71. $('#data41').val(data.data[4][1]);
  72. });
  73. });
  74. function changeArticles() {
  75. axios.get('/backstage/edit_blog_editfurther?data00=' + $('#data00').val() + '&data01=' + $('#data01').val() + '&data10=' + $('#data10').val() + '&data11=' + $('#data11').val() + '&data20=' + $('#data20').val() + '&data21=' + $('#data21').val() + '&data30=' + $('#data30').val() + '&data31=' + $('#data31').val() + '&data40=' + $('#data40').val() + '&data41=' + $('#data41').val())
  76. .then(({ data }) => {
  77. alert('已儲存');
  78. })
  79. .finally((data) => { location.reload(); });
  80. };
  81. </script>
  82. {% endblock main %}