{% extends 'admin/admin.html' %}

{% import 'ui/admin_page.html' as pg %}

{% block css %}
    <style>
        * {
            font-family: "Microsoft YaHei";
        }

        .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
            vertical-align: middle;
            text-align: center;
        }

    </style>
{% endblock %}

{% block content %}
    <section class="content-header">
        <h1>豪豪视频管理系统</h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 收藏管理</a></li>
            <li class="active">收藏列表</li>
        </ol>
    </section>
    <section class="content" id="showcontent">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header">
                        <h3 class="box-title">收藏列表</h3>
{#                        <div class="box-tools">#}
{#                            <div class="input-group input-group-sm" style="width: 150px;">#}
{#                                <input type="text" name="table_search" class="form-control pull-right"#}
{#                                       placeholder="请输入关键字...">#}
{##}
{#                                <div class="input-group-btn">#}
{#                                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i>#}
{#                                    </button>#}
{#                                </div>#}
{#                            </div>#}
{#                        </div>#}
                    </div>
                    <div class="box-body table-responsive no-padding">
                    {# 删除标签成功时的消息提示(category_filter:分类闪现) #}
                            {% for msg in get_flashed_messages(category_filter=['ok']) %}
                                <div class="alert alert-success alert-dismissible">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    <h4><i class="icon fa fa-check"></i> 恭喜您,操作成功 !</h4>
                                        {{ msg }}
                                </div>
                            {% endfor %}
                        {# 删除电影失败时的消息提示(category_filter:分类闪现) #}
                            {% for msg in get_flashed_messages(category_filter=['err']) %}
                                <div class="alert alert-success alert-dismissible">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    <h4><i class="icon fa fa-check"></i> 抱歉,操作失败 !</h4>
                                        {{ msg }}
                                </div>
                            {% endfor %}
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th>编号</th>
                                <th>视频</th>
                                <th>用户</th>
                                <th>添加时间</th>
                                <th>操作事项</th>
                            </tr>
                            {% for v in page_data.items %}
                            <tr>
                                <td>{{ v.id }}</td>
                                <td>{{ v.movie.title }}</td>
                                <td>{{ v.user.name }}</td>
                                <td>{{ v.addtime }}</td>
                                <td>
                                    <a class="label label-success">编辑</a>
                                    &nbsp;
                                    <a href="{{ url_for('admin.moviecol_del',id=v.id) }}" class="label label-danger">删除</a>
                                </td>
                            </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        {# 引入后台页码模板 #}
                        {{ pg.page(page_data,'admin.moviecol_list') }}
                    </div>
                </div>
            </div>
        </div>
    </section>
{% endblock %}

{% block js %}
    <script>
        $(document).ready(function () {
            $('#g-7').addClass('active');
            $('#g-7-1').addClass('active');
        });
    </script>
{% endblock %}