collections.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends "tables/editor_table.html" %}
  2. {% block table_body %}
  3. {% for idx in range(0, length) %}
  4. {% if collections[idx].url != '/collection' %}
  5. <tbody>
  6. <tr>
  7. <td class="table__data">{{ idx + 1 }}</td>
  8. <td class="table__data">{{ collections[idx].title }}</td>
  9. <td class="table__data">{{ collections[idx].date }}</td>
  10. <!-- <td class="table__data">1</td> -->
  11. <td class="table__data"><input type="checkbox" {{ 'checked' if (collections[idx].draft.lower()=='false') }} onclick="toggleDraft(this,'{{ collections[idx].url }}');" /></td>
  12. <td>
  13. <div class="d-flex justify-content-center">
  14. <button class="btn btn_light mr-1" onclick="getHeader('{{ collections[idx].url }}');" ><b>主資訊</b> <i class="fas fa-pencil-alt"></i></button>
  15. <a class="m-1 btn__edit" href="{{ url_for('editor.editor', url=collections[idx].url) }}"><i class="fas fa-edit"></i></a>
  16. <form action="{{ url_for('collections.remove', url=collections[idx].url) }}" method="POST" method="POST" class="m-1 inline_block">
  17. <button class="btn__delete" type="submit" value="delete" onclick=" return confirm('確定要刪除此作品?');"><i class="fas fa-trash-alt"></i></button>
  18. </form>
  19. </div>
  20. </td>
  21. </tr>
  22. </tbody>
  23. {% endif %}
  24. {% endfor %}
  25. {% endblock table_body %}
  26. <!-- Modal -->
  27. {% block modal_body %}
  28. <form action="{{ url_for('collections.create') }}" method="POST" enctype="multipart/form-data">
  29. <div class="form-group">
  30. {{ form.title.label(class="form-control-label modal__label mb-1") }} <span class="text-danger">(建議字數: 15字內)</span>
  31. {{ form.title(class="form-control form-control-lg") }}
  32. {{ form.image.label(class="form-control-label modal__label mt-3 mb-1") }}
  33. {{ form.image(class="form-control form-control-lg modal__file") }}
  34. {{ form.description.label(class="form-control-label modal__label mt-3 mb-1") }} <span class="text-danger">(建議字數: 50字內)</span>
  35. {{ form.description(class="form-control form-control-lg textarea") }}
  36. </div>
  37. <div class="modal-footer pb-0 border-0">
  38. <button type="button" class="btn btn__cancel" data-dismiss="modal">取消</button>
  39. <input class="btn btn__submitadd" type="submit" value="完成">
  40. </div>
  41. </form>
  42. {% endblock modal_body %}