further.html 3.6 KB

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