<div class="modal fade" id="sidecollect" tabindex="-1" role="dialog" aria-labelledby="sidecollectLabel">
  <div class="modal-dialog modal-sm" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="sidecollectLabel">收藏夹</h4>
      </div>
      {% set collects = current_user.collects.all() %}
      {% if not collects %}
      <div class="modal-body">
        <a href="{{ url_for('collect.list') }}" style="text-decoration:none">
          <i class="fa fa-plus"></i> 创建
        </a>
      </div>
      {% else %}
      <div class="modal-body">
        <form action="{{ url_for('collect.add_to_collect',topicId=topic.id) }}" method="POST">
          {{ form.hidden_tag() }}
          <p> 添加到收藏夹 </p>
          {% for collect in collects %}
          <label data-id="{{ collect.id }}"><input name="add-to-collect" type="checkbox" value="{{ collect.id}}" />{{ collect.name }}</label>
          {% if collect.is_privacy %}
          <span class="label label-default">私密</span>
          {% else %}
          <span class="label label-default">公开</span>
          {% endif %}
          <br/>
          {% endfor %}
          <div class="modal-footer" style="padding-top:5px;padding-bottom:5px;">
            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            <button type="submit" class="btn btn-primary">提交</button>
          </div>
        </form>
      </div>
      {% endif %}
    </div>
  </div>
</div>
