2018-07-17 19:13:11 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="zh-CN">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
2021-04-19 11:24:12 +08:00
|
|
|
<title>{{i18n .Lang "blog.blog_setting"}} - Powered by MinDoc</title>
|
2018-07-17 19:13:11 +08:00
|
|
|
|
|
|
|
<!-- Bootstrap -->
|
|
|
|
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
|
|
|
|
<link href="{{cdncss "/static/font-awesome/css/font-awesome.min.css"}}" rel="stylesheet">
|
2018-08-15 15:33:22 +08:00
|
|
|
<link href="{{cdncss "/static/css/main.css" "version"}}" rel="stylesheet">
|
2018-07-17 19:13:11 +08:00
|
|
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
|
|
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<script src="/static/html5shiv/3.7.3/html5shiv.min.js"></script>
|
|
|
|
<script src="/static/respond.js/1.4.2/respond.min.js"></script>
|
|
|
|
<![endif]-->
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="manual-reader">
|
2024-07-04 09:43:33 +08:00
|
|
|
{{template "widgets/header.tpl" .}}
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="container manual-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="page-left">
|
|
|
|
<ul class="menu">
|
2021-04-21 20:44:19 +08:00
|
|
|
<li {{if eq .ControllerName "BookController"}}class="active"{{end}}><a href="{{urlfor "BookController.Index"}}" class="item"><i class="fa fa-sitemap" aria-hidden="true"></i> {{i18n .Lang "common.my_project"}}</a> </li>
|
|
|
|
<li {{if eq .ControllerName "BlogController"}}class="active"{{end}}><a href="{{urlfor "BlogController.ManageList"}}" class="item"><i class="fa fa-file" aria-hidden="true"></i> {{i18n .Lang "common.my_blog"}}</a> </li>
|
2018-07-17 19:13:11 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="page-right">
|
|
|
|
<div class="m-box">
|
|
|
|
<div class="box-head">
|
2021-04-19 11:24:12 +08:00
|
|
|
<strong class="box-title"> {{i18n .Lang "blog.blog_setting"}}</strong>
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<form method="post" id="gloablEditForm" action="{{urlfor "BlogController.ManageSetting"}}">
|
|
|
|
<input type="hidden" name="id" id="blogId" value="{{.Model.BlogId}}">
|
|
|
|
<input type="hidden" name="identify" value="{{.Model.BlogIdentify}}">
|
2018-07-18 17:10:24 +08:00
|
|
|
<input type="hidden" name="document_id" value="{{.Model.DocumentId}}">
|
|
|
|
<input type="hidden" name="order_index" value="{{.Model.OrderIndex}}">
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="form-group">
|
2021-04-19 11:24:12 +08:00
|
|
|
<label>{{i18n .Lang "blog.title"}}</label>
|
|
|
|
<input type="text" class="form-control" name="title" id="title" placeholder="{{i18n .Lang "blog.title"}}" value="{{.Model.BlogTitle}}">
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
2021-04-19 11:24:12 +08:00
|
|
|
<label>{{i18n .Lang "blog.type"}}</label>
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="radio">
|
|
|
|
<label class="radio-inline">
|
2021-04-19 11:24:12 +08:00
|
|
|
<input type="radio" {{if eq .Model.BlogType 0}}checked{{end}} name="blog_type" value="0">{{i18n .Lang "blog.normal_blog"}}<span class="text"></span>
|
2018-07-17 19:13:11 +08:00
|
|
|
</label>
|
|
|
|
<label class="radio-inline">
|
2021-04-19 11:24:12 +08:00
|
|
|
<input type="radio" {{if eq .Model.BlogType 1}}checked{{end}} name="blog_type" value="1">{{i18n .Lang "blog.link_blog"}}<span class="text"></span>
|
2018-07-17 19:13:11 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group" id="blogLinkDocument"{{if ne .Model.BlogType 1}} style="display: none;" {{end}}>
|
2021-04-19 11:24:12 +08:00
|
|
|
<label>{{i18n .Lang "blog.ref_doc"}}</label>
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
2021-04-19 11:24:12 +08:00
|
|
|
<input type="text" class="form-control" placeholder="{{i18n .Lang "message.input_proj_id_pls"}}" name="bookIdentify" value="{{.Model.BookIdentify}}">
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
2021-04-19 11:24:12 +08:00
|
|
|
<input type="text" class="form-control" placeholder="{{i18n .Lang "message.input_doc_id_pls"}}" name="documentIdentify" value="{{.Model.DocumentIdentify}}">
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-18 17:10:24 +08:00
|
|
|
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-19 11:24:12 +08:00
|
|
|
<label>{{i18n .Lang "blog.blog_status"}}</label>
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="radio">
|
|
|
|
<label class="radio-inline">
|
2021-04-19 11:24:12 +08:00
|
|
|
<input type="radio" {{if eq .Model.BlogStatus "public"}}checked{{end}} name="status" value="public">{{i18n .Lang "blog.public"}}<span class="text"></span>
|
2018-07-17 19:13:11 +08:00
|
|
|
</label>
|
|
|
|
<label class="radio-inline">
|
2021-04-19 11:24:12 +08:00
|
|
|
<input type="radio" {{if eq .Model.BlogStatus "password"}}checked{{end}} name="status" value="password">{{i18n .Lang "blog.encryption"}}<span class="text"></span>
|
2018-07-17 19:13:11 +08:00
|
|
|
</label>
|
2024-07-24 09:20:06 +08:00
|
|
|
<label class="radio-inline">
|
|
|
|
<input type="radio" {{if eq .Model.BlogStatus "private"}}checked{{end}} name="status" value="private">{{i18n .Lang "blog.private"}}<span class="text"></span>
|
|
|
|
</label>
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-24 09:20:06 +08:00
|
|
|
<div class="form-group"{{if ne .Model.BlogStatus "password"}} style="display: none;"{{end}} id="blogPassword">
|
2021-04-19 11:24:12 +08:00
|
|
|
<label>{{i18n .Lang "blog.blog_pwd"}}</label>
|
|
|
|
<input type="password" class="form-control" name="password" id="password" placeholder="{{i18n .Lang "blog.blog_pwd"}}" value="{{.Model.Password}}" maxlength="20">
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-19 11:24:12 +08:00
|
|
|
<label>{{i18n .Lang "blog.blog_digest"}}</label>
|
|
|
|
<textarea rows="3" class="form-control" name="excerpt" style="height: 90px" placeholder="{{i18n .Lang "blog.blog_digest"}}">{{.Model.BlogExcerpt}}</textarea>
|
|
|
|
<p class="text">{{i18n .Lang "message.blog_digest_tips"}}</p>
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2021-04-19 11:24:12 +08:00
|
|
|
<button type="submit" id="btnSaveBlogInfo" class="btn btn-success" data-loading-text="{{i18n .Lang "message.processing"}}">{{i18n .Lang "common.save"}}</button>
|
|
|
|
<a href="{{.Referer}}" title="{{i18n .Lang "doc.backward"}}" class="btn btn-info">{{i18n .Lang "doc.backward"}}</a>
|
2018-07-17 19:13:11 +08:00
|
|
|
<span id="form-error-message" class="error-message"></span>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-04 09:43:33 +08:00
|
|
|
{{template "widgets/footer.tpl" .}}
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="{{cdnjs "/static/jquery/1.12.4/jquery.min.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/bootstrap/js/bootstrap.min.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/js/jquery.form.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/js/main.js"}}" type="text/javascript"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
2024-07-04 09:43:33 +08:00
|
|
|
const blogId = Number($("#blogId").val());
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#gloablEditForm").ajaxForm({
|
|
|
|
beforeSubmit : function () {
|
|
|
|
var title = $.trim($("#title").val());
|
|
|
|
|
|
|
|
if (title === ""){
|
2021-04-19 11:24:12 +08:00
|
|
|
return showError("{{i18n .Lang "message.blog_title_empty"}}");
|
2018-07-17 19:13:11 +08:00
|
|
|
}
|
|
|
|
$("#btnSaveBlogInfo").button("loading");
|
|
|
|
},success : function ($res) {
|
|
|
|
if($res.errcode === 0) {
|
2021-04-19 11:24:12 +08:00
|
|
|
showSuccess("{{i18n .Lang "message.success"}}");
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#blogId").val($res.data.blog_id);
|
2024-07-04 09:43:33 +08:00
|
|
|
if (blogId === 0) {
|
|
|
|
// 优化新增文章后直接跳转到编辑页面
|
|
|
|
window.location.href = {{urlfor "BlogController.ManageEdit" ":id" "xxx"}}.replace("xxx", $res.data.blog_id)
|
|
|
|
}
|
2018-07-17 19:13:11 +08:00
|
|
|
}else{
|
|
|
|
showError($res.message);
|
|
|
|
}
|
|
|
|
$("#btnSaveBlogInfo").button("reset");
|
|
|
|
}, error : function () {
|
2021-04-19 11:24:12 +08:00
|
|
|
showError("{{i18n .Lang "message.system_error"}}");
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#btnSaveBlogInfo").button("reset");
|
|
|
|
}
|
|
|
|
}).find("input[name='status']").change(function () {
|
2024-07-04 09:43:33 +08:00
|
|
|
var $status = $(this).val();
|
|
|
|
if($status === "password"){
|
|
|
|
$("#blogPassword").show();
|
|
|
|
}else{
|
|
|
|
$("#blogPassword").hide();
|
|
|
|
}
|
2018-07-17 19:13:11 +08:00
|
|
|
});
|
|
|
|
$("#gloablEditForm").find("input[name='blog_type']").change(function () {
|
|
|
|
var $link = $(this).val();
|
|
|
|
if($link == 1){
|
|
|
|
$("#blogLinkDocument").show();
|
|
|
|
}else{
|
|
|
|
$("#blogLinkDocument").hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|