#@layout()

#define script()
<script>

    function doDel(id) {
        ajaxGet("/admin/product/comment/doDel/" + id);
    }

    $("#batchDel").click(function () {
        var ids = getSelectedIds();
        if (ids == "") {
            alert('您未选择任何条目');
            return
        }
        ajaxGet("/admin/product/comment/doDelByIds?ids=" + ids);
    })


</script>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            产品评论
            <small>Product Comment</small>
        </h1>
    </section>

    <section class="content-header text-tap">
        <a href="#(CPATH)/admin/product/comment">全部 (#(totalCount ?? 0))</a> |
        <a href="?status=1">已发布 (#(normalCount ?? 0))</a> |
        <a href="?status=2">待审核 (#(unauditedCount ?? 0))</a> |
        <a href="?status=3" style="color: #a00">垃圾箱 (#(trashCount ?? 0))</a>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header with-border">

                        <form class="form-horizontal actionPanel" action="#(CPATH)/admin/product/comment" method="get">
                            <input type="hidden" name="status" value="#para('status')">
                            <div class="row">
                                <div class="form-group col-lg-4">
                                    <label class="col-sm-3 control-label">关键字</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="keyword" value="#para('keyword')">
                                    </div>
                                </div>
                                <div class="form-group col-lg-8">
                                    <div class="col-sm-12">
                                        <button type="submit" class="btn btn-primary ">搜索</button>
                                        <button type="reset" class="btn btn-default">重置</button>
                                        <a class="btn"> 更多<i class="fa fa-fw fa-angle-down"></i> </a>
                                    </div>
                                </div>
                            </div>
                            <!-- /.box-body -->
                        </form>

                        <div class="row actionPanel">
                            <div class="col-xs-12">
                                <button type="button" id="batchAudit" class="btn btn-primary checkAction"> 批量审核</button>
                                <button type="button" id="batchDel" class="btn btn-default checkAction"> 批量删除</button>
                            </div>
                        </div>


                    </div>
                    <!-- /.box-header -->
                    <div class="box-body ">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
                                    <input name="dataItem" onchange="checkAll(this)" type="checkbox"/>
                                </th>

                                <th style="width: 30%">内容</th>
                                <th>评论的产品</th>
                                <th style="width: 100px">作者</th>
                                <th>状态</th>
                                <th>时间</th>
                            </tr>
                            #for(entry : page.list)
                            <tr class="jp-actiontr">
                                <td><input class="dataItem" type="checkbox" value="#(entry.id)"/>
                                </td>

                                <td>
                                    #(entry.content ??)

                                    <div class="jp-actionblock">
                                        <div class="jp-actionitem">
                                            <a href="/admin/product/comment/edit/#(entry.id)">编辑</a> |
                                            <a href="javascript:;" class="red-action"
                                               onclick="doDel('#(entry.id)')">删除</a>
                                        </div>
                                    </div>

                                </td>

                                <td>#(entry.product.title ??)</td>
                                <td>
                                        <a href="#(CPATH)/admin/user/detail/#(entry.user.id)"> #(entry.user.nickname ??) </a>

                                </td>
                                <td>#(entry.statusStr ??)</td>
                                <td>#date(entry.created)</td>
                            </tr>
                            #end
                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>

    </section>
</div>
#end