{% extends 'base/base.html' %}
{% block content %}
{{ breadcrumb(active='我的收藏')}}
<div class="row">
    <div class="col-md-9">
        <ul class="nav nav-tabs">
            <li role="presentation" class="active">{{ link_base.collect_list() }}</li>
            <li role="presentation">{{ link_base.collect_following() }}</li>
        </ul>
        <div class="panel panel-default">
            <div class="panel-heading">
                <button type="button" class="btn btn-sm btn-default" data-toggle="modal" data-target="#addcollect">创建收藏夹</button>
            </div>
            {% for collect in collects.items %}
            <div class="panel-body" style="border-bottom:1px solid #eee">
                <a href="{{ url_for('mine.collect',uid=collect.id)}}">{{ collect.name}}</a>
                {% if collect.is_privacy %}
                <span class="pull-right">私有</span>
                {% else %}
                <span class="pull-right">公共</span>
                {% endif %}
            </div>
            {% endfor %}
            {{ p_footer(collects,'mine.collect')}}
        </div>
    </div>
    <div class="col-md-3" style="padding-left:0">
        {% include 'base/panel.html' %}
    </div>
</div>
<div class="modal fade" id="addcollect" tabindex="-1" role="dialog" aria-labelledby="addcollectLabel">
    <div class="modal-dialog" 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="addcollectLabel">创建收藏夹</h4>
            </div>
            <form action="{{ url_for('mine.collect')}}" method="POST">
                {{ form.hidden_tag() }}
                <div class="modal-body">
                    <div class="form-group">
                        {{ form.name.label }}
                        {{ form.name(class="form-control")}}
                    </div>
                    <div class="form-group">
                        {{ form.description.label }}
                        {{ form.description(class="form-control")}}
                    </div>
                    {% for subfield in form.is_privacy %}
                    <div class="form-group">
                        {{subfield}}
                        {{subfield.label}}
                    </div>
                    {% endfor %}
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
