Commit f680f668 authored by ms-dev's avatar ms-dev

模版管理bug修复

parent 4cc72690
......@@ -291,7 +291,7 @@ public class TempletsAction extends BaseAction {
List<String> fileNameList = new ArrayList<String>();
for (int i = 0; i < files.length; i++) {
File currFile = files[i];
String filter = IParserRegexConstant.REGEX_SAVE_TEMPLATE+"/"+this.getAppId(request)+"/";
String filter = IParserRegexConstant.REGEX_SAVE_TEMPLATE+"/"+this.getAppId(request)+"/";
String temp = currFile.getPath().replace(this.getRealPath(request, ""),"").replace(filter, "");
filter = IParserRegexConstant.REGEX_SAVE_TEMPLATE+"\\"+this.getAppId(request)+"\\";
temp = temp.replace(filter, "");
......@@ -305,8 +305,7 @@ public class TempletsAction extends BaseAction {
model.addAttribute("fileNameList", folderNameList);
}
String uploadFileUrl = skinFolderName;
uploadFileUrl = uploadFileUrl.replace(File.separator + File.separator , File.separator );
model.addAttribute("uploadFileUrl", uploadFileUrl);
model.addAttribute("uploadFileUrl", uploadFileUrl+File.separator);
model.addAttribute("websiteId", managerSession.getBasicId());
return "/manager/cms/templets/templets_file_list";
}
......@@ -341,7 +340,7 @@ public class TempletsAction extends BaseAction {
int pageNo = 1;
ManagerSessionEntity managerSession = getManagerBySession(request);
String fileName = request.getParameter("fileName");
FileUtil.delFile(this.getRealPath(request, fileName));
FileUtil.delFile(this.getRealPath(request, IParserRegexConstant.REGEX_SAVE_TEMPLATE + File.separator + managerSession.getBasicId() + File.separator +fileName));
// 判断当前页码
this.getHistoryPageNoByCookie(request);
return pageNo;
......
......@@ -12,8 +12,8 @@
<@ms.checkbox name="appMobileStyle" width="200" list=[{"id":"m","value":"启用"}] listKey="id" listValue="value" valueList=["${app.appMobileStyle!('')}"] label="启用移动端"
help="启用后手机用户访问网站会显示手机版网页,前提是网站必需提供移动端皮肤,相关教程:<a href='http://ms.ming-soft.com/mbbs/13086/detail.do' target='_blank'>铭飞移动端开发教程</a>"/>
<@ms.textarea name="appUrl" label="域 名" width="400" rows="4" value="${app.appUrl?default('')}"
placeholder="使用回车换行可以输入多个域名地址,必须要加http:// 域名不要以/\\符号结尾"
help="多个域名回车换行显示,必须以http[s]://打头,域名不要以/\\符号结尾<br/>例如:<br/>http://www.a.com <br/> http://a.com "
placeholder="使用回车换行可以输入多个域名地址,必须要加http:// 域名不要以\\符号结尾"
help="多个域名回车换行显示,必须以http[s]://打头,<br/>例如:http://www.a.com <br/> http://a.com 域名不要以/\\符号结尾"
validation={"maxlength":"150","required":"true","data-bv-notempty-message":"必填项目", "data-bv-stringlength-message":"长度在150个字符以内!"} />
<@ms.select name="appStyle" width="300" id="appStyle" label="模板风格" />
<@ms.textarea name="appKeyword" label="关键字" width="700" value="${app.appKeyword?default('')}" rows="4" placeholder="请输入关键字"/>
......
<@ms.html5>
<@ms.nav title="文件列表"></@ms.nav>
<@ms.panel>
<@ms.uploadFile path="${uploadFileUrl}" inputName="file" size="20" filetype="*.htm;*.html;*.jpg;*.gif;*.png;*.css;*.js;*.ico;*.swf" msg="建议上传5M以下htm/html/css/js/jpg/gif/png/swf文件" maxSize="5" callBack="test" isRename="false"/>
<@ms.uploadFile path="${uploadFileUrl}" inputName="file" size="20" filetype="*.htm;*.html;*.jpg;*.gif;*.png;*.css;*.js;*.ico;*.swf" msg="建议上传5M以下htm/html/css/js/jpg/gif/png/swf文件" maxSize="5" callBack="refresh" isRename="false"/>
<@ms.table head=['<th class="text-center">图标</th>','模板名称',"<th style='width:20%;text-align:center'>类型</th>","<th class='text-center' style='width:10%;'>操作</th>"]>
......@@ -50,17 +50,11 @@
var skinFolderName = "${uploadFileUrl?replace("\\","/")}";
var interval;
function run() {
interval = setInterval(chat, "1000");
}
function test(e){
isSuccess = true;
fileUrl = e;
alert("模版文件上传成功 ");
function refresh(e){
alert("上传成功");
location.reload();
}
function chat() {
if(isSuccess){
clearTimeout(interval); //关闭定时器
var temp = $(".deleteIcon").attr("data-title");
if(temp == null || temp == ""){
temp = $(".editFileBtn").attr("data-title");
......@@ -87,7 +81,6 @@
} else {
location.href="${base}/manager/cms/templet/showChildFileAndFolder.do?skinFolderName="+temp;
}
}
}
//删除模版文件
......@@ -98,8 +91,7 @@
$(this).request({url:URL,data:DATA,type:"json",method:"post",func:function(msg) {
if(msg != 0) {
alert("删除模版文件成功");
fileName = fileName.substring(0,fileName.lastIndexOf("/"));
location.href = base+"/manager/cms/templet/showChildFileAndFolder.do?skinFolderName="+fileName;
location.reload();
} else {
alert("删除模版文件失败");
}
......@@ -109,7 +101,6 @@
$(function () {
//加载页面时启动定时器
run();
//若为文件夹,则左侧显示文件夹图标;若为文件,则左侧显示文件图标,且稍向右偏移
$(".name").each(function(i){
......
......@@ -41,10 +41,10 @@ method:提交方式
});
</#if>
//$("#${name} .form-group>div.radio").siblings("i.form-control-feedback").clone().prependTo($("#${name} .form-group>div.radio"));
//$("#${name} .form-group>div.radio").siblings("i.form-control-feedback").remove();
<#if !class?has_content>
$("#${name} .form-group>label").removeClass("col-sm-2");
$("#${name} .form-group>div").removeClass("col-sm-9");
var width = $("#${name} .form-group>div.ms-from-group-input").width();
......@@ -53,7 +53,15 @@ method:提交方式
//$("#${name} .form-group label").removeClass("checkbox-inline").removeClass("radio-inline");
//$("#${name} .has-feedback .form-control-feedback").css({top:"25px"});
<#elseif class?index_of("searchForm") gt -1>
$("#${name} .form-group>label").removeClass("col-sm-3");
$("#${name} .form-group>div").removeClass("col-sm-9");
$("#${name} .form-group>label").addClass("col-sm-4");
$("#${name} .form-group>div").addClass("col-sm-8");
$("#${name} .ms-form-group").addClass("col-sm-4");
$("#${name}").show();
</#if>
})
</script>
......@@ -63,13 +71,13 @@ method:提交方式
<#macro searchForm name id="" target=""
action="" method="post" enctype=""
class="searchForm form-inline" style="display:none; background-color: white;" isvalidation=false tooltip=true >
<@ms.form name="${name}" id="${id}" action="${action}" style="background-color: white;" isvalidation=true class="${class}" tooltip=true>
<@ms.form name="${name}" id="${id}" action="${action}" style="display:none;background-color: white;" isvalidation=true class="${class}" tooltip=true>
<#nested/><#rt/>
</@ms.form>
</#macro>
<#macro searchFormButton close="">
<div class="bottom">
<div class="bottom" style="clear:both">
<!--div class="close">close</div-->
<@ms.resetButton/>
<#nested/><#rt/>
......
<@ms.html5>
<@ms.nav title="用户管理" back=true></@ms.nav>
<@ms.panel>
<@ms.searchForm name="searchForm" id="searchForm" action="${basePath}/manager/people/user/list.do">
<@ms.text label="昵称" width="150" name="peopleUserNickName" title="请输入用户昵称" placeholder="请输入用户昵称" value="${peopleUserNickName?default('')}" />
<@ms.text label="真实姓名" width="150" name="peopleUserRealName" title="请输入用户昵称" placeholder="请输入用户昵称" value="${peopleUserRealName?default('')}" />
<@ms.searchForm name="searchForm" id="searchForm" action="${basePath}/manager/people/user/list.do">
<@ms.text label="昵称" name="peopleUserNickName" title="请输入用户昵称" placeholder="请输入用户昵称" value="${peopleUserNickName?default('')}" />
<@ms.text label="真实姓名" name="peopleUserRealName" title="请输入用户昵称" placeholder="请输入用户昵称" value="${peopleUserRealName?default('')}" />
<#assign status=[{"id":"1","name":"男"},{"id":"2","name":"女"}]>
<@ms.select label="性别" list=status listValue="name" listKey="id" width="150" name="peopleUserSex" default="全部" />
<@ms.select label="性别" list=status listValue="name" listKey="id" name="peopleUserSex" default="全部" />
<#assign status=[{"id":"0","name":"未审核"},{"id":"1","name":"已审核"}]>
<@ms.select label="审核状态" list=status listValue="name" listKey="id" width="150" name="peopleState" default="全部" />
<@ms.date label="注册时间" name="peopleDateTime" width="150" value="${peopleDateTime?default('')}" readonly="readonly" />
<@ms.select label="审核状态" list=status listValue="name" listKey="id" name="peopleState" default="全部" />
<@ms.date label="注册时间" name="peopleDateTime" value="${peopleDateTime?default('')}" readonly="readonly" />
<@ms.searchFormButton>
<@ms.queryButton id="submitSearch"/>
</@ms.searchFormButton>
......@@ -285,4 +285,4 @@
alert("请选择用户!");
}
}
</script>
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment