2017-04-24 18:25:17 +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-21 12:22:34 +08:00
|
|
|
<title>{{i18n .Lang "mgr.edit_proj"}} - Powered by MinDoc</title>
|
2017-04-24 18:25:17 +08:00
|
|
|
|
|
|
|
<!-- Bootstrap -->
|
2017-05-12 14:21:29 +08:00
|
|
|
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
|
2018-03-23 17:11:20 +08:00
|
|
|
<link href="{{cdncss "/static/bootstrap/plugins/tagsinput/bootstrap-tagsinput.css"}}" rel="stylesheet">
|
|
|
|
<link href="{{cdncss "/static/bootstrap/plugins/bootstrap-switch/css/bootstrap3//bootstrap-switch.min.css"}}" rel="stylesheet">
|
2017-05-12 14:21:29 +08:00
|
|
|
<link href="{{cdncss "/static/font-awesome/css/font-awesome.min.css"}}" rel="stylesheet">
|
|
|
|
<link href="{{cdncss "/static/webuploader/webuploader.css"}}" rel="stylesheet">
|
|
|
|
<link href="{{cdncss "/static/cropper/2.3.4/cropper.min.css"}}" rel="stylesheet">
|
2018-11-20 20:55:04 +08:00
|
|
|
<link href="{{cdncss "/static/select2/4.0.5/css/select2.min.css"}}" rel="stylesheet">
|
2018-08-15 15:33:22 +08:00
|
|
|
<link href="{{cdncss "/static/css/main.css" "version"}}" rel="stylesheet">
|
2017-04-24 18:25:17 +08:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="manual-reader">
|
|
|
|
{{template "widgets/header.tpl" .}}
|
|
|
|
<div class="container manual-body">
|
|
|
|
<div class="row">
|
2021-04-21 12:22:34 +08:00
|
|
|
{{template "manager/widgets.tpl" .}}
|
2017-04-24 18:25:17 +08:00
|
|
|
<div class="page-right">
|
|
|
|
<div class="m-box">
|
|
|
|
<div class="box-head">
|
2021-04-21 12:22:34 +08:00
|
|
|
<strong class="box-title"> {{i18n .Lang "blog.project_setting"}}</strong>
|
|
|
|
<button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#transferBookModal">{{i18n .Lang "blog.handover_project"}}</button>
|
2017-05-11 13:39:34 +08:00
|
|
|
{{if eq .Model.PrivatelyOwned 1}}
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#changePrivatelyOwnedModal" style="margin-right: 5px;">{{i18n .Lang "blog.make_public"}}</button>
|
2017-05-11 13:39:34 +08:00
|
|
|
{{else}}
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="button" class="btn btn-danger btn-sm pull-right" data-toggle="modal" data-target="#changePrivatelyOwnedModal" style="margin-right: 5px;">{{i18n .Lang "blog.make_private"}}</button>
|
2017-05-11 13:39:34 +08:00
|
|
|
{{end}}
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="button" class="btn btn-danger btn-sm pull-right" style="margin-right: 5px;" data-toggle="modal" data-target="#deleteBookModal">{{i18n .Lang "blog.delete_project"}}</button>
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-body" style="padding-right: 200px;">
|
|
|
|
<div class="form-left">
|
2018-03-23 17:11:20 +08:00
|
|
|
<form method="post" id="bookEditForm" action="{{urlfor "ManagerController.EditBook" ":key" .Model.Identify}}">
|
2017-04-25 20:05:59 +08:00
|
|
|
<input type="hidden" name="identify" value="{{.Model.Identify}}">
|
2017-04-24 18:25:17 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "mgr.proj_name"}}</label>
|
|
|
|
<input type="text" class="form-control" name="book_name" id="bookName" placeholder="{{i18n .Lang "mgr.proj_name"}}" value="{{.Model.BookName}}">
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.project_id"}}</label>
|
|
|
|
<input type="text" class="form-control" value="{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" disabled placeholder="{{i18n .Lang "blog.project_id"}}">
|
2017-05-05 15:04:31 +08:00
|
|
|
</div>
|
2018-11-20 20:55:04 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "common.project_space"}}</label>
|
2018-11-20 20:55:04 +08:00
|
|
|
<select class="js-data-example-ajax form-control" multiple="multiple" name="itemId">
|
|
|
|
<option value="{{.Model.ItemId}}" selected="selected">{{.Model.ItemName}}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2018-03-23 17:11:20 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.history_record_amount"}}</label>
|
|
|
|
<input type="text" class="form-control" name="history_count" value="{{.Model.HistoryCount}}" placeholder="{{i18n .Lang "blog.history_record_amount"}}">
|
|
|
|
<p class="text">{{i18n .Lang "message.history_record_amount_desc"}}</p>
|
2018-03-23 17:11:20 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.corp_id"}}</label>
|
|
|
|
<input type="text" class="form-control" name="publisher" value="{{.Model.Publisher}}" placeholder="{{i18n $.Lang "blog.corp_id"}}">
|
|
|
|
<p class="text">{{i18n .Lang "message.corp_id_desc"}}</p>
|
2018-03-23 17:11:20 +08:00
|
|
|
</div>
|
2017-05-05 15:04:31 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.project_order"}}</label>
|
|
|
|
<input type="number" min="0" class="form-control" value="{{.Model.OrderIndex}}" name="order_index" placeholder="{{i18n .Lang "blog.project_order"}}">
|
|
|
|
<p class="text">{{i18n .Lang "message.project_order_desc"}}</p>
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.project_desc"}}</label>
|
|
|
|
<textarea rows="3" class="form-control" name="description" style="height: 90px" placeholder="{{i18n .Lang "blog.project_desc"}}">{{.Model.Description}}</textarea>
|
|
|
|
<p class="text">{{i18n .Lang "message.project_desc_placeholder"}}</p>
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
2017-05-05 15:04:31 +08:00
|
|
|
|
2017-04-24 18:25:17 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.project_label"}}</label>
|
|
|
|
<input type="text" class="form-control" name="label" placeholder="{{i18n .Lang "blog.project_label"}}" value="{{.Model.Label}}">
|
|
|
|
<p class="text">{{i18n .Lang "message.project_label_desc"}}</p>
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
|
|
|
{{if eq .Model.PrivatelyOwned 1}}
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n .Lang "blog.access_token"}}</label>
|
2017-04-24 18:25:17 +08:00
|
|
|
<div class="row">
|
2021-04-21 12:22:34 +08:00
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="text" name="token" id="token" class="form-control" placeholder="{{i18n .Lang "blog.access_token"}}" readonly value="{{.Model.PrivateToken}}">
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
2021-04-21 12:22:34 +08:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<button type="button" class="btn btn-success btn-sm" id="createToken" data-loading-text="{{i18n .Lang "common.generate"}}" data-action="create">{{i18n .Lang "common.generate"}}</button>
|
|
|
|
<button type="button" class="btn btn-danger btn-sm" id="deleteToken" data-loading-text="{{i18n .Lang "common.delete"}}" data-action="delete">{{i18n .Lang "common.delete"}}</button>
|
2017-04-24 18:25:17 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-11-20 20:55:04 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label>{{i18n $.Lang "blog.access_pass"}}</label>
|
|
|
|
<input type="text" name="bPassword" id="bPassword" class="form-control" placeholder="{{i18n $.Lang "blog.access_pass"}}" value="{{.Model.BookPassword}}">
|
|
|
|
<p class="text">{{i18n $.Lang "message.access_pass_desc"}}</p>
|
2018-11-20 20:55:04 +08:00
|
|
|
</div>
|
2017-04-24 18:25:17 +08:00
|
|
|
{{end}}
|
2018-03-23 17:11:20 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label for="autoRelease">{{i18n $.Lang "blog.auto_publish"}}</label>
|
2018-03-23 17:11:20 +08:00
|
|
|
<div class="controls">
|
|
|
|
<div class="switch switch-small" data-on="primary" data-off="info">
|
|
|
|
<input type="checkbox" id="autoRelease" name="auto_release"{{if .Model.AutoRelease }} checked{{end}} data-size="small">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label for="autoRelease">{{i18n $.Lang "blog.enable_export"}}</label>
|
2018-03-23 17:11:20 +08:00
|
|
|
<div class="controls">
|
|
|
|
<div class="switch switch-small" data-on="primary" data-off="info">
|
2021-04-21 12:22:34 +08:00
|
|
|
<input type="checkbox" id="isDownload" name="is_download"{{if .Model.IsDownload }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.enable_export"}}">
|
2018-03-23 17:11:20 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label for="autoRelease">{{i18n $.Lang "blog.enable_share"}}</label>
|
2018-03-23 17:11:20 +08:00
|
|
|
<div class="controls">
|
|
|
|
<div class="switch switch-small" data-on="primary" data-off="info">
|
2021-04-21 12:22:34 +08:00
|
|
|
<input type="checkbox" id="enableShare" name="enable_share"{{if .Model.IsEnableShare }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.enable_share"}}">
|
2018-03-23 17:11:20 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label for="autoRelease">{{i18n $.Lang "blog.set_first_as_home"}}</label>
|
2018-03-23 17:11:20 +08:00
|
|
|
<div class="controls">
|
|
|
|
<div class="switch switch-small" data-on="primary" data-off="info">
|
2021-04-21 12:22:34 +08:00
|
|
|
<input type="checkbox" id="is_use_first_document" name="is_use_first_document"{{if .Model.IsUseFirstDocument }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.set_first_as_home"}}">
|
2018-03-23 17:11:20 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-24 18:25:17 +08:00
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="submit" id="btnSaveBookInfo" class="btn btn-success" data-loading-text="{{i18n $.Lang "common.processing"}}">{{i18n $.Lang "common.save"}}</button>
|
2017-04-24 18:25:17 +08:00
|
|
|
<span id="form-error-message" class="error-message"></span>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="form-right">
|
|
|
|
<label>
|
2021-04-21 12:22:34 +08:00
|
|
|
<img src="{{.Model.Cover}}" onerror="this.src='/static/images/book.png'" alt="{{i18n .Lang "blog.cover"}}" style="max-width: 120px;border: 1px solid #999" id="headimgurl">
|
2017-04-24 18:25:17 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{template "widgets/footer.tpl" .}}
|
|
|
|
</div>
|
2017-05-11 13:39:34 +08:00
|
|
|
<div class="modal fade" id="changePrivatelyOwnedModal" tabindex="-1" role="dialog" aria-labelledby="changePrivatelyOwnedModalLabel">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<form method="post" action="{{urlfor "ManagerController.PrivatelyOwned" }}" id="changePrivatelyOwnedForm">
|
|
|
|
<input type="hidden" name="identify" value="{{.Model.Identify}}">
|
|
|
|
<input type="hidden" name="status" value="{{if eq .Model.PrivatelyOwned 0}}close{{else}}open{{end}}">
|
|
|
|
<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>
|
|
|
|
<h4 class="modal-title">
|
|
|
|
{{if eq .Model.PrivatelyOwned 0}}
|
2021-04-21 12:22:34 +08:00
|
|
|
{{i18n $.Lang "blog.make_private"}}
|
2017-05-11 13:39:34 +08:00
|
|
|
{{else}}
|
2021-04-21 12:22:34 +08:00
|
|
|
{{i18n $.Lang "blog.make_public"}}
|
2017-05-11 13:39:34 +08:00
|
|
|
{{end}}
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
{{if eq .Model.PrivatelyOwned 0}}
|
2021-04-21 12:22:34 +08:00
|
|
|
<span style="font-size: 14px;font-weight: 400;">{{i18n $.Lang "message.confirm_into_private"}}</span>
|
2017-05-11 13:39:34 +08:00
|
|
|
<p></p>
|
2021-04-21 12:22:34 +08:00
|
|
|
<p class="text error-message">{{i18n $.Lang "message.into_private_notice"}}</p>
|
2017-05-11 13:39:34 +08:00
|
|
|
{{else}}
|
2021-04-21 12:22:34 +08:00
|
|
|
<span style="font-size: 14px;font-weight: 400;">{{i18n $.Lang "message.confirm_into_public"}}</span>
|
2017-05-11 13:39:34 +08:00
|
|
|
<p></p>
|
2021-04-21 12:22:34 +08:00
|
|
|
<p class="text error-message">{{i18n $.Lang "message.into_public_notice"}}</p>
|
2017-05-11 13:39:34 +08:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<span class="error-message" id="form-error-message1"></span>
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{i18n .Lang "common.cancel"}}</button>
|
|
|
|
<button type="submit" class="btn btn-primary" data-loading-text="{{i18n .Lang "message.processing"}}" id="btnChangePrivatelyOwned">{{i18n .Lang "common.confirm"}}</button>
|
2017-05-11 13:39:34 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-04-25 20:05:59 +08:00
|
|
|
<!-- Delete Book Modal -->
|
|
|
|
<div class="modal fade" id="deleteBookModal" tabindex="-1" role="dialog" aria-labelledby="deleteBookModalLabel">
|
|
|
|
<div class="modal-dialog" role="document">
|
2017-06-09 13:25:39 +08:00
|
|
|
<form method="post" id="deleteBookForm" action="{{urlfor "ManagerController.DeleteBook"}}">
|
2017-06-13 15:05:12 +08:00
|
|
|
<input type="hidden" name="book_id" value="{{.Model.BookId}}">
|
2017-04-25 20:05:59 +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-21 12:22:34 +08:00
|
|
|
<h4 class="modal-title">{{i18n .Lang "blog.delete_project"}}</h4>
|
2017-04-25 20:05:59 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2021-04-21 12:22:34 +08:00
|
|
|
<span style="font-size: 14px;font-weight: 400;">{{i18n .Lang "message.confirm_delete_project"}}</span>
|
2017-04-25 20:05:59 +08:00
|
|
|
<p></p>
|
2021-04-21 12:22:34 +08:00
|
|
|
<p class="text error-message">{{i18n .Lang "message.warning_delete_project"}}</p>
|
2017-04-25 20:05:59 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<span id="form-error-message2" class="error-message"></span>
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{i18n .Lang "common.cancel"}}</button>
|
|
|
|
<button type="submit" id="btnDeleteBook" class="btn btn-primary" data-loading-text="{{i18n .Lang "message.processing"}}">{{i18n .Lang "common.confirm_delete"}}</button>
|
2017-04-25 20:05:59 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-05-11 13:39:34 +08:00
|
|
|
<div class="modal fade" id="transferBookModal" tabindex="-1" role="dialog" aria-labelledby="transferBookModalLabel">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<form action="{{urlfor "ManagerController.Transfer"}}" method="post" id="transferBookForm">
|
|
|
|
<input type="hidden" name="identify" value="{{.Model.Identify}}">
|
|
|
|
<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-21 12:22:34 +08:00
|
|
|
<h4 class="modal-title" id="myModalLabel">{{i18n $.Lang "blog.handover_project"}}</h4>
|
2017-05-11 13:39:34 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="form-group">
|
2021-04-21 12:22:34 +08:00
|
|
|
<label class="col-sm-2 control-label">{{i18n $.Lang "blog.recipient_account"}}</label>
|
2017-05-11 13:39:34 +08:00
|
|
|
<div class="col-sm-10">
|
2021-04-21 12:22:34 +08:00
|
|
|
<input type="text" name="account" class="form-control" placeholder="{{i18n $.Lang "blog.recipient_account"}}" id="receiveAccount" maxlength="50">
|
2017-05-11 13:39:34 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<span id="form-error-message3" class="error-message"></span>
|
2021-04-21 12:22:34 +08:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{i18n .Lang "common.cancel"}}</button>
|
|
|
|
<button type="submit" id="btnTransferBook" daata-loading-text="{{i18n $.Lang "message.processing"}}" class="btn btn-primary">{{i18n $.Lang "common.comfirm"}}</button>
|
2017-05-11 13:39:34 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-05-12 14:21:29 +08:00
|
|
|
<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/webuploader/webuploader.min.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/cropper/2.3.4/cropper.min.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/js/jquery.form.js"}}" type="text/javascript"></script>
|
2018-03-23 17:11:20 +08:00
|
|
|
<script src="{{cdnjs "/static/bootstrap/plugins/tagsinput/bootstrap-tagsinput.min.js"}}" type="text/javascript"></script>
|
|
|
|
<script src="{{cdnjs "/static/bootstrap/plugins/bootstrap-switch/js/bootstrap-switch.min.js"}}" type="text/javascript"></script>
|
2018-11-20 20:55:04 +08:00
|
|
|
<script src="{{cdnjs "/static/select2/4.0.5/js/select2.full.min.js"}}"></script>
|
|
|
|
<script src="{{cdnjs "/static/select2/4.0.5/js/i18n/zh-CN.js"}}"></script>
|
2018-02-02 23:12:29 +08:00
|
|
|
<script src="{{cdnjs "/static/js/main.js"}}" type="text/javascript"></script>
|
2017-04-25 20:05:59 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
2018-03-23 17:11:20 +08:00
|
|
|
$("#autoRelease,#enableShare,#isDownload,#is_use_first_document").bootstrapSwitch();
|
2017-04-25 20:05:59 +08:00
|
|
|
$("#upload-logo-panel").on("hidden.bs.modal",function () {
|
|
|
|
$("#upload-logo-panel").find(".modal-body").html(window.modalHtml);
|
|
|
|
}).on("show.bs.modal",function () {
|
|
|
|
window.modalHtml = $("#upload-logo-panel").find(".modal-body").html();
|
|
|
|
});
|
|
|
|
$("#createToken,#deleteToken").on("click",function () {
|
|
|
|
var btn = $(this).button("loading");
|
|
|
|
var action = $(this).attr("data-action");
|
|
|
|
$.ajax({
|
|
|
|
url : "{{urlfor "ManagerController.CreateToken"}}",
|
|
|
|
type :"post",
|
|
|
|
data : { "identify" : {{.Model.Identify}} , "action" : action },
|
|
|
|
dataType : "json",
|
|
|
|
success : function (res) {
|
|
|
|
if(res.errcode === 0){
|
|
|
|
$("#token").val(res.data);
|
|
|
|
}else{
|
|
|
|
alert(res.message);
|
|
|
|
}
|
|
|
|
btn.button("reset");
|
|
|
|
},
|
|
|
|
error : function () {
|
|
|
|
btn.button("reset");
|
2021-04-21 12:22:34 +08:00
|
|
|
alert({{i18n $.Lang "message.system_error"}});
|
2017-04-25 20:05:59 +08:00
|
|
|
}
|
|
|
|
}) ;
|
|
|
|
});
|
|
|
|
$("#token").on("focus",function () {
|
|
|
|
$(this).select();
|
|
|
|
});
|
|
|
|
$("#bookEditForm").ajaxForm({
|
|
|
|
beforeSubmit : function () {
|
|
|
|
var bookName = $.trim($("#bookName").val());
|
|
|
|
if (bookName === "") {
|
2021-04-21 12:22:34 +08:00
|
|
|
return showError("{{i18n $.Lang "message.project_name_empty"}}");
|
2017-04-25 20:05:59 +08:00
|
|
|
}
|
|
|
|
$("#btnSaveBookInfo").button("loading");
|
|
|
|
},
|
|
|
|
success : function (res) {
|
|
|
|
if(res.errcode === 0){
|
2021-04-21 12:22:34 +08:00
|
|
|
showSuccess("{{i18n $.Lang "message.success"}}")
|
2017-04-25 20:05:59 +08:00
|
|
|
}else{
|
2021-04-21 12:22:34 +08:00
|
|
|
showError("{{i18n $.Lang "message.failed"}}")
|
2017-04-25 20:05:59 +08:00
|
|
|
}
|
|
|
|
$("#btnSaveBookInfo").button("reset");
|
|
|
|
},
|
|
|
|
error : function () {
|
2021-04-21 12:22:34 +08:00
|
|
|
showError("{{i18n $.Lang "message.system_error"}}");
|
2017-04-25 20:05:59 +08:00
|
|
|
$("#btnSaveBookInfo").button("reset");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#deleteBookForm").ajaxForm({
|
2018-02-02 23:12:29 +08:00
|
|
|
beforeSubmit : function () {
|
|
|
|
$("#btnDeleteBook").button("loading");
|
|
|
|
},
|
2017-04-25 20:05:59 +08:00
|
|
|
success : function (res) {
|
|
|
|
if(res.errcode === 0){
|
|
|
|
window.location = "{{urlfor "ManagerController.Books"}}";
|
|
|
|
}else{
|
2018-02-02 23:12:29 +08:00
|
|
|
$("#btnDeleteBook").button("reset");
|
2017-04-25 20:05:59 +08:00
|
|
|
showError(res.message,"#form-error-message2");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2017-05-11 13:39:34 +08:00
|
|
|
$("#transferBookForm").ajaxForm({
|
|
|
|
beforeSubmit : function () {
|
|
|
|
var account = $.trim($("#receiveAccount").val());
|
|
|
|
if (account === ""){
|
2021-04-21 12:22:34 +08:00
|
|
|
return showError("{{i18n $.Lang "message.receive_account_empty"}}","#form-error-message3")
|
2017-05-11 13:39:34 +08:00
|
|
|
}
|
|
|
|
$("#btnTransferBook").button("loading");
|
|
|
|
},
|
|
|
|
success : function (res) {
|
|
|
|
if(res.errcode === 0){
|
|
|
|
window.location = window.location.href;
|
|
|
|
}else{
|
|
|
|
showError(res.message,"#form-error-message3");
|
|
|
|
}
|
|
|
|
$("#btnTransferBook").button("reset");
|
|
|
|
},
|
|
|
|
error : function () {
|
|
|
|
$("#btnTransferBook").button("reset");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#changePrivatelyOwnedForm").ajaxForm({
|
|
|
|
beforeSubmit :function () {
|
|
|
|
$("#btnChangePrivatelyOwned").button("loading");
|
|
|
|
},
|
|
|
|
success :function (res) {
|
|
|
|
if(res.errcode === 0){
|
|
|
|
window.location = window.location.href;
|
|
|
|
return;
|
|
|
|
}else{
|
|
|
|
showError(res.message,"#form-error-message1");
|
|
|
|
}
|
|
|
|
$("#btnChangePrivatelyOwned").button("reset");
|
|
|
|
},
|
|
|
|
error :function () {
|
2021-04-21 12:22:34 +08:00
|
|
|
showError("{{i18n $.Lang "message.system_error"}}","#form-error-message1");
|
2017-05-11 13:39:34 +08:00
|
|
|
$("#btnChangePrivatelyOwned").button("reset");
|
|
|
|
}
|
|
|
|
});
|
2018-11-20 20:55:04 +08:00
|
|
|
$('.js-data-example-ajax').select2({
|
2021-04-21 12:22:34 +08:00
|
|
|
language: "{{i18n $.Lang "common.js_lang"}}",
|
2018-11-20 20:55:04 +08:00
|
|
|
minimumInputLength : 1,
|
|
|
|
minimumResultsForSearch: Infinity,
|
|
|
|
maximumSelectionLength:1,
|
|
|
|
width : "100%",
|
|
|
|
ajax: {
|
|
|
|
url: '{{urlfor "BookController.ItemsetsSearch"}}',
|
|
|
|
dataType: 'json',
|
|
|
|
data: function (params) {
|
|
|
|
return {
|
|
|
|
q: params.term, // search term
|
|
|
|
page: params.page
|
|
|
|
};
|
|
|
|
},
|
|
|
|
processResults: function (data, params) {
|
|
|
|
return {
|
|
|
|
results : data.data.results
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2017-04-25 20:05:59 +08:00
|
|
|
});
|
2017-05-11 13:39:34 +08:00
|
|
|
|
2017-04-25 20:05:59 +08:00
|
|
|
</script>
|
2017-04-24 18:25:17 +08:00
|
|
|
</body>
|
|
|
|
</html>
|