2018-07-13 19:04:51 +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 "common.my_blog"}} - Powered by MinDoc</title>
|
2018-07-13 19:04:51 +08:00
|
|
|
|
|
|
|
<!-- Bootstrap -->
|
|
|
|
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet" type="text/css">
|
|
|
|
<link href="{{cdncss "/static/font-awesome/css/font-awesome.min.css"}}" rel="stylesheet" type="text/css">
|
|
|
|
<link href="{{cdncss "/static/bootstrap/plugins/bootstrap-fileinput/4.4.7/css/fileinput.min.css"}}" rel="stylesheet" type="text/css">
|
|
|
|
<link href="{{cdncss "/static/bootstrap/plugins/bootstrap-fileinput/4.4.7/themes/explorer-fa/theme.css"}}" rel="stylesheet" type="text/css">
|
2018-08-15 15:33:22 +08:00
|
|
|
<link href="{{cdncss "/static/css/main.css" "version"}}" rel="stylesheet">
|
2018-07-13 19:04:51 +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">
|
|
|
|
{{template "widgets/header.tpl" .}}
|
|
|
|
<div class="container manual-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="page-left">
|
|
|
|
<ul class="menu">
|
2021-04-19 11:24:12 +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-13 19:04:51 +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_list"}}</strong>
|
2018-07-13 19:04:51 +08:00
|
|
|
|
2021-04-19 11:24:12 +08:00
|
|
|
<a href="{{urlfor "BlogController.ManageSetting"}}" class="btn btn-success btn-sm pull-right">{{i18n .Lang "blog.add_blog"}}</a>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="box-body" id="blogList">
|
|
|
|
<div class="ui items">
|
|
|
|
{{range $index,$item := .ModelList}}
|
|
|
|
<div class="item blog-item">
|
|
|
|
<div class="content">
|
|
|
|
<a class="header" href="{{urlfor "BlogController.Index" ":id" $item.BlogId}}" target="_blank">
|
|
|
|
{{if eq $item.BlogStatus "password"}}
|
2021-04-19 11:24:12 +08:00
|
|
|
<div class="ui teal label horizontal" data-tooltip="{{i18n $.Lang "blog.encryption"}}">{{i18n $.Lang "blog.encrypt"}}</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
{{end}}
|
|
|
|
{{$item.BlogTitle}}
|
|
|
|
</a>
|
|
|
|
<div class="description">
|
|
|
|
<p class="line-clamp">{{$item.BlogExcerpt}} </p>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="extra">
|
|
|
|
<div>
|
|
|
|
<div class="ui horizontal small list">
|
|
|
|
<div class="item"><i class="fa fa-clock-o"></i> {{date $item.Modified "Y-m-d H:i:s"}}</div>
|
2021-04-19 11:24:12 +08:00
|
|
|
<div class="item"><a href="{{urlfor "BlogController.ManageEdit" ":id" $item.BlogId}}" title="{{i18n $.Lang "blog.edit_blog"}}" target="_blank"><i class="fa fa-edit"></i> {{i18n $.Lang "blog.edit"}}</a></div>
|
|
|
|
<div class="item"><a class="delete-btn" title="{{i18n $.Lang "blog.delete_blog"}}" data-id="{{$item.BlogId}}"><i class="fa fa-trash"></i> {{i18n $.Lang "blog.delete"}}</a></div>
|
|
|
|
<div class="item"><a href="{{urlfor "BlogController.ManageSetting" ":id" $item.BlogId}}" title="{{i18n $.Lang "blog.setting_blog"}}" class="setting-btn"><i class="fa fa-gear"></i> {{i18n $.Lang "common.setting"}}</a></div>
|
2018-07-17 19:13:11 +08:00
|
|
|
</div>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
{{else}}
|
2021-04-19 11:24:12 +08:00
|
|
|
<div class="text-center">{{i18n .Lang "blog.no_blog"}}</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
{{end}}
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
<nav class="pagination-container">
|
2018-07-13 19:04:51 +08:00
|
|
|
{{.PageHtml}}
|
2018-07-17 19:13:11 +08:00
|
|
|
</nav>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{template "widgets/footer.tpl" .}}
|
|
|
|
</div>
|
2018-07-17 19:13:11 +08:00
|
|
|
|
2018-07-13 19:04:51 +08:00
|
|
|
|
|
|
|
<!-- Delete Book Modal -->
|
2018-07-17 19:13:11 +08:00
|
|
|
<div class="modal fade" id="deleteBlogModal" tabindex="-1" role="dialog" aria-labelledby="deleteBlogModalLabel">
|
2018-07-13 19:04:51 +08:00
|
|
|
<div class="modal-dialog" role="document">
|
2018-07-17 19:13:11 +08:00
|
|
|
<form method="post" id="deleteBlogForm" action="{{urlfor "BlogController.ManageDelete"}}">
|
|
|
|
<input type="hidden" name="blog_id" value="">
|
2018-07-13 19:04:51 +08:00
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
2021-04-19 11:24:12 +08:00
|
|
|
<h4 class="modal-title">{{i18n .Lang "blog.delete_blog"}}</h4>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2021-04-19 11:24:12 +08:00
|
|
|
<span style="font-size: 14px;font-weight: 400;">{{i18n .Lang "message.confirm_delete_blog"}}</span>
|
2018-07-13 19:04:51 +08:00
|
|
|
<p></p>
|
2021-04-19 11:24:12 +08:00
|
|
|
<p class="text error-message">{{i18n .Lang "message.delete_blog_tips"}}</p>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<span id="form-error-message2" class="error-message"></span>
|
2021-04-19 11:24:12 +08:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{i18n .Lang "common.cancel"}}</button>
|
|
|
|
<button type="submit" id="btnDeleteBlog" class="btn btn-primary" data-loading-text="{{i18n .Lang "message.process"}}">{{i18n .Lang "common.confirm_delete"}}</button>
|
2018-07-13 19:04:51 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</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/vuejs/vue.min.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/js/jquery.form.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/bootstrap/plugins/bootstrap-fileinput/4.4.7/js/fileinput.min.js"}}"></script>
|
|
|
|
<script src="{{cdnjs "/static/bootstrap/plugins/bootstrap-fileinput/4.4.7/js/locales/zh.js"}}"></script>
|
|
|
|
<script src="{{cdnjs "/static/layer/layer.js"}}" type="text/javascript" ></script>
|
|
|
|
<script src="{{cdnjs "/static/js/main.js"}}" type="text/javascript"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除项目
|
|
|
|
*/
|
2018-07-17 19:13:11 +08:00
|
|
|
function deleteBlog($id) {
|
|
|
|
$("#deleteBlogModal").find("input[name='blog_id']").val($id);
|
|
|
|
$("#deleteBlogModal").modal("show");
|
2018-07-13 19:04:51 +08:00
|
|
|
}
|
|
|
|
function copyBook($id){
|
|
|
|
var index = layer.load()
|
|
|
|
$.ajax({
|
|
|
|
url : "{{urlfor "BookController.Copy"}}" ,
|
|
|
|
data : {"identify":$id},
|
|
|
|
type : "POST",
|
|
|
|
dataType : "json",
|
|
|
|
success : function ($res) {
|
|
|
|
layer.close(index);
|
|
|
|
if ($res.errcode === 0) {
|
|
|
|
window.app.lists.splice(0, 0, $res.data);
|
|
|
|
$("#addBookDialogModal").modal("hide");
|
|
|
|
} else {
|
|
|
|
layer.msg($res.message);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error : function () {
|
|
|
|
layer.close(index);
|
2021-04-19 11:24:12 +08:00
|
|
|
layer.msg({{i18n .Lang "message.system_error"}});
|
2018-07-13 19:04:51 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#blogList .delete-btn").click(function () {
|
|
|
|
deleteBlog($(this).attr("data-id"));
|
2018-07-13 19:04:51 +08:00
|
|
|
});
|
|
|
|
/**
|
|
|
|
* 删除项目
|
|
|
|
*/
|
2018-07-19 15:52:24 +08:00
|
|
|
$("#deleteBlogForm").ajaxForm({
|
2018-07-13 19:04:51 +08:00
|
|
|
beforeSubmit : function () {
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#btnDeleteBlog").button("loading");
|
2018-07-13 19:04:51 +08:00
|
|
|
},
|
2018-07-17 19:13:11 +08:00
|
|
|
success : function ($res) {
|
|
|
|
if($res.errcode === 0){
|
2018-07-13 19:04:51 +08:00
|
|
|
window.location = window.location.href;
|
|
|
|
}else{
|
|
|
|
showError(res.message,"#form-error-message2");
|
|
|
|
}
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#btnDeleteBlog").button("reset");
|
2018-07-13 19:04:51 +08:00
|
|
|
},
|
|
|
|
error : function () {
|
2021-04-19 11:24:12 +08:00
|
|
|
showError({{i18n .Lang "message.system_error"}},"#form-error-message2");
|
2018-07-17 19:13:11 +08:00
|
|
|
$("#btnDeleteBlog").button("reset");
|
2018-07-13 19:04:51 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|