Skip to content

Commit

Permalink
更改主题设置代码结构
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby committed Oct 11, 2018
1 parent 5e06168 commit 825b15a
Showing 1 changed file with 3 additions and 103 deletions.
106 changes: 3 additions & 103 deletions module/options.ftl
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="/static/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/plugins/toast/css/jquery.toast.min.css">
<link rel="stylesheet" href="/static/css/AdminLTE.min.css">
<style>
.themeSetting,.themeImg{
padding-top: 15px;
padding-bottom: 15px;
}
.form-horizontal .control-label{
text-align: left;
}
</style>
</head>
<body>
<#import "/common/macro/theme_option_marco.ftl" as option>
<@option.head />
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 themeImg">
Expand Down Expand Up @@ -206,86 +188,4 @@
</div>
</div>
</div>
</body>
<script src="/static/plugins/jquery/jquery.min.js"></script>
<script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/plugins/toast/js/jquery.toast.min.js"></script>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/js/app.js"></script>
<script>
function saveThemeOptions(option) {
var param = $('#'+option).serialize();
$.ajax({
type: 'post',
url: '/admin/option/save',
data: param,
success: function (data) {
if(data.code==1){
showMsg(data.msg,"success",1000);
}else{
showMsg(data.msg,"error",1000);
}
}
});
}
function openAttach(id) {
layer.open({
type: 2,
title: '所有附件',
shadeClose: true,
shade: 0.5,
area: ['90%', '90%'],
content: '/admin/attachments/select?id='+id,
scrollbar: false
});
}
/**
* 更新主题
*/
function updateTheme(theme,e) {
$(e).button('loading');
$.ajax({
type: 'get',
url: '/admin/themes/pull',
data: {
'themeName': theme
},
success: function (data) {
if (data.code == 1) {
$.toast({
text: data.msg,
heading: '提示',
icon: 'success',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff',
afterHidden: function () {
parent.location.href = "/admin/themes";
}
});
} else {
$.toast({
text: data.msg,
heading: '提示',
icon: 'error',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 2000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff'
});
$(e).button('reset');
}
}
});
}
</script>
</html>
<@option.import_js />

0 comments on commit 825b15a

Please sign in to comment.