123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- {template 'common/header'}
- <div class="we7-page-title">微官网</div>
- <ul class="we7-page-tab">
- {loop $active_sub_permission $active_menu}
- {if permission_check_account_user($active_menu['permission_name'], false) && (empty($active_menu['is_display']) || is_array($active_menu['is_display']) && in_array($_W['account']['type'], $active_menu['is_display']))}
- <li {if $action == $active_menu['active']}class="active"{/if}><a href="{$active_menu['url']}">{$active_menu['title']}</a></li>
- {/if}
- {/loop}
- </ul>
- <div class="we7-page-search we7-padding-bottom clearfix">
- <div class="pull-right">
- {if empty($id)}<a href="{php echo url('site/category/post')}" class="btn btn-primary we7-padding-horizontal">+新建文章分类</a>{/if}
- {if !empty($id)}<a href="{php echo url('site/category/post', array('id' => $id))}" class="btn btn-primary we7-padding-horizontal">编辑文章分类</a>{/if}
- </div>
- </div>
- <form action="./index.php?c=site&a=category&do=delete" class="we7-form" method="post">
- <table class="table we7-table table-hover article-list vertical-middle" id="js-wesite-category-display">
- <col width="80px">
- <col width="130px"/>
- <col width="235px">
- <col width="90px"/>
- <col width=""/>
- <tr>
- <th></th>
- <th class="text-left">排序</th>
- <th class="text-left">分类名称</th>
- <th>设为栏目</th>
- <th class="text-right">操作</th>
- </tr>
- {loop $category $row}
- <tr>
- <td>
- <input type="checkbox" we7-check-all="1" name="rid[]" id="rid-{$row['id']}" value="{$row['id']}">
- <label for="rid-{$row['id']}"> </label>
- </td>
- <td class="text-left">{$row['displayorder']}</td>
- <td class="text-left">
- <span>{$row['name']}</span>
- </td>
- <td>
- <label>
- <div class="switch switch{php echo $row['enabled'] ? 'On' : 'Off'}" onclick="changeStatus({$row['id']})"></div>
- </label>
- </td>
- <td style="position: relative;">
- <div class="link-group">
- {if empty($row['parentid'])}
- <a href="{php echo url('site/category/post', array('parentid' => $row['id']))}" > +添加子分类</a>
- {/if}
- <a href="javascript:;" data-url="{php echo murl('site/site', array('cid' => $row['id']), true, true)}" class="js-clip">复制链接</a>
- <a href="{php echo url('site/article/post', array('pcate' => $row['id']));}" >添加文章</a>
- <a href="{php echo url('site/category/post', array('id' => $row['id']));}" >编辑</a>
- <a href="{php echo url('site/category/delete', array('id' => $row['id']));}" class="del" onclick="return confirm('确认删除此分类吗?');return false;">删除</a>
- </div>
- </td>
- </tr>
- {loop $children[$row['id']] $row}
- <tr class="bg-light-gray">
- <td>
- <input type="checkbox" name="rid[]" id="rid-{$row['id']}" value="{$row['id']}">
- <label for="rid-{$row['id']}"> </label>
- </td>
- <td class="text-left">
- <div class="pad-left">
- {$row['displayorder']}
- </div>
- </td>
- <td class="text-left"><span class="color-gray" style="margin-left: 50px;">{$row['name']}</span></td>
- <td>
- <label>
- <div class="switch switch{php echo $row['enabled'] ? 'On' : 'Off'}" onclick="changeStatus({$row['id']})"></div>
- </label>
- </td>
- <td style="position: relative;" class="text-right">
- <div class="link-group">
- <a href="javascript:;" data-url="{php echo murl('site/site', array('cid' => $row['id']), true, true)}" class="we7-margin-right-sm js-clip">复制链接</a>
- <a href="{php echo url('site/article/post', array('pcate' => $row['parentid'], 'ccate' => $row['id']));}" class="we7-margin-right-sm">添加文章</a>
- <a href="{php echo url('site/category/post', array('id' => $row['id'], 'parentid' => $row['parentid']));}" class="we7-margin-right-sm">编辑</a>
- <a href="{php echo url('site/category/delete', array('id' => $row['id']));}" class="del" onclick="return confirm('确认删除此分类吗?');return false;">删除</a>
- </div>
- </td>
- </tr>
- {/loop}
- {/loop}
- </table>
- <div class="clearfix"></div>
- <div class="we7-margin-left">
- <input type="checkbox" we7-check-all="1" name="rid[]" id="select_all" value="1">
- <label for="select_all"> </label>
- <input type="submit" class="btn btn-danger" name="submit" value="删除" onclick="if(!confirm('确定删除选中的规则吗?')) return false;"/>
- <input type="hidden" name="token" value="{$_W['token']}" />
- </div>
- </form>
- <script>
- $('#select_all').click(function(){
- $('.article-list :checkbox').prop('checked', $(this).prop('checked'));
- });
- $('.js-clip').each(function(){
- util.clip(this, $(this).attr('data-url'));
- });
- var changeStatus = function(id) {
- var id = parseInt(id);
- $.post('./index.php?c=site&a=category&do=change_status', {id: id},function(data) {
- if (data.message.errno == 0){
- util.message(data.message.message, data.redirect, 'success');
- } else {
- if (data.message.errno == 1) util.toast('更改失败!', 'error');
- if (data.message.errno == -1) util.toast('分类不存在,请刷新重试!');
- }
- }, 'json');
- }
- </script>
- {template 'common/footer'}
|