{extend name="../../admin/view/public/admin"}

{block name='content'}

    <div class="page-header">当前位置：<span class="text-primary">列表</span></div>

    <div class="page-content">

        <form action="" method="get" class="form-horizontal form-search" role="form">
            <div class="page-toolbar">
                <div class="pull-left">
                    <a class='btn btn-primary btn-sm' href=""><i class='icon icon-plus'></i> 添加</a>
                </div>
                <div class="pull-right col-md-8">
                    <div class="input-group">
                        <div class="input-group-select">
                            <select name="enabled" class='form-control'>
                                <option value="" {if $_GET['enabled'] == ''} selected{/if}>状态</option>
                                <option value="1" {if $_GET['enabled']== '1'} selected{/if}>显示</option>
                                <option value="0" {if $_GET['enabled'] == '0'} selected{/if}>隐藏</option>
                            </select>
                        </div>
                        <input type="text" class="form-control" name='keyword' value="{$_GET['keyword']}" placeholder="请输入关键词"/>
                        <span class="input-group-btn">
                            <button class="btn btn-primary" type="submit"> 搜索</button>
                        </span>
                    </div>
                </div>
            </div>
        </form>

        {if empty($list)}
            <div class="panel panel-default">
                <div class="panel-body empty-data">未查询到相关数据</div>
            </div>
        {else}
            <form action="" method="post">
                <table class="table table-responsive table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width:50px;"></th>
                        <th style='width:150px'>顺序</th>
                        <th style="width: 200px;">标题</th>
                        <th style='width:80px'>显示</th>
                        <th style="width: 100px;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach $list as $key => $row}
                    <tr>
                        <td>
                            <input type='checkbox' value="{$row['id']}"/>
                        </td>
                        <td class='full'>
                            <a href='javascript:;' data-toggle="ajaxEdit" data-href="{:webUrl('home.adv/change',array('type'=>'displayorder','id'=>$row['id']))}">{$row['displayorder']}</a>
                            <i class="icow icow-weibiaoti-- " data-toggle="ajaxEdit2"></i>
                        </td>
                        <td class='full'>
                            <a href='javascript:;' data-toggle="ajaxEdit" data-href="{:webUrl('home.adv/change',array('type'=>'title','id'=>$row['id']))}">{$row['title']}</a>
                            <i class="icow icow-weibiaoti-- " data-toggle="ajaxEdit2"></i>
                        </td>
                        <td>
                            <span class='label {if $row['enabled']==1}label-primary{else}label-default{/if}'
                            data-toggle='ajaxSwitch'
                            data-switch-value='{$row['enabled']}'
                            data-switch-value0='0|隐藏|label label-default|{:webUrl('home.adv/change',array('type' => 'enabled','value'=>1,'id'=>$row['id']))}'
                            data-switch-value1='1|显示|label label-primary|{:webUrl('home.adv/change',array('type' => 'enabled','value'=>0,'id'=>$row['id']))}'
                            >
                            {if $row['enabled']==1}显示{else}隐藏{/if}
                            </span>
                        </td>
                        <td style="text-align:left;">
                            <a href="{:webUrl('home.adv/edit', array('id' => $row['id']))}" class="btn btn-op btn-operation">
                                <span data-toggle="tooltip" data-placement="top" data-original-title="修改">
                                    <i class='icow icow-bianji2'></i>
                                </span>
                            </a>
                            <a data-toggle='ajaxRemove' href="{:webUrl('home.adv/delete', array('id' => $row['id']))}" class="btn btn-op btn-operation" data-confirm='确认要删除此幻灯片吗?'>
                                <span data-toggle="tooltip" data-placement="top" data-original-title="删除">
                                    <i class='icow icow-shanchu1'></i>
                                </span>
                            </a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                    <tfoot>
                    <tr>
                        <td><input type="checkbox"></td>
                        <td colspan="2">
                            <div class="btn-group">
                                <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:webUrl('home.adv/change',array('type' => 'enabled','value'=>1))}"><i class='icow icow-xianshi'></i> 显示</button>
                                <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:webUrl('home.adv/change',array('type' => 'enabled','value'=>0))}"><i class='icow icow-yincang'></i> 隐藏</button>
                                <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{:webUrl('home.adv/change',array('type' => 'deleted','value'=>1))}">
                                    <i class='icow icow-shanchu1'></i> 删除
                                </button>
                            </div>
                        </td>
                        <td colspan="2" style="text-align: right">
                            {$pager | raw}
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </form>
        {/if}

    </div>

{/block}