<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right">
            <a href="<?php echo $this->url('cms-single', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加单页文章'); ?></a>
            <?php echo $this->HelpUrl('cmsSingle'); ?>
        </h1>

    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box shop-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="6%"><?php echo $this->translate('ID'); ?></th>
                                <th width="40%"><?php echo $this->translate('文章标题'); ?></th>
                                <th width="18%"><?php echo $this->translate('文章标签'); ?></th>
                                <th width="10%"><?php echo $this->translate('终端'); ?></th>
                                <th width="14%"><?php echo $this->translate('文章排序'); ?></th>
                                <th width="12%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if($this->singleCmsList) foreach ($this->singleCmsList as $cmsValue) { ?>
                                <tr>
                                    <td><?php echo $cmsValue->getSingleCmsId(); ?></td>
                                    <td><?php echo $this->escapeHtml($cmsValue->getSingleCmsTitle()); ?></td>
                                    <td><?php echo empty($cmsValue->getSingleTag()) ? $this->translate('无') : $cmsValue->getSingleTag(); ?></td>
                                    <td><?php echo empty($cmsValue->getTemplateCode()) ? '' : (strpos($cmsValue->getTemplateCode(), 'pc-') !== false ? $this->translate('电脑端') : $this->translate('手机端')); ?></td>
                                    <td><?php echo $this->escapeHtml($cmsValue->getSingleCmsSort()); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('cms-single',
                                            ['action'=>'edit', 'id'=>$cmsValue->getSingleCmsId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>
                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该单页文章吗?'); ?>', '<?php echo $this->url('cms-single', ['action'=>'delete', 'id'=>$cmsValue->getSingleCmsId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>

                </div>

            </div>
        </div>

    </section>
</div>