添加分类图标
This commit is contained in:
parent
1b7f45a4e2
commit
3fe9ef818d
@ -150,7 +150,7 @@ class Forum extends AdminController
|
|||||||
$res['count']= count($list);
|
$res['count']= count($list);
|
||||||
$res['data'] = [];
|
$res['data'] = [];
|
||||||
foreach($list as $k=>$v){
|
foreach($list as $k=>$v){
|
||||||
$res['data'][] = ['sort'=>$v['sort'],'id' => $v['id'],'tags'=>$v['catename'],'ename'=>$v['ename'],'is_hot'=>$v['is_hot'],'desc'=>$v['desc']];
|
$res['data'][] = ['sort'=>$v['sort'],'id' => $v['id'],'tags'=>$v['catename'],'ename'=>$v['ename'],'icon'=>$v['icon'],'is_hot'=>$v['is_hot'],'desc'=>$v['desc']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return json($res);
|
return json($res);
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="layuiadmin-app-cont-tagsbar">
|
<script type="text/html" id="layuiadmin-app-cont-tagsbar">
|
||||||
{if condition="checkRuleButton('admin/forum/tagsform')"}
|
{if condition="checkRuleButton('admin/forum/tagsform')"}
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></a>
|
||||||
{else /}<a class="layui-btn layui-btn-disabled layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>编辑</a>{/if}
|
{else /}<a class="layui-btn layui-btn-disabled layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-edit"></i></a>{/if}
|
||||||
{if condition="checkRuleButton('admin/forum/tagsdelete')"}
|
{if condition="checkRuleButton('admin/forum/tagsdelete')"}
|
||||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i></a>
|
||||||
{else /}<a class="layui-btn layui-btn-disabled layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>{/if}
|
{else /}<a class="layui-btn layui-btn-disabled layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i></a>{/if}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -53,13 +53,14 @@
|
|||||||
type: 2
|
type: 2
|
||||||
,title: '添加分类'
|
,title: '添加分类'
|
||||||
,content: 'tagsform.html'
|
,content: 'tagsform.html'
|
||||||
,area: ['400px', '350px']
|
,area: ['400px', '450px']
|
||||||
,btn: ['确定', '取消']
|
,btn: ['确定', '取消']
|
||||||
,yes: function(index, layero){
|
,yes: function(index, layero){
|
||||||
var othis = layero.find('iframe').contents().find("#layuiadmin-app-form-tags")
|
var othis = layero.find('iframe').contents().find("#layuiadmin-app-form-tags")
|
||||||
,sort = othis.find('input[name="sort"]').val()
|
,sort = othis.find('input[name="sort"]').val()
|
||||||
,tags = othis.find('input[name="tags"]').val()
|
,tags = othis.find('input[name="tags"]').val()
|
||||||
,ename = othis.find('input[name="ename"]').val()
|
,ename = othis.find('input[name="ename"]').val()
|
||||||
|
,icon = othis.find('input[name="icon"]').val()
|
||||||
,desc = othis.find('input[name="desc"]').val();
|
,desc = othis.find('input[name="desc"]').val();
|
||||||
|
|
||||||
if(!tags.replace(/\s/g, '')) return;
|
if(!tags.replace(/\s/g, '')) return;
|
||||||
@ -67,7 +68,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:"{:url('admin/Forum/addtags')}",
|
url:"{:url('admin/Forum/addtags')}",
|
||||||
data:{"sort":sort,"catename":tags,"ename":ename,"desc":desc},
|
data:{"sort":sort,"catename":tags,"ename":ename,"icon":cion,"desc":desc},
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
<label class="layui-form-label">EN别名</label>
|
<label class="layui-form-label">EN别名</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" name="ename" lay-verify="required" placeholder="英文名*" autocomplete="off" class="layui-input">
|
<input type="text" name="ename" lay-verify="required" placeholder="英文名*" autocomplete="off" class="layui-input">
|
||||||
|
</div>
|
||||||
|
<label class="layui-form-label">图标</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="icon" placeholder="图标*" id="iconPicker" lay-filter="iconPicker" style="display:none;" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
<label class="layui-form-label">描述</label>
|
<label class="layui-form-label">描述</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
@ -31,9 +35,22 @@
|
|||||||
base: '/static/admin/' //静态资源所在路径
|
base: '/static/admin/' //静态资源所在路径
|
||||||
}).extend({
|
}).extend({
|
||||||
index: 'lib/index' //主入口模块
|
index: 'lib/index' //主入口模块
|
||||||
}).use(['index', 'form'], function(){
|
}).use(['index', 'form', 'iconPicker'], function(){
|
||||||
var $ = layui.$
|
var $ = layui.$
|
||||||
,form = layui.form ;
|
,form = layui.form ;
|
||||||
|
var iconPicker = layui.iconPicker;
|
||||||
|
|
||||||
|
//初始化图标选择
|
||||||
|
iconPicker.render({
|
||||||
|
elem: '#iconPicker',
|
||||||
|
type: 'fontClass',
|
||||||
|
search: false,
|
||||||
|
page: true,
|
||||||
|
limit: 12,
|
||||||
|
click: function (data) {
|
||||||
|
//console.log(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
@ -4,7 +4,8 @@ return [
|
|||||||
//语言
|
//语言
|
||||||
'language' => 'language',
|
'language' => 'language',
|
||||||
'chinese' => '中文简体',
|
'chinese' => '中文简体',
|
||||||
'english' => 'english',
|
'tChinese' => '中文繁体',
|
||||||
|
'english' => 'English',
|
||||||
|
|
||||||
//弹窗提示消息
|
//弹窗提示消息
|
||||||
'add' => '添加',
|
'add' => '添加',
|
||||||
|
@ -4,6 +4,7 @@ return [
|
|||||||
//語言
|
//語言
|
||||||
'language' => 'language',
|
'language' => 'language',
|
||||||
'chinese' => '中文簡體',
|
'chinese' => '中文簡體',
|
||||||
|
'tChinese' => '中文繁體',
|
||||||
'english' => 'english',
|
'english' => 'english',
|
||||||
|
|
||||||
//彈窗提示消息
|
//彈窗提示消息
|
||||||
|
@ -270,6 +270,7 @@ CREATE TABLE `tao_cate` (
|
|||||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
|
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
|
||||||
`catename` varchar(20) NOT NULL COMMENT '导航名称',
|
`catename` varchar(20) NOT NULL COMMENT '导航名称',
|
||||||
`ename` varchar(20) NOT NULL DEFAULT '' COMMENT '分类别名',
|
`ename` varchar(20) NOT NULL DEFAULT '' COMMENT '分类别名',
|
||||||
|
`icon` varchar(50) DEFAULT NULL COMMENT '图标',
|
||||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||||
`status` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态1启用0禁用',
|
`status` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态1启用0禁用',
|
||||||
`type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0帖子1文章',
|
`type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0帖子1文章',
|
||||||
@ -285,9 +286,9 @@ CREATE TABLE `tao_cate` (
|
|||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of tao_cate
|
-- Records of tao_cate
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `tao_cate` VALUES ('1', '提问', 'ask', '1', '1', '0', 'TaoLer社区提问专栏1', '0', '0', '0', '0');
|
INSERT INTO `tao_cate` VALUES ('1', '提问', 'ask', 'layui-icon-help', '1', '1', '0', 'TaoLer社区提问专栏1', '0', '0', '0', '0');
|
||||||
INSERT INTO `tao_cate` VALUES ('2', '分享', 'share', '2', '1', '0', '', '0', '0', '0', '0');
|
INSERT INTO `tao_cate` VALUES ('2', '分享', 'share', 'layui-icon-share', '2', '1', '0', '', '0', '0', '0', '0');
|
||||||
INSERT INTO `tao_cate` VALUES ('3', '讨论', 'talk', '3', '1', '0', '', '1', '0', '0', '0');
|
INSERT INTO `tao_cate` VALUES ('3', '讨论', 'talk', 'layui-icon-dialogue', '3', '1', '0', '', '1', '0', '0', '0');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for tao_collection
|
-- Table structure for tao_collection
|
||||||
|
@ -7,7 +7,7 @@ return [
|
|||||||
//应用名,此项不可更改
|
//应用名,此项不可更改
|
||||||
'appname' => 'TaoLer',
|
'appname' => 'TaoLer',
|
||||||
//版本配置
|
//版本配置
|
||||||
'version' => '1.7.20',
|
'version' => '1.7.21',
|
||||||
//加盐
|
//加盐
|
||||||
'salt' => 'taoler',
|
'salt' => 'taoler',
|
||||||
//数据库备份目录
|
//数据库备份目录
|
||||||
|
@ -220,9 +220,13 @@ layui.define(['table', 'form'], function(exports){
|
|||||||
,{field: 'id', title: 'ID',width: 60}
|
,{field: 'id', title: 'ID',width: 60}
|
||||||
,{field: 'tags', title: '分类名', minWidth: 100}
|
,{field: 'tags', title: '分类名', minWidth: 100}
|
||||||
,{field: 'ename', title: 'EN别名', minWidth: 100}
|
,{field: 'ename', title: 'EN别名', minWidth: 100}
|
||||||
|
,{
|
||||||
|
title: '图标', align: 'center',
|
||||||
|
templet: '<p><i class="layui-icon {{d.icon}}"></i></p>'
|
||||||
|
}
|
||||||
,{field: 'is_hot', title: '热门', templet: '#buttonHot'}
|
,{field: 'is_hot', title: '热门', templet: '#buttonHot'}
|
||||||
,{field: 'desc', title: '描述', minWidth: 100}
|
,{field: 'desc', title: '描述', minWidth: 100}
|
||||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#layuiadmin-app-cont-tagsbar'}
|
,{title: '操作', width: 100, align: 'center', toolbar: '#layuiadmin-app-cont-tagsbar'}
|
||||||
]]
|
]]
|
||||||
,text: '对不起,加载出现异常!'
|
,text: '对不起,加载出现异常!'
|
||||||
});
|
});
|
||||||
@ -264,7 +268,7 @@ layui.define(['table', 'form'], function(exports){
|
|||||||
type: 2
|
type: 2
|
||||||
,title: '编辑分类'
|
,title: '编辑分类'
|
||||||
,content: forumTagsForm + '?id='+ data.id
|
,content: forumTagsForm + '?id='+ data.id
|
||||||
,area: ['450px', '300px']
|
,area: ['400px', '450px']
|
||||||
,btn: ['确定', '取消']
|
,btn: ['确定', '取消']
|
||||||
,yes: function(index, layero){
|
,yes: function(index, layero){
|
||||||
//获取iframe元素的值
|
//获取iframe元素的值
|
||||||
@ -272,6 +276,7 @@ layui.define(['table', 'form'], function(exports){
|
|||||||
,sort = othis.find('input[name="sort"]').val()
|
,sort = othis.find('input[name="sort"]').val()
|
||||||
,tags = othis.find('input[name="tags"]').val()
|
,tags = othis.find('input[name="tags"]').val()
|
||||||
,ename = othis.find('input[name="ename"]').val()
|
,ename = othis.find('input[name="ename"]').val()
|
||||||
|
,icon = othis.find('input[name="icon"]').val()
|
||||||
,desc = othis.find('input[name="desc"]').val();
|
,desc = othis.find('input[name="desc"]').val();
|
||||||
|
|
||||||
if(!tags.replace(/\s/g, '')) return;
|
if(!tags.replace(/\s/g, '')) return;
|
||||||
@ -279,7 +284,7 @@ layui.define(['table', 'form'], function(exports){
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:forumTagsForm,
|
url:forumTagsForm,
|
||||||
data:{"id":data.id,"sort":sort,"catename":tags,"ename":ename,"desc":desc},
|
data:{"id":data.id,"sort":sort,"catename":tags,"ename":ename,"icon":icon,"desc":desc},
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
@ -314,6 +319,7 @@ layui.define(['table', 'form'], function(exports){
|
|||||||
othis.find('input[name="sort"]').val(data.sort)
|
othis.find('input[name="sort"]').val(data.sort)
|
||||||
,othis.find('input[name="tags"]').val(data.tags)
|
,othis.find('input[name="tags"]').val(data.tags)
|
||||||
,othis.find('input[name="ename"]').val(data.ename)
|
,othis.find('input[name="ename"]').val(data.ename)
|
||||||
|
,othis.find('input[name="icon"]').val(data.icon)
|
||||||
,othis.find('input[name="desc"]').val(data.desc);
|
,othis.find('input[name="desc"]').val(data.desc);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -28,11 +28,11 @@ i{font-style: normal;}
|
|||||||
|
|
||||||
.site-menu{position: fixed; top: 0px; bottom: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; z-index: 10001; left: -300px; background-color: #fff; transition: all .3s;}
|
.site-menu{position: fixed; top: 0px; bottom: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; z-index: 10001; left: -300px; background-color: #fff; transition: all .3s;}
|
||||||
/* 头部伸缩菜单栏 */
|
/* 头部伸缩菜单栏 */
|
||||||
.site-tree-mobile-top{display: block!important; position: fixed; z-index: 16666668; top: 2px; left: 20px; width: 57px; height: 57px; line-height: 57px; border-radius: 2px; text-align: center; color: #fff;}
|
.site-tree-mobile-top{display: block!important; position: fixed; z-index: 16666668; top: 2px; left: 20px; width: 57px; height: 57px; line-height: 57px; border-radius: 2px; text-align: center; color: #e2e2e2;}
|
||||||
.site-home .site-tree-mobile-top{display: none!important;}
|
.site-home .site-tree-mobile-top{display: none!important;}
|
||||||
.site-mobile .site-tree-mobile-top{display: none !important;}
|
.site-mobile .site-tree-mobile-top{display: none !important;}
|
||||||
.site-mobile .site-menu{left: 0;}
|
.site-mobile .site-menu{left: 0;}
|
||||||
.site-mobile .site-mobile-shade-top{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 999;}
|
.site-mobile .site-mobile-shade-top{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;}
|
||||||
.site-tree-mobile-top i{font-size: 30px;}
|
.site-tree-mobile-top i{font-size: 30px;}
|
||||||
|
|
||||||
/* 底部伸缩菜单栏 */
|
/* 底部伸缩菜单栏 */
|
||||||
@ -730,7 +730,7 @@ body .fly-user-main{position: relative; min-height: 600px;}
|
|||||||
.site-tree-mobile-user{display: block!important; position: fixed; z-index: 100000; bottom: 20px; left: 10px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;}
|
.site-tree-mobile-user{display: block!important; position: fixed; z-index: 100000; bottom: 20px; left: 10px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;}
|
||||||
.site-mobile .site-tree-mobile-user{display: none !important;}
|
.site-mobile .site-tree-mobile-user{display: none !important;}
|
||||||
.site-mobile .fly-user-main>.layui-nav{left: 0;}
|
.site-mobile .fly-user-main>.layui-nav{left: 0;}
|
||||||
.site-mobile .site-mobile-shade-user{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;}
|
.site-mobile .site-mobile-shade-user{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 999;}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*前台公用样式*/
|
/*前台公用样式*/
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="site-mobile-shade-top"></div>
|
<div class="site-mobile-shade-top"></div>
|
||||||
|
|
||||||
<a class="fly-logo layui-hide-md" href="/" style="padding-left:35%;"><img src="{$sysInfo.logo}" alt="layui" width="135" height="37"></a>
|
<a class="fly-logo layui-hide-md" href="/" style="padding-left:32%;"><img src="{$sysInfo.logo}" alt="layui" width="135" height="37"></a>
|
||||||
<ul class="layui-nav fly-nav layui-hide-xs">
|
<ul class="layui-nav fly-nav layui-hide-xs">
|
||||||
{volist name="headlinks" id="vo"}
|
{volist name="headlinks" id="vo"}
|
||||||
<li class="layui-nav-item">
|
<li class="layui-nav-item">
|
||||||
@ -54,9 +54,9 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="layui-nav-item layui-hide-xs" >
|
<li class="layui-nav-item layui-hide-xs" >
|
||||||
<select name="language" style="width:50px;" lay-filter="language" lay-verify="" id="language">
|
<select name="language" style="width:50px;" lay-filter="language" lay-verify="" id="language">
|
||||||
<option value="cn" {if cookie('think_lang')=='zh-cn'} selected{/if} >简体</option>
|
<option value="cn" {if cookie('think_lang')=='zh-cn'} selected{/if} >{:lang('chinese')}</option>
|
||||||
<option value="tw" {if cookie('think_lang')=='zh-tw'} selected{/if} >繁体</option>
|
<option value="tw" {if cookie('think_lang')=='zh-tw'} selected{/if} >{:lang('tChinese')}</option>
|
||||||
<option value="en" {if cookie('think_lang')=='en-us'} selected{/if} >English</option>
|
<option value="en" {if cookie('think_lang')=='en-us'} selected{/if} >{:lang('english')}</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<!--li class="layui-nav-item layui-hide-xs">
|
<!--li class="layui-nav-item layui-hide-xs">
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
<a href="{:url('login/reg')}">{:lang('register')}</a>
|
<a href="{:url('login/reg')}">{:lang('register')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="layui-nav-item" >
|
<li class="layui-nav-item" >
|
||||||
<select name="language" style="width:50px;" lay-filter="language1" lay-verify="" id="language1">
|
<select name="language" style="width:100px;" lay-filter="language1" lay-verify="" id="language1">
|
||||||
<option value="cn" {if cookie('think_lang')=='zh-cn'} selected{/if} >简体</option>
|
<option value="cn" {if cookie('think_lang')=='zh-cn'} selected{/if} >{:lang('chinese')}</option>
|
||||||
<option value="tw" {if cookie('think_lang')=='zh-tw'} selected{/if} >繁体</option>
|
<option value="tw" {if cookie('think_lang')=='zh-tw'} selected{/if} >{:lang('tChinese')}</option>
|
||||||
<option value="en" {if cookie('think_lang')=='en-us'} selected{/if} >English</option>
|
<option value="en" {if cookie('think_lang')=='en-us'} selected{/if} >{:lang('english')}</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
@ -37,7 +37,7 @@
|
|||||||
{volist name="cateList" id="cate"}
|
{volist name="cateList" id="cate"}
|
||||||
<li {if condition="$cate.ename eq $Request.param.ename"} class="layui-this" {/if}>
|
<li {if condition="$cate.ename eq $Request.param.ename"} class="layui-this" {/if}>
|
||||||
<div class="layui-menu-body-title">
|
<div class="layui-menu-body-title">
|
||||||
<a href="{:url('article/cate',['ename' => $cate.ename])}">{:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename}
|
<a href="{:url('article/cate',['ename' => $cate.ename])}"><i class="layui-icon {$cate.icon}"></i> {:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename}
|
||||||
<span class="layui-font-12 layui-font-gray">>> {$cate.ename}</span>
|
<span class="layui-font-12 layui-font-gray">>> {$cate.ename}</span>
|
||||||
{if condition="$cate.is_hot eq 1"}<span class="layui-badge-dot"></span>{/if}
|
{if condition="$cate.is_hot eq 1"}<span class="layui-badge-dot"></span>{/if}
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user