模板文件目录更改
This commit is contained in:
88
view/admin/config/edit.html
Normal file
88
view/admin/config/edit.html
Normal file
@@ -0,0 +1,88 @@
|
||||
{extend name="admin/base"/}
|
||||
{block name="body"}
|
||||
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>配置管理</h2>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<form method="post" class="form form-horizontal" role="ajax">
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">配置标识</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" style="width: 400px" name="name" value="{$info.name|default=''}">
|
||||
<span class="help-block">(用于config函数调用,只能使用英文且不能重复)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">配置标题</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" style="width:400px;" name="title" value="{$info.title|default=''}">
|
||||
<span class="help-block">(用于后台显示的配置标题)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">排序</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" style="width: 400px" name="sort" value="{$info.sort|default=0}">
|
||||
<span class="help-block">(用于分组显示的顺序)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">配置类型</label>
|
||||
<div class="col-lg-10">
|
||||
<select name="type" class="form-control" style="width:auto;">
|
||||
{volist name="config['config_type_list']" id="type"}
|
||||
<option value="{$key}" {if isset($info['type']) && $info['type'] == $key}selected{/if}>{$type}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
<span class="help-block">(系统会根据不同类型解析配置值)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">配置分组</label>
|
||||
<div class="col-lg-10">
|
||||
<select name="group" class="form-control" style="width: auto">
|
||||
<option value="0">不分组</option>
|
||||
{volist name="config['config_group_list']" id="group"}
|
||||
<option value="{$key}" {if isset($info['group']) && $info['group'] == $key}selected{/if}>{$group}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
<span class="help-block">(配置分组 用于批量设置 不分组则不会显示在系统设置中)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">配置值</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea name="value" class="form-control" style="width: 80%;height: 120px">{$info.value|default=''}</textarea>
|
||||
<span class="help-block">(配置值)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">配置项</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea name="extra" class="form-control" style="width: 80%;height: 120px">{$info.extra|default=''}</textarea>
|
||||
<span class="help-block">(如果是枚举型 需要配置该项)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">说明</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea name="remark" class="form-control" style="width: 80%;height: 120px">{$info.remark|default=''}</textarea>
|
||||
<span class="help-block">(配置详细说明)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<input type="hidden" name="id" value="{$info.id|default=''}">
|
||||
<button class="btn btn-success submit-btn ajax-post" type="submit" target-form="form-horizontal">确 定</button>
|
||||
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
86
view/admin/config/group.html
Normal file
86
view/admin/config/group.html
Normal file
@@ -0,0 +1,86 @@
|
||||
{extend name="admin/base"/}
|
||||
{block name="body"}
|
||||
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>配置管理</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{:url('/admin/config/index')}" class="btn btn-primary">
|
||||
<i class="fa fa-list"></i>
|
||||
配置列表
|
||||
</a>
|
||||
<a href="{:url('/admin/config/add')}" class="btn btn-danger">
|
||||
<i class="fa fa-list"></i>
|
||||
添加配置
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
{volist name="config['config_group_list']" id="item"}
|
||||
<li {if condition="$key eq $id"}class="active"{/if}>
|
||||
<a href="{:url('/admin/config/group',array('id'=>$key))}">{$item}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="tab-home">
|
||||
<form method="post" class="form form-horizontal" role="ajax">
|
||||
{volist name="list" id="item"}
|
||||
<div class="form-group">
|
||||
<label for="inputEmail1" class="col-lg-2 control-label">{$item['title']}</label>
|
||||
<div class="col-lg-10">
|
||||
{switch name="item['type']"}
|
||||
{case value="text"}
|
||||
<input type="text" class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" value="{$item['value']}" placeholder="{$item['title']}" style="width:50%;">
|
||||
{/case}
|
||||
{case value="num"}
|
||||
<input type="text" class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" value="{$item['value']}" placeholder="{$item['title']}" style="width:30%;">
|
||||
{/case}
|
||||
{case value="string"}
|
||||
<input type="text" class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" value="{$item['value']}" placeholder="{$item['title']}" style="width:80%;">
|
||||
{/case}
|
||||
{case value="textarea"}
|
||||
<textarea class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" style="width:80%; height:120px;">{$item['value']}</textarea>
|
||||
{/case}
|
||||
{case value="select"}
|
||||
<select class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" data-toggle='cxselect' style="width:auto;">
|
||||
{volist name=":parse_config_attr($item['extra'])" id="vo"}
|
||||
<option value="{$key}" {eq name="item['value']" value="$key"}selected{/eq}>{$vo}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
{/case}
|
||||
{case value="bool"}
|
||||
<select class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" data-toggle='cxselect' style="width:auto;">
|
||||
{volist name=":parse_config_attr($item['extra'])" id="vo"}
|
||||
<option value="{$key}" {eq name="item['value']" value="$key"}selected{/eq}>{$vo}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
{/case}
|
||||
{case value="image"}
|
||||
{:widget('common/Form/showConfig',array($item,$item))}
|
||||
{/case}
|
||||
{/switch}
|
||||
{if condition="$item['remark']"}
|
||||
<span class="help-block">({$item['remark']})</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button type="submit" class="btn btn-success submit-btn ajax-post" target-form="form">确认提交</button>
|
||||
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
118
view/admin/config/index.html
Normal file
118
view/admin/config/index.html
Normal file
@@ -0,0 +1,118 @@
|
||||
{extend name="admin/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>{$meta_title|default="新功能"}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{:url('Config/group')}" class="btn btn-danger">
|
||||
<i class="fa fa-list"></i>
|
||||
配置管理
|
||||
</a>
|
||||
<a href="{:url('Config/add')}" class="btn btn-danger">
|
||||
<i class="fa fa-plus"></i>
|
||||
添加配置
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
<li {if condition="!$group_id"}class="active"{/if}><a href="{:url('/admin/config/index')}">全部</a></li>
|
||||
{volist name="config['config_group_list']" id="item"}
|
||||
<li {if condition="$group_id eq $key"}class="active"{/if}>
|
||||
<a href="{:url('/admin/config/index?group='.$key)}">{$item}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active">
|
||||
<div class="table-responsive clearfix">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="row-selected">
|
||||
<input class="checkbox check-all" type="checkbox">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>标题</th>
|
||||
<th>分组</th>
|
||||
<th>类型</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{notempty name="list"}
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item.id}"></td>
|
||||
<td>{$item.id}</td>
|
||||
<td><a href="{:url('edit?id='.$item['id'])}">{$item.name}</a></td>
|
||||
<td>{$item.title}</td>
|
||||
<td>{$config['config_group_list'][$item['group']]|default=''}</td>
|
||||
<td>{$item['type_text']}</td>
|
||||
<td>
|
||||
<a title="编辑" href="{:url('/admin/config/edit?id='.$item['id'])}">编辑</a>
|
||||
<a class="confirm ajax-get" title="删除" href="{:url('/admin/config/del?id='.$item['id'])}">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{else/}
|
||||
<td colspan="7" class="text-center"> aOh! 暂时还没有内容!</td>
|
||||
{/notempty}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{$page|raw}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
//搜索功能
|
||||
$("#search").click(function () {
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.search-form').find('input').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
|
||||
query = query.replace(/^&/g, '');
|
||||
if (url.indexOf('?') > 0) {
|
||||
url += '&' + query;
|
||||
} else {
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
//回车搜索
|
||||
$(".search-input").keyup(function (e) {
|
||||
if (e.keyCode === 13) {
|
||||
$("#search").click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//点击排序
|
||||
$('.list_sort').click(function () {
|
||||
var url = $(this).attr('url');
|
||||
var ids = $('.ids:checked');
|
||||
var param = '';
|
||||
if (ids.length > 0) {
|
||||
var str = new Array();
|
||||
ids.each(function () {
|
||||
str.push($(this).val());
|
||||
});
|
||||
param = str.join(',');
|
||||
}
|
||||
|
||||
if (url != undefined && url != '') {
|
||||
window.location.href = url + '/ids/' + param;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
67
view/admin/config/themes.html
Normal file
67
view/admin/config/themes.html
Normal file
@@ -0,0 +1,67 @@
|
||||
{extend name="admin/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>{$meta_title|default='新功能'}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<form method="post" class="form form-horizontal" action="edit" role="ajax">
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#pc" data-toggle="tab">PC端模板</a></li>
|
||||
<li><a href="#mobile" data-toggle="tab">移动端模板</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="pc">
|
||||
<div class="row">
|
||||
{volist name="list['pc']" id="item"}
|
||||
<div class="col-sm-4 col-md-3">
|
||||
<div class="thumbnail">
|
||||
<img src="{$item['img']}" alt="{$item['name']}" class="img-rounded">
|
||||
<div class="caption">
|
||||
<h4>{$item['name']}</h4>
|
||||
<p class="text-right">
|
||||
{if $pc == $item['id']}
|
||||
<button class="btn btn-danger btn-block" disabled>已启用</button>
|
||||
{else/}
|
||||
<a href="{:url('admin/config/setthemes?name=pc&id='.$item['id'])}" class="btn btn-primary btn-block ajax-get">启用</a>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="mobile">
|
||||
<div class="row">
|
||||
{volist name="list['mobile']" id="item"}
|
||||
<div class="col-sm-4 col-md-3">
|
||||
<div class="thumbnail">
|
||||
<img src="{$item['img']}" alt="{$item['name']}" class="img-rounded">
|
||||
<div class="caption">
|
||||
<h4>{$item['name']}</h4>
|
||||
<p class="text-right">
|
||||
{if $mobile == $item['id']}
|
||||
<button class="btn btn-danger btn-block" disabled>已启用</button>
|
||||
{else/}
|
||||
<a href="{:url('admin/config/setthemes?name=mobile&id='.$item['id'])}" class="btn btn-primary btn-block ajax-get">启用</a>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
Reference in New Issue
Block a user