141 lines
6.0 KiB
PHP
141 lines
6.0 KiB
PHP
@extends('layouts.base')
|
|
|
|
@section('content')
|
|
@section('title', trans('分类管理'))
|
|
<div class="right-titpos">
|
|
<ul class="add-snav">
|
|
<li class="active"><a href="#">分类管理</a></li>
|
|
<a class="btn btn-primary" href="{!! yzWebUrl('plugin.micro-communities.admin.category.upCate') !!}"><i class="fa fa-plus"></i> 添加分类</a>
|
|
<a class="btn btn-primary" href="{!! yzWebUrl('plugin.micro-communities.admin.category.upCateSecond') !!}"><i class="fa fa-plus"></i> 添加二级分类</a>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class='panel panel-default'>
|
|
<form action="" method="post" class="form-horizontal" id="form1">
|
|
<div class="panel panel-info">
|
|
<div class="panel-body">
|
|
|
|
<div class="form-group col-xs-12 col-sm-2">
|
|
<input class="form-control" name="search[cat_name]" id="" type="text"
|
|
value="{{$search['cat_name']}}" placeholder="分类名称">
|
|
</div>
|
|
|
|
<div class="form-group col-xs-12 col-sm-2">
|
|
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label"></label>
|
|
<div class="col-sm-8 col-lg-9 col-xs-12">
|
|
<button class="btn btn-success" style="border-radius: 5px;"><i class="fa fa-search"></i> 搜索</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class='panel panel-default'>
|
|
|
|
<div class='panel-body'>
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th style='width:5%;text-align: center;'>分类排序</th>
|
|
<th style='width:5%;text-align: center;'>分类ID</th>
|
|
<th style='width:10%;text-align: center;'>分类</th>
|
|
<th style='width:5%;text-align: center;'>分类级别</th>
|
|
<th style='width:23%;'>查看权限</th>
|
|
<th style='width:23%;'>发布权限</th>
|
|
<th style='width:10%;text-align: center;'>是否显示</th>
|
|
<th style='width:20%;text-align: center;'>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($list['data'] as $key=>$row)
|
|
<tr>
|
|
<td>{{$row['sort']}}</td>
|
|
<td>{{$row['id']}}</td>
|
|
<td><img src="{{tomedia($row['icon'])}}"
|
|
style="width: 30px; height: 30px;border:1px solid #ccc;padding:1px;"> {{$row['name']}}</td>
|
|
<td>@if($row['level'] == 1) 一级分类 @else 二级分类 @endif</td>
|
|
<td>{{$row['see_name']}}:{{$row['see_subordinate_str']}}</td>
|
|
<td>{{$row['release_name']}}:{{$row['release_subordinate_str']}}</td>
|
|
<td>
|
|
<div class="col-sm-2 col-xs-6">
|
|
<input class="mui-switch mui-switch-animbg" id="cate_is_show_{{$key}}" type="checkbox"
|
|
@if($row['is_show'] == 1)
|
|
checked
|
|
@endif
|
|
onclick="message_default({{$row['id']}},this.id)"/>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<a class='btn btn-default' href="{{yzWebUrl("plugin.micro-communities.admin.trick.index", ['search[cat_id]'=>$row['id']])}}">查看帖子</a>
|
|
<a class='btn btn-default' @if($row['level']==1) href="{{yzWebUrl("plugin.micro-communities.admin.category.upCate", ['cid'=>$row['id']])}}" @else href="{{yzWebUrl("plugin.micro-communities.admin.category.upCateSecond", ['cid'=>$row['id']])}}" @endif>编辑</a>
|
|
<a class='btn btn-default' href="{{yzWebUrl("plugin.micro-communities.admin.category.delete", ['cid'=>$row['id']])}}"
|
|
onclick="return confirm('确认删除此等级吗?');return false;">删除</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
|
|
{!! $pager !!}
|
|
</div>
|
|
</div>
|
|
<div style="width:100%;height:150px;"></div>
|
|
<script language='javascript'>
|
|
$(function () {
|
|
{{--$('#export').click(function () {--}}
|
|
{{--$('#form1').attr('action', '{!! yzWebUrl('plugin.team-dividend.admin.team-dividend.export') !!}');--}}
|
|
{{--$('#form1').submit();--}}
|
|
{{--});--}}
|
|
$('#search').click(function () {
|
|
$('#form1').attr('action', '{!! yzWebUrl('plugin.micro-communities.admin.category.index') !!}');
|
|
$('#form1').submit();
|
|
});
|
|
});
|
|
|
|
function message_default(cid,name) {
|
|
var id = "#" + name;
|
|
var url = "<?php echo yzWebUrl('plugin.micro-communities.admin.category.changeShow'); ?>"
|
|
if ($(id).is(':checked')) {
|
|
//开
|
|
$.post(url,{'status':1,'cid':cid},function(data){
|
|
if (data.status == 1) {
|
|
showPopover($(id),"开启成功");
|
|
$(id).attr("checked",true);
|
|
} else {
|
|
showPopover($(id),"开启失败");
|
|
$(id).attr("checked",false);
|
|
|
|
}
|
|
}, "json");
|
|
} else {
|
|
//关
|
|
$.post(url,{'status':0,'cid':cid},function(data){
|
|
if (data.status == 1) {
|
|
showPopover($(id),"关闭成功");
|
|
$(id).attr("checked",false);
|
|
|
|
} else {
|
|
showPopover($(id),"关闭失败");
|
|
$(id).attr("checked",true);
|
|
|
|
}
|
|
}, "json");
|
|
}
|
|
}
|
|
|
|
function showPopover(target, msg) {
|
|
target.attr("data-original-title", msg);
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
target.tooltip('show');
|
|
target.focus();
|
|
//2秒后消失提示框
|
|
setTimeout(function () {
|
|
target.attr("data-original-title", "");
|
|
target.tooltip('hide');
|
|
}, 2000
|
|
);
|
|
}
|
|
</script>
|
|
@endsection |