refactor and update i18n, to be continue

pull/680/head
Ben Stone 2021-03-31 20:46:38 +08:00
parent 10f66681fb
commit 9ef0260971
7 changed files with 218 additions and 122 deletions

View File

@ -14,8 +14,10 @@ feedback = Feedback
source_code = Source Code source_code = Source Code
manual = Manual manual = Manual
username = Username username = Username
account = Account
email = Email email = Email
password = Password password = Password
role = Role
captcha = Captcha captcha = Captcha
keep_login = Stay signed in keep_login = Stay signed in
forgot_password = Forgot password? forgot_password = Forgot password?
@ -31,6 +33,10 @@ cancel = Cancel
create = Create create = Create
confirm_delete = Confirm Delete confirm_delete = Confirm Delete
upload_lang = en upload_lang = en
js_lang = en
remove = Remove
operate = Operate
confirm = Confirm
[message] [message]
keyword_placeholder = input keyword please... keyword_placeholder = input keyword please...
@ -92,6 +98,9 @@ project_id_empty = Project ID cannot be empty
project_id_length = Project ID must be less than 50 characters project_id_length = Project ID must be less than 50 characters
import_file_empty = Please select the file to upload import_file_empty = Please select the file to upload
file_type_placeholder = Please select a Zip file file_type_placeholder = Please select a Zip file
publish_to_queue = The publish task has been pushed to the task queue and will be executed soon.
team_name_empty = Team name cannot be empty
operate_failed = Operation failed
[blog] [blog]
author = author author = author
@ -105,11 +114,14 @@ edit = Edit
delete = Delete delete = Delete
copy = Copy copy = Copy
view = View view = View
publish = Publish
edit_doc = Edit Document edit_doc = Edit Document
default_cover = Default Cover default_cover = Default Cover
create_time = Create Time create_time = Create Time
update_time = Update Time
creator = Creator creator = Creator
doc_amount = Document Amount doc_amount = Number of documents
doc_unit =
project_role = Project Role project_role = Project Role
last_edit = Last Edited last_edit = Last Edited
project_title = Project Title project_title = Project Title
@ -117,6 +129,42 @@ project_id = Project ID
project_desc = Project description project_desc = Project description
public = Public public = Public
private = Private private = Private
public_project = Public Project
private_project = Private Project
summary = Summary
member = Member
team = Team
comment_amount = Number of comments
comment_unit =
member_manage = Member Manage
add_member = Add Member
administrator = Administrator
editor = Editor
observer = Observer
team_manage = Team Manage
add_team = Add Team
team_name = Team name
member_amount = Number of members
join_time = Join Time
project_setting = Project setting
handover_project = Hanover
make_public = Into Public
make_private = Into Privete
history_record_amount = Number of history records
corp_id = corp name
text_editor = editor
access_pass = Access Password
auto_publish = Auto publish
enable_export = Enable Export
enable_share = Enable Share
set_first_as_home = Set the first document as the default homepage
auto_save = Auto Save
cover = Cover
click_change_cover = Click to change the cover
change_cover = Change Cover
preview = Preview
choose = Choose
upload = Upload
[page] [page]
first = first first = first

View File

