blogs.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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"><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") }}
  27. {{ form.title(class="form-control form-control-lg") }}
  28. {{ form.image.label(class="form-control-label modal__label mt-3 mb-1") }}
  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 %}