further.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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>文章名稱 <span class="text-danger">(請務必填寫文章名稱,否則此項文章不予載入)</span></td>
  17. <td>文章連結</td>
  18. </tr>
  19. <tr>
  20. <td class="table__data"><input class="form-control" id="data01" type="text" style="width: 600px;" placeholder="文章內容" /></td>
  21. <td class="table__data"><input class="form-control" id="data00" type="text" style="width: 600px;" placeholder="文章連結" /></td>
  22. </tr>
  23. <tr>
  24. <td class="table__data"><input class="form-control" id="data11" type="text" style="width: 600px;" placeholder="文章內容" /></td>
  25. <td class="table__data"><input class="form-control" id="data10" type="text" style="width: 600px;" placeholder="文章連結" /></td>
  26. </tr>
  27. <tr>
  28. <td class="table__data"><input class="form-control" id="data21" type="text" style="width: 600px;" placeholder="文章內容" /></td>
  29. <td class="table__data"><input class="form-control" id="data20" type="text" style="width: 600px;" placeholder="文章連結" /></td>
  30. </tr>
  31. <tr>
  32. <td class="table__data"><input class="form-control" id="data31" type="text" style="width: 600px;" placeholder="文章內容" /></td>
  33. <td class="table__data"><input class="form-control" id="data30" type="text" style="width: 600px;" placeholder="文章連結" /></td>
  34. </tr>
  35. <tr>
  36. <td class="table__data"><input class="form-control" id="data41" type="text" style="width: 600px;" placeholder="文章內容" /></td>
  37. <td class="table__data"><input class="form-control" id="data40" type="text" style="width: 600px;" placeholder="文章連結" /></td>
  38. </tr>
  39. <tr>
  40. <td>
  41. <div class="d-flex justify-content-center mt-3" style="width: 200%;">
  42. <button class="btn btn_light mr-1" onclick="changeArticles();"><b>儲存</b> <i
  43. class="fas fa-pencil-alt"></i></button>
  44. </div>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. <script>
  50. $(function(){
  51. axios.get('/backstage/edit_blog_getfurther').then(({ data }) => {
  52. $('#data00').val(data.data[0][0]);
  53. $('#data01').val(data.data[0][1]);
  54. $('#data10').val(data.data[1][0]);
  55. $('#data11').val(data.data[1][1]);
  56. $('#data20').val(data.data[2][0]);
  57. $('#data21').val(data.data[2][1]);
  58. $('#data30').val(data.data[3][0]);
  59. $('#data31').val(data.data[3][1]);
  60. $('#data40').val(data.data[4][0]);
  61. $('#data41').val(data.data[4][1]);
  62. });
  63. });
  64. function changeArticles() {
  65. 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()).then(({ data }) => {
  66. alert('已儲存');
  67. }).finally((data) => { location.reload(); });
  68. };
  69. </script>
  70. {% endblock main %}