@ -14,8 +14,10 @@ feedback = 意见反馈
source_code = 项目源码 source_code = 项目源码
manual = 使用手册 manual = 使用手册
username = 用户名 username = 用户名
account = 账号
email = 邮箱 email = 邮箱
password = 密码 password = 密码
role = 角色
captcha = 验证码 captcha = 验证码
keep_login = 保持登录 keep_login = 保持登录
forgot_password = 忘记密码? forgot_password = 忘记密码?
@ -31,6 +33,10 @@ cancel = 取消
create = 创建 create = 创建
confirm_delete = 确定删除 confirm_delete = 确定删除
upload_lang = zh upload_lang = zh
js_lang = zh-CN
remove = 移除
operate = 操作
confirm = 确定
[message] [message]
keyword_placeholder = 请输入关键词... keyword_placeholder = 请输入关键词...
@ -92,6 +98,9 @@ project_id_empty = 项目标识不能为空
project_id_length = 项目标识必须小于50字符 project_id_length = 项目标识必须小于50字符
import_file_empty = 请选择需要上传的文件 import_file_empty = 请选择需要上传的文件
file_type_placeholder = 请选择Zip文件 file_type_placeholder = 请选择Zip文件
publish_to_queue = 发布任务已推送到任务队列,稍后将在后台执行。
team_name_empty = 团队名称不能为空
operate_failed = 操作失败
[blog] [blog]
author = 作者 author = 作者
@ -105,11 +114,14 @@ edit = 编辑
delete = 删除 delete = 删除
copy = 复制 copy = 复制
view = 查看文档 view = 查看文档
publish = 发布
edit_doc = 编辑文档 edit_doc = 编辑文档
default_cover = 默认封面 default_cover = 默认封面
create_time = 创建时间 create_time = 创建时间
update_time = 修改时间
creator = 创建者 creator = 创建者
doc_amount = 文档数量 doc_amount = 文档数量
doc_unit =
project_role = 项目角色 project_role = 项目角色
last_edit = 最后编辑 last_edit = 最后编辑
project_title = 项目标题 project_title = 项目标题
@ -117,6 +129,42 @@ project_id = 项目标识
project_desc = 项目描述 project_desc = 项目描述
public = 公开 public = 公开
private = 私有 private = 私有
public_project = 公开项目
private_project = 私有项目
summary = 概要
member = 成员
team = 团队
comment_amount = 评论数量
comment_unit =
member_manage = 成员管理
add_member = 添加成员
administrator = 管理员
editor = 编辑者
observer = 观察者
team_manage = 团队管理
add_team = 添加团队
team_name = 团队名称
member_amount = 成员数量
join_time = 加入时间
project_setting = 项目设置
handover_project = 转让项目
make_public = 转为公有
make_private = 转为私有
history_record_amount = 历史记录数量
corp_id = 公司名称
text_editor = 编辑器
access_pass = 访问密码
auto_publish = 自动发布
enable_export = 开启导出
enable_share = 开启分享
set_first_as_home = 设置第一篇文档为默认首页
auto_save = 自动保存
cover = 封面
click_change_cover = 点击图片可修改项目封面
change_cover = 修改封面
preview = 预览
choose = 选择
upload = 上传
[page] [page]
first = 首页 first = 首页

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>概要 - Powered by MinDoc</title> <title>{{i18n $.Lang "blog.summary"}} - Powered by MinDoc</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet"> <link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
@ -26,11 +26,11 @@
<div class="row"> <div class="row">
<div class="page-left"> <div class="page-left">
<ul class="menu"> <ul class="menu">
<li class="active"><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a> </li> <li class="active"><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> {{i18n $.Lang "blog.summary"}}</a> </li>
{{if eq .Model.RoleId 0 1}} {{if eq .Model.RoleId 0 1}}
<li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a> </li> <li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> {{i18n $.Lang "blog.member"}}</a> </li>
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li> <li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> {{i18n $.Lang "blog.team"}}</a> </li>
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a> </li> <li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> {{i18n $.Lang "common.setting"}}</a> </li>
{{end}} {{end}}
</ul> </ul>
@ -40,19 +40,19 @@
<div class="box-head"> <div class="box-head">
<strong class="box-title"> <strong class="box-title">
{{if eq .Model.PrivatelyOwned 0}} {{if eq .Model.PrivatelyOwned 0}}
<i class="fa fa-unlock" aria-hidden="true" title="公开项目" data-toggle="tooltip"></i> <i class="fa fa-unlock" aria-hidden="true" title="{{i18n $.Lang "blog.public_project"}}" data-toggle="tooltip"></i>
{{else}} {{else}}
<i class="fa fa-lock" aria-hidden="true" title="私有项目" data-toggle="tooltip"></i> <i class="fa fa-lock" aria-hidden="true" title="{{i18n $.Lang "blog.private_project"}}" data-toggle="tooltip"></i>
{{end}} {{end}}
{{.Model.BookName}} {{.Model.BookName}}
</strong> </strong>
{{if ne .Model.RoleId 3}} {{if ne .Model.RoleId 3}}
<a href="{{urlfor "DocumentController.Edit" ":key" .Model.Identify ":id" ""}}" class="btn btn-default btn-sm pull-right" target="_blank"><i class="fa fa-edit" aria-hidden="true"></i> 编辑</a> <a href="{{urlfor "DocumentController.Edit" ":key" .Model.Identify ":id" ""}}" class="btn btn-default btn-sm pull-right" target="_blank"><i class="fa fa-edit" aria-hidden="true"></i> {{i18n $.Lang "blog.edit"}}</a>
{{end}} {{end}}
<a href="{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" class="btn btn-default btn-sm pull-right" style="margin-right: 5px;" target="_blank"><i class="fa fa-eye"></i> 阅读</a> <a href="{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" class="btn btn-default btn-sm pull-right" style="margin-right: 5px;" target="_blank"><i class="fa fa-eye"></i> {{i18n $.Lang "blog.read"}}</a>
{{if eq .Model.RoleId 0 1 2}} {{if eq .Model.RoleId 0 1 2}}
<button class="btn btn-default btn-sm pull-right" style="margin-right: 5px;" id="btnRelease"><i class="fa fa-upload" aria-hidden="true"></i> 发布</button> <button class="btn btn-default btn-sm pull-right" style="margin-right: 5px;" id="btnRelease"><i class="fa fa-upload" aria-hidden="true"></i> {{i18n $.Lang "blog.publish"}}</button>
{{end}} {{end}}
</div> </div>
</div> </div>
@ -65,32 +65,32 @@
</div> </div>
<div class="list"> <div class="list">
<span class="title">创建者</span> <span class="title">{{i18n $.Lang "blog.creator"}}</span>
<span class="body">{{.Model.CreateName}}</span> <span class="body">{{.Model.CreateName}}</span>
</div> </div>
<div class="list"> <div class="list">
<span class="title">文档数量</span> <span class="title">{{i18n $.Lang "blog.doc_amount"}}</span>
<span class="body">{{.Model.DocCount}} </span> <span class="body">{{.Model.DocCount}} {{i18n $.Lang "blog.doc_unit"}}</span>
</div> </div>
<div class="list"> <div class="list">
<span class="title">创建时间</span> <span class="title">{{i18n $.Lang "blog.create_time"}}</span>
<span class="body"> {{date_format .Model.CreateTime "2006-01-02 15:04:05"}} </span> <span class="body"> {{date_format .Model.CreateTime "2006-01-02 15:04:05"}} </span>
</div> </div>
<div class="list"> <div class="list">
<span class="title">修改时间</span> <span class="title">{{i18n $.Lang "blog.update_time"}}</span>
<span class="body"> {{date_format .Model.CreateTime "2006-01-02 15:04:05"}} </span> <span class="body"> {{date_format .Model.CreateTime "2006-01-02 15:04:05"}} </span>
</div> </div>
<div class="list"> <div class="list">
<span class="title">担任角色</span> <span class="title">{{i18n $.Lang "blog.project_role"}}</span>
<span class="body">{{.Model.RoleName}}</span> <span class="body">{{.Model.RoleName}}</span>
</div> </div>
<!-- {{/* <div class="list"> <!-- {{/* <div class="list">
<span class="title">评论数量</span> <span class="title">{{i18n $.Lang "blog.comment_amount"}}</span>
<span class="body">{{.Model.CommentCount}} </span> <span class="body">{{.Model.CommentCount}} {{i18n $.Lang "blog.comment_unit"}}</span>
</div>*/}} </div>*/}}
--> -->
<div class="list"> <div class="list">
<span class="title">文档标签</span> <span class="title">{{i18n $.Lang "blog.project_desc"}}</span>
<span class="body">{{.Model.Label}}</span> <span class="body">{{.Model.Label}}</span>
</div> </div>
<div class="summary">{{.Description}} </div> <div class="summary">{{.Description}} </div>
@ -116,7 +116,7 @@
dataType : "json", dataType : "json",
success : function (res) { success : function (res) {
if(res.errcode === 0){ if(res.errcode === 0){
layer.msg("发布任务已推送到任务队列,稍后将在后台执行。"); layer.msg("{{i18n $.Lang "message.publish_to_queue"}}");
}else{ }else{
layer.msg(res.message); layer.msg(res.message);
} }

View File

@ -428,7 +428,7 @@
window.bookDialogModal = $(this).find("#addBookDialogForm").html(); window.bookDialogModal = $(this).find("#addBookDialogForm").html();
drawBookCover("bookCover","{{i18n $.Lang "blog.default_cover"}}"); drawBookCover("bookCover","{{i18n $.Lang "blog.default_cover"}}");
$('.js-data-example-ajax-add').select2({ $('.js-data-example-ajax-add').select2({
language: "zh-CN", language: "{{i18n $.Lang "common.js_lang"}}",
minimumInputLength : 1, minimumInputLength : 1,
minimumResultsForSearch: Infinity, minimumResultsForSearch: Infinity,
maximumSelectionLength:1, maximumSelectionLength:1,
@ -480,7 +480,7 @@
} }
}); });
$('.js-data-example-ajax-import').select2({ $('.js-data-example-ajax-import').select2({
language: "zh-CN", language: "{{i18n $.Lang "common.js_lang"}}",
minimumInputLength : 1, minimumInputLength : 1,
minimumResultsForSearch: Infinity, minimumResultsForSearch: Infinity,
maximumSelectionLength:1, maximumSelectionLength:1,

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>设置 - {{.Model.BookName}} - Powered by MinDoc</title> <title>{{i18n $.Lang "common.setting"}} - {{.Model.BookName}} - Powered by MinDoc</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet"> <link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
@ -25,25 +25,25 @@
<div class="row"> <div class="row">
<div class="page-left"> <div class="page-left">
<ul class="menu"> <ul class="menu">
<li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a> </li> <li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> {{i18n $.Lang "blog.summary"}}</a> </li>
<li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a> </li> <li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> {{i18n $.Lang "blog.member"}}</a> </li>
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li> <li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> {{i18n $.Lang "blog.team"}}</a> </li>
<li class="active"><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a> </li> <li class="active"><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> {{i18n $.Lang "common.setting"}}</a> </li>
</ul> </ul>
</div> </div>
<div class="page-right"> <div class="page-right">
<div class="m-box"> <div class="m-box">
<div class="box-head"> <div class="box-head">
<strong class="box-title"> 项目设置</strong> <strong class="box-title"> {{i18n $.Lang "blog.project_setting"}}</strong>
{{if eq .Model.RoleId 0}} {{if eq .Model.RoleId 0}}
<button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#transferBookModal">转让项目</button> <button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#transferBookModal">{{i18n $.Lang "blog.handover_project"}}</button>
{{if eq .Model.PrivatelyOwned 1}} {{if eq .Model.PrivatelyOwned 1}}
<button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#changePrivatelyOwnedModal" style="margin-right: 5px;">转为公有</button> <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>
{{else}} {{else}}
<button type="button" class="btn btn-danger btn-sm pull-right" data-toggle="modal" data-target="#changePrivatelyOwnedModal" style="margin-right: 5px;">转为私有</button> <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>
{{end}} {{end}}
<button type="button" class="btn btn-danger btn-sm pull-right" style="margin-right: 5px;" data-toggle="modal" data-target="#deleteBookModal">删除项目</button> <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>
{{end}} {{end}}
</div> </div>
@ -53,56 +53,56 @@
<form method="post" id="bookEditForm" action="{{urlfor "BookController.SaveBook"}}"> <form method="post" id="bookEditForm" action="{{urlfor "BookController.SaveBook"}}">
<input type="hidden" name="identify" value="{{.Model.Identify}}"> <input type="hidden" name="identify" value="{{.Model.Identify}}">
<div class="form-group"> <div class="form-group">
<label>标题</label> <label>{{i18n $.Lang "blog.project_title"}}</label>
<input type="text" class="form-control" name="book_name" id="bookName" placeholder="项目名称" value="{{.Model.BookName}}"> <input type="text" class="form-control" name="book_name" id="bookName" placeholder="{{i18n $.Lang "blog.project_title"}}" value="{{.Model.BookName}}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>标识</label> <label>{{i18n $.Lang "blog.project_id"}}</label>
<input type="text" class="form-control" value="{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" placeholder="项目唯一标识" disabled> <input type="text" class="form-control" value="{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" placeholder="{{i18n $.Lang "blog.project_id"}}" disabled>
<p class="text">项目标识用来标记项目的唯一性,不可修改。</p> <p class="text">项目标识用来标记项目的唯一性,不可修改。</p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>项目空间</label> <label>{{i18n $.Lang "common.project_space"}}</label>
<select class="js-data-example-ajax form-control" multiple="multiple" name="itemId"> <select class="js-data-example-ajax form-control" multiple="multiple" name="itemId">
<option value="{{.Model.ItemId}}" selected="selected">{{.Model.ItemName}}</option> <option value="{{.Model.ItemId}}" selected="selected">{{.Model.ItemName}}</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>历史记录数量</label> <label>{{i18n $.Lang "blog.history_record_amount"}}</label>
<input type="text" class="form-control" name="history_count" value="{{.Model.HistoryCount}}" placeholder="历史记录数量"> <input type="text" class="form-control" name="history_count" value="{{.Model.HistoryCount}}" placeholder="{{i18n $.Lang "blog.history_record_amount"}}">
<p class="text">当开启文档历史时,该值会限制每个文档保存的历史数量</p> <p class="text">当开启文档历史时,该值会限制每个文档保存的历史数量</p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>公司标识</label> <label>{{i18n $.Lang "blog.corp_id"}}</label>
<input type="text" class="form-control" name="publisher" value="{{.Model.Publisher}}" placeholder="公司名称"> <input type="text" class="form-control" name="publisher" value="{{.Model.Publisher}}" placeholder="{{i18n $.Lang "blog.corp_id"}}">
<p class="text">导出文档PDF文档时显示的页脚</p> <p class="text">导出文档PDF文档时显示的页脚</p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>描述</label> <label>{{i18n $.Lang "blog.project_desc"}}</label>
<textarea rows="3" class="form-control" name="description" style="height: 90px" placeholder="项目描述">{{.Model.Description}}</textarea> <textarea rows="3" class="form-control" name="description" style="height: 90px" placeholder="{{i18n $.Lang "blog.project_desc"}}">{{.Model.Description}}</textarea>
<p class="text">描述信息不超过500个字符,支持Markdown语法</p> <p class="text">描述信息不超过500个字符,支持Markdown语法</p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>编辑器</label> <label>{{i18n $.Lang "blog.text_editor"}}</label>
<div class="radio"> <div class="radio">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio"{{if eq .Model.Editor "markdown"}} checked{{end}} name="editor" value="markdown"> Markdown编辑器 <input type="radio"{{if eq .Model.Editor "markdown"}} checked{{end}} name="editor" value="markdown"> Markdown {{i18n $.Lang "blog.text_editor"}}
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio"{{if eq .Model.Editor "html"}} checked{{end}} name="editor" value="html"> Html编辑器 <input type="radio"{{if eq .Model.Editor "html"}} checked{{end}} name="editor" value="html"> Html {{i18n $.Lang "blog.text_editor"}}
</label> </label>
</div> </div>
</div> </div>
{{if eq .Model.PrivatelyOwned 1}} {{if eq .Model.PrivatelyOwned 1}}
<div class="form-group"> <div class="form-group">
<label>访问密码</label> <label>{{i18n $.Lang "blog.access_pass"}}</label>
<input type="text" name="bPassword" id="bPassword" class="form-control" placeholder="访问密码" value="{{.Model.BookPassword}}"> <input type="text" name="bPassword" id="bPassword" class="form-control" placeholder="{{i18n $.Lang "blog.access_pass"}}" value="{{.Model.BookPassword}}">
<p class="text">没有访问权限访问项目时需要提供的密码</p> <p class="text">没有访问权限访问项目时需要提供的密码</p>
</div> </div>
{{end}} {{end}}
<div class="form-group"> <div class="form-group">
<label for="autoRelease">自动发布</label> <label for="autoRelease">{{i18n $.Lang "blog.auto_publish"}}</label>
<div class="controls"> <div class="controls">
<div class="switch switch-small" data-on="primary" data-off="info"> <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"> <input type="checkbox" id="autoRelease" name="auto_release"{{if .Model.AutoRelease }} checked{{end}} data-size="small">
@ -111,43 +111,43 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="autoRelease">开启导出</label> <label for="autoRelease">{{i18n $.Lang "blog.enable_export"}}</label>
<div class="controls"> <div class="controls">
<div class="switch switch-small" data-on="primary" data-off="info"> <div class="switch switch-small" data-on="primary" data-off="info">
<input type="checkbox" id="isDownload" name="is_download"{{if .Model.IsDownload }} checked{{end}} data-size="small" placeholder="开启导出"> <input type="checkbox" id="isDownload" name="is_download"{{if .Model.IsDownload }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.enable_export"}}">
</div> </div>
<p class="text">开启导出前请先配置导出程序,并在配置文件中同时开启导出功能</p> <p class="text">开启导出前请先配置导出程序,并在配置文件中同时开启导出功能</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="autoRelease">开启分享</label> <label for="autoRelease">{{i18n $.Lang "blog.enable_share"}}</label>
<div class="controls"> <div class="controls">
<div class="switch switch-small" data-on="primary" data-off="info"> <div class="switch switch-small" data-on="primary" data-off="info">
<input type="checkbox" id="enableShare" name="enable_share"{{if .Model.IsEnableShare }} checked{{end}} data-size="small" placeholder="开启分享"> <input type="checkbox" id="enableShare" name="enable_share"{{if .Model.IsEnableShare }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.enable_share"}}">
</div> </div>
<p class="text">分享只对公开项目生效,私有项目不支持分享</p> <p class="text">分享只对公开项目生效,私有项目不支持分享</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="autoRelease">设置第一篇文档为默认首页</label> <label for="autoRelease">{{i18n $.Lang "blog.set_first_as_home"}}</label>
<div class="controls"> <div class="controls">
<div class="switch switch-small" data-on="primary" data-off="info"> <div class="switch switch-small" data-on="primary" data-off="info">
<input type="checkbox" id="isUseFirstDocument" name="is_use_first_document"{{if .Model.IsUseFirstDocument }} checked{{end}} data-size="small" placeholder="设置第一篇文档为默认首页"> <input type="checkbox" id="isUseFirstDocument" name="is_use_first_document"{{if .Model.IsUseFirstDocument }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.set_first_as_home"}}">
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="autoRelease">自动保存</label> <label for="autoRelease">{{i18n $.Lang "blog.auto_save"}}</label>
<div class="controls"> <div class="controls">
<div class="switch switch-small" data-on="primary" data-off="info"> <div class="switch switch-small" data-on="primary" data-off="info">
<input type="checkbox" id="autoSave" name="auto_save"{{if .Model.AutoSave }} checked{{end}} data-size="small" placeholder="自动保存"> <input type="checkbox" id="autoSave" name="auto_save"{{if .Model.AutoSave }} checked{{end}} data-size="small" placeholder="{{i18n $.Lang "blog.auto_save"}}">
</div> </div>
<p class="text">开启后每隔30秒会自动保存</p> <p class="text">开启后每隔30秒会自动保存</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<button type="submit" id="btnSaveBookInfo" class="btn btn-success" data-loading-text="保存中...">保存修改</button> <button type="submit" id="btnSaveBookInfo" class="btn btn-success" data-loading-text="{{i18n $.Lang "common.processing"}}">{{i18n $.Lang "common.save"}}</button>
<span id="form-error-message" class="error-message"></span> <span id="form-error-message" class="error-message"></span>
</div> </div>
</form> </form>
@ -155,10 +155,10 @@
<div class="form-right"> <div class="form-right">
<label> <label>
<a href="javascript:;" data-toggle="modal" data-target="#upload-logo-panel"> <a href="javascript:;" data-toggle="modal" data-target="#upload-logo-panel">
<img src="{{cdnimg .Model.Cover}}" onerror="this.src='{{cdnimg "/static/images/book.png"}}'" alt="封面" style="max-width: 120px;border: 1px solid #999" id="headimgurl"> <img src="{{cdnimg .Model.Cover}}" onerror="this.src='{{cdnimg "/static/images/book.png"}}'" alt="{{i18n $.Lang "blog.cover"}}" style="max-width: 120px;border: 1px solid #999" id="headimgurl">
</a> </a>
</label> </label>
<p class="text">点击图片可修改项目封面</p> <p class="text">{{i18n $.Lang "blog.click_change_cover"}}</p>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -179,9 +179,9 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"> <h4 class="modal-title">
{{if eq .Model.PrivatelyOwned 0}} {{if eq .Model.PrivatelyOwned 0}}
转为私有 {{i18n $.Lang "blog.make_public"}}
{{else}} {{else}}
转为共 转为共{{i18n $.Lang "blog.make_private"}}
{{end}} {{end}}
</h4> </h4>
</div> </div>
@ -198,20 +198,20 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<span class="error-message" id="form-error-message1"></span> <span class="error-message" id="form-error-message1"></span>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <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="变更中..." id="btnChangePrivatelyOwned">确定</button> <button type="submit" class="btn btn-primary" data-loading-text="{{i18n $.Lang "common.processing"}}" id="btnChangePrivatelyOwned">{{i18n $.Lang "common.confirm"}}</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<!-- Start Modal --> <!-- Start Modal -->
<div class="modal fade" id="upload-logo-panel" tabindex="-1" role="dialog" aria-labelledby="修改封面" aria-hidden="true"> <div class="modal fade" id="upload-logo-panel" tabindex="-1" role="dialog" aria-labelledby="{{i18n $.Lang "blog.change_cover"}}" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">修改封面</h4> <h4 class="modal-title">{{i18n $.Lang "blog.change_cover"}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="wraper"> <div class="wraper">
@ -220,7 +220,7 @@
</div> </div>
</div> </div>
<div class="watch-crop-list"> <div class="watch-crop-list">
<div class="preview-title">预览</div> <div class="preview-title">{{i18n $.Lang "blog.preview"}}</div>
<ul> <ul>
<li> <li>
<div class="img-preview preview-lg"></div> <div class="img-preview preview-lg"></div>
@ -234,8 +234,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<span id="error-message"></span> <span id="error-message"></span>
<div id="filePicker" class="btn">选择</div> <div id="filePicker" class="btn">{{i18n $.Lang "blog.choose"}}</div>
<button type="button" id="saveImage" class="btn btn-success" style="height: 40px;width: 77px;" data-loading-text="上传中...">上传</button> <button type="button" id="saveImage" class="btn btn-success" style="height: 40px;width: 77px;" data-loading-text="{{i18n $.Lang "blog.processing"}}">{{i18n $.Lang "blog.upload"}}</button>
</div> </div>
</div> </div>
</div> </div>
@ -250,7 +250,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">删除项目</h4> <h4 class="modal-title">{{i18n $.Lang "blog.delete_project"}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<span style="font-size: 14px;font-weight: 400;">确定删除项目吗?</span> <span style="font-size: 14px;font-weight: 400;">确定删除项目吗?</span>
@ -259,8 +259,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<span id="form-error-message2" class="error-message"></span> <span id="form-error-message2" class="error-message"></span>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <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="删除中...">确定删除</button> <button type="submit" id="btnDeleteBook" class="btn btn-primary" data-loading-text="{{i18n $.Lang "common.processing"}}">{{i18n $.Lang "common.confirm_delete"}}</button>
</div> </div>
</div> </div>
</form> </form>

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>团队 - {{.Model.BookName}} - Powered by MinDoc</title> <title>{{i18n $.Lang "blog.team"}} - {{.Model.BookName}} - Powered by MinDoc</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet"> <link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
@ -27,11 +27,11 @@
<div class="row"> <div class="row">
<div class="page-left"> <div class="page-left">
<ul class="menu"> <ul class="menu">
<li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a></li> <li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> {{i18n $.Lang "blog.summary"}}</a></li>
{{if eq .Model.RoleId 0 1}} {{if eq .Model.RoleId 0 1}}
<li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a></li> <li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> {{i18n $.Lang "blog.member"}}</a></li>
<li class="active"><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a></li> <li class="active"><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> {{i18n $.Lang "blog.team"}}</a></li>
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a></li> <li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> {{i18n $.Lang "common.setting"}}</a></li>
{{end}} {{end}}
</ul> </ul>
@ -39,10 +39,10 @@
<div class="page-right"> <div class="page-right">
<div class="m-box"> <div class="m-box">
<div class="box-head"> <div class="box-head">
<strong class="box-title"> 团队管理</strong> <strong class="box-title"> {{i18n $.Lang "blog.team_manage"}}</strong>
{{if eq .Model.RoleId 0}} {{if eq .Model.RoleId 0}}
<button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#addTeamDialogModal"><i class="fa fa-user-plus" aria-hidden="true"></i> <button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#addTeamDialogModal"><i class="fa fa-user-plus" aria-hidden="true"></i>
添加团队 {{i18n $.Lang "blog.add_team"}}
</button> </button>
{{end}} {{end}}
</div> </div>
@ -50,16 +50,16 @@
<div class="box-body"> <div class="box-body">
<div class="users-list" id="teamList"> <div class="users-list" id="teamList">
<template v-if="lists.length <= 0"> <template v-if="lists.length <= 0">
<div class="text-center">暂无数据</div> <div class="text-center">{{i18n $.Lang "common.no_data"}}</div>
</template> </template>
<template v-else> <template v-else>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>团队名称</th> <th>{{i18n $.Lang "blog.team_name"}}</th>
<th width="100">成员数量</th> <th width="100">{{i18n $.Lang "blog.member_amount"}}</th>
<th width="180">加入时间</th> <th width="180">{{i18n $.Lang "blog.join_time"}}</th>
<th align="center" width="220px">操作</th> <th align="center" width="220px">{{i18n $.Lang "common.operate"}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -68,7 +68,7 @@
<td>${item.member_count}</td> <td>${item.member_count}</td>
<td>${(new Date(item.create_time)).format("yyyy-MM-dd hh:mm:ss")}</td> <td>${(new Date(item.create_time)).format("yyyy-MM-dd hh:mm:ss")}</td>
<td> <td>
<button type="button" class="btn btn-danger btn-sm" @click="deleteTeam(item.team_id,$event)" data-loading-text="删除中">删除</button> <button type="button" class="btn btn-danger btn-sm" @click="deleteTeam(item.team_id,$event)" data-loading-text="{{i18n $.Lang "common.processing"}}">{{i18n $.Lang "blog.delete"}}</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -93,12 +93,12 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">添加团队</h4> <h4 class="modal-title" id="myModalLabel">{{i18n $.Lang "blog.add_team"}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label" for="account">团队名称<span class="error-message">*</span></label> <label class="col-sm-3 control-label" for="account">{{i18n $.Lang "blog.team_name"}}<span class="error-message">*</span></label>
<div class="col-sm-10"> <div class="col-sm-9">
<select type="text" name="teamId" id="teamId" class="js-data-example-ajax form-control" multiple="multiple"></select> <select type="text" name="teamId" id="teamId" class="js-data-example-ajax form-control" multiple="multiple"></select>
</div> </div>
</div> </div>
@ -106,8 +106,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<span id="form-error-message"></span> <span id="form-error-message"></span>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="button" class="btn btn-default" data-dismiss="modal">{{i18n $.Lang "common.cancel"}}</button>
<button type="submit" class="btn btn-success" data-loading-text="保存中..." id="btnAddTeam">保存 <button type="submit" class="btn btn-success" data-loading-text="{{i18n $.Lang "common.processing"}}" id="btnAddTeam">{{i18n $.Lang "common.save"}}
</button> </button>
</div> </div>
</div> </div>
@ -129,7 +129,7 @@
$("#addTeamDialogModal").on("show.bs.modal", function () { $("#addTeamDialogModal").on("show.bs.modal", function () {
window.addTeamDialogModalHtml = $(this).find("form").html(); window.addTeamDialogModalHtml = $(this).find("form").html();
$('.js-data-example-ajax').select2({ $('.js-data-example-ajax').select2({
language: "zh-CN", language: "{{i18n $.Lang "common.js_lang"}}",
minimumInputLength: 1, minimumInputLength: 1,
minimumResultsForSearch: Infinity, minimumResultsForSearch: Infinity,
maximumSelectionLength: 1, maximumSelectionLength: 1,
@ -161,7 +161,7 @@
beforeSubmit: function () { beforeSubmit: function () {
var teamId = $.trim($("#addTeamDialogForm select[name='teamId']").val()); var teamId = $.trim($("#addTeamDialogForm select[name='teamId']").val());
if (teamId == "") { if (teamId == "") {
return showError("团队名称不能为空"); return showError("{{i18n $.Lang "message.team_name_empty"}}");
} }
$("#btnAddTeam").button("loading"); $("#btnAddTeam").button("loading");
return true; return true;
@ -175,7 +175,7 @@
} }
}, },
error: function () { error: function () {
showError("服务器异常"); showError("{{i18n $.Lang "message.system_error"}}");
}, },
complete: function () { complete: function () {
$("#btnAddTeam").button("reset"); $("#btnAddTeam").button("reset");
@ -206,7 +206,7 @@
} }
} }
} else { } else {
alert("操作失败" + res.message); alert("{{i18n $.Lang "message.operate_failed"}}" + res.message);
} }
} }
}); });

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>成员 - Powered by MinDoc</title> <title>{{i18n $.Lang "blog.member"}} - Powered by MinDoc</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet"> <link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
@ -21,11 +21,11 @@
<div class="row"> <div class="row">
<div class="page-left"> <div class="page-left">
<ul class="menu"> <ul class="menu">
<li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a> </li> <li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> {{i18n $.Lang "blog.summary"}}</a> </li>
{{if eq .Model.RoleId 0 1}} {{if eq .Model.RoleId 0 1}}
<li class="active"><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a> </li> <li class="active"><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> {{i18n $.Lang "blog.member"}}</a> </li>
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li> <li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> {{i18n $.Lang "blog.team"}}</a> </li>
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a> </li> <li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> {{i18n $.Lang "common.setting"}}</a> </li>
{{end}} {{end}}
</ul> </ul>
@ -33,16 +33,16 @@
<div class="page-right"> <div class="page-right">
<div class="m-box"> <div class="m-box">
<div class="box-head"> <div class="box-head">
<strong class="box-title"> 成员管理</strong> <strong class="box-title"> {{i18n $.Lang "blog.member_manage"}}</strong>
{{if eq .Model.RoleId 0 1}} {{if eq .Model.RoleId 0 1}}
<button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#addBookMemberDialogModal"><i class="fa fa-user-plus" aria-hidden="true"></i> 添加成员</button> <button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#addBookMemberDialogModal"><i class="fa fa-user-plus" aria-hidden="true"></i> {{i18n $.Lang "blog.add_member"}}</button>
{{end}} {{end}}
</div> </div>
</div> </div>
<div class="box-body" id="userList"> <div class="box-body" id="userList">
<div class="users-list"> <div class="users-list">
<template v-if="lists.length <= 0"> <template v-if="lists.length <= 0">
<div class="text-center">暂无数据</div> <div class="text-center">{{i18n $.Lang "message.no_data"}}</div>
</template> </template>
<template v-else> <template v-else>
<div class="list-item" v-for="item in lists"> <div class="list-item" v-for="item in lists">
@ -51,7 +51,7 @@
<span style="font-size: 12px;color: #484848" v-if="item.real_name != ''">[${item.real_name}]</span> <span style="font-size: 12px;color: #484848" v-if="item.real_name != ''">[${item.real_name}]</span>
<div class="operate"> <div class="operate">
<template v-if="item.role_id == 0"> <template v-if="item.role_id == 0">
创始人 {{i18n $.Lang "blog.creator"}}
</template> </template>
<template v-else> <template v-else>
<template v-if="(book.role_id == 1 || book.role_id == 0) && member.member_id != item.member_id"> <template v-if="(book.role_id == 1 || book.role_id == 0) && member.member_id != item.member_id">
@ -60,22 +60,22 @@
${item.role_name} ${item.role_name}
<span class="caret"></span></button> <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="javascript:;" @click="setBookMemberRole(item.member_id,1)">管理员</a> </li> <li><a href="javascript:;" @click="setBookMemberRole(item.member_id,1)">{{i18n $.Lang "blog.administrator"}}</a> </li>
<li><a href="javascript:;" @click="setBookMemberRole(item.member_id,2)">编辑者</a> </li> <li><a href="javascript:;" @click="setBookMemberRole(item.member_id,2)">{{i18n $.Lang "blog.editor"}}</a> </li>
<li><a href="javascript:;" @click="setBookMemberRole(item.member_id,3)">观察者</a> </li> <li><a href="javascript:;" @click="setBookMemberRole(item.member_id,3)">{{i18n $.Lang "blog.observer"}}</a> </li>
</ul> </ul>
</div> </div>
<button type="button" class="btn btn-danger btn-sm" @click="removeBookMember(item.member_id)">移除</button> <button type="button" class="btn btn-danger btn-sm" @click="removeBookMember(item.member_id)">{{i18n $.Lang "common.remove"}}</button>
</template> </template>
<template v-else> <template v-else>
<template v-if="item.role_id == 1"> <template v-if="item.role_id == 1">
管理员 {{i18n $.Lang "blog.administrator"}}
</template> </template>
<template v-else-if="item.role_id == 2"> <template v-else-if="item.role_id == 2">
编辑者 {{i18n $.Lang "blog.editor"}}
</template> </template>
<template v-else-if="item.role_id == 3"> <template v-else-if="item.role_id == 3">
观察者 {{i18n $.Lang "blog.observer"}}
</template> </template>
</template> </template>
</template> </template>
@ -102,23 +102,23 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">添加成员</h4> <h4 class="modal-title" id="myModalLabel">{{i18n $.Lang "blog.add_member"}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">账号</label> <label class="col-sm-2 control-label">{{i18n $.Lang "common.account"}}</label>
<div class="col-sm-10"> <div class="col-sm-10">
{{/*<input type="text" name="account" class="form-control" placeholder="用户账号" id="account" maxlength="50">*/}} {{/*<input type="text" name="account" class="form-control" placeholder="{{i18n $.Lang "common.username"}}" id="account" maxlength="50">*/}}
<select class="js-data-example-ajax form-control" multiple="multiple" name="account" id="account"></select> <select class="js-data-example-ajax form-control" multiple="multiple" name="account" id="account"></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">角色</label> <label class="col-sm-2 control-label">{{i18n $.Lang "common.role"}}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<select name="role_id" class="form-control"> <select name="role_id" class="form-control">
<option value="1">管理员</option> <option value="1">{{i18n $.Lang "blog.administrator"}}</option>
<option value="2">编辑者</option> <option value="2">{{i18n $.Lang "blog.editor"}}</option>
<option value="3">观察者</option> <option value="3">{{i18n $.Lang "blog.observer"}}</option>
</select> </select>
</div> </div>
</div> </div>
@ -127,8 +127,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<span id="form-error-message"></span> <span id="form-error-message"></span>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="button" class="btn btn-default" data-dismiss="modal">{{i18n $.Lang "common.cancel"}}</button>
<button type="submit" class="btn btn-success" data-loading-text="保存中..." id="btnAddMember">保存</button> <button type="submit" class="btn btn-success" data-loading-text="{{i18n $.Lang "common.processing"}}" id="btnAddMember">{{i18n $.Lang "common.save"}}</button>
</div> </div>
</div> </div>
</form> </form>
@ -153,7 +153,7 @@
beforeSubmit : function () { beforeSubmit : function () {
var account = $.trim($("#account").val()); var account = $.trim($("#account").val());
if(account === ""){ if(account === ""){
return showError("账号不能为空"); return showError("{{i18n $.Lang "message.account_empty"}}");
} }
$("#btnAddMember").button("loading"); $("#btnAddMember").button("loading");
}, },
@ -171,7 +171,7 @@
$(this).find("form").html(modalCache); $(this).find("form").html(modalCache);
}).on("show.bs.modal",function () { }).on("show.bs.modal",function () {
$('.js-data-example-ajax').select2({ $('.js-data-example-ajax').select2({
language: "zh-CN", language: "{{i18n $.Lang "common.js_lang"}}",
minimumInputLength : 1, minimumInputLength : 1,
minimumResultsForSearch: Infinity, minimumResultsForSearch: Infinity,
maximumSelectionLength:1, maximumSelectionLength:1,