collect.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <div class="modal fade" id="sidecollect" tabindex="-1" role="dialog" aria-labelledby="sidecollectLabel">
  2. <div class="modal-dialog" role="document">
  3. <div class="modal-content">
  4. <div class="modal-header">
  5. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  6. <h4 class="modal-title" id="sidecollectLabel">收藏夹</h4>
  7. </div>
  8. {% if not current_user.collects.all() %}
  9. <div class="modal-body">
  10. <a href="{{ url_for('topic.collectlist') }}" style="text-decoration:none">
  11. <i class="fa fa-plus"></i> 创建
  12. </a>
  13. </div>
  14. {% else %}
  15. <form action="{{ url_for('topic.add_to_collect',topicId=topic.id) }}" method="POST">
  16. <div class="modal-body">
  17. <p> 添加到收藏夹 </p>
  18. {% for collect in current_user.collects %}
  19. <label data-id="{{ collect.id }}"><input name="add-to-collect" type="checkbox" value="{{ collect.id}}" />{{ collect.name }}</label>
  20. {% if collect.is_privacy %}
  21. <span class="label label-default">私密</span>
  22. {% else %}
  23. <span class="label label-default">公开</span>
  24. {% endif %}
  25. <br/>
  26. {% endfor %}
  27. </div>
  28. <div class="modal-footer" style="padding-top:5px;padding-bottom:5px;">
  29. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  30. <button type="submit" class="btn btn-primary">提交</button>
  31. </div>
  32. </form>
  33. {% endif %}
  34. </div>
  35. </div>
  36. </div>