1
This commit is contained in:
@@ -28,52 +28,29 @@ namespace ZelWiki.Areas.Identity.Pages.Account.Manage
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
|
||||
/// directly from your code. This API may change or be removed in future releases.
|
||||
/// </summary>
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
|
||||
/// directly from your code. This API may change or be removed in future releases.
|
||||
/// </summary>
|
||||
|
||||
[TempData]
|
||||
public string StatusMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
|
||||
/// directly from your code. This API may change or be removed in future releases.
|
||||
/// </summary>
|
||||
public class InputModel
|
||||
{
|
||||
/// <summary>
|
||||
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
|
||||
/// directly from your code. This API may change or be removed in future releases.
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Current password")]
|
||||
public string OldPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
|
||||
/// directly from your code. This API may change or be removed in future releases.
|
||||
/// </summary>
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
|
||||
[StringLength(100, ErrorMessage = "新密码长度必须在{2}~{1}之间", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "New password")]
|
||||
public string NewPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
|
||||
/// directly from your code. This API may change or be removed in future releases.
|
||||
/// </summary>
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirm new password")]
|
||||
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
||||
[Compare("NewPassword", ErrorMessage = "两次密码输入不相符.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
}
|
||||
|
||||
@@ -82,7 +59,7 @@ namespace ZelWiki.Areas.Identity.Pages.Account.Manage
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
return NotFound($"无法加载ID为 '{_userManager.GetUserId(User)}'的用户.");
|
||||
}
|
||||
|
||||
var hasPassword = await _userManager.HasPasswordAsync(user);
|
||||
@@ -104,13 +81,13 @@ namespace ZelWiki.Areas.Identity.Pages.Account.Manage
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
return NotFound($"无法加载ID为 '{_userManager.GetUserId(User)}'的用户.");
|
||||
}
|
||||
|
||||
var profile = UsersRepository.GetAccountProfileByUserId(Guid.Parse(user.Id));
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load profile with ID '{_userManager.GetUserId(User)}'.");
|
||||
return NotFound($"无法加载ID为 '{_userManager.GetUserId(User)}'的用户.");
|
||||
}
|
||||
|
||||
var changePasswordResult = await _userManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
|
||||
@@ -129,8 +106,8 @@ namespace ZelWiki.Areas.Identity.Pages.Account.Manage
|
||||
}
|
||||
|
||||
await _signInManager.RefreshSignInAsync(user);
|
||||
_logger.LogInformation("User changed their password successfully.");
|
||||
StatusMessage = "Your password has been changed.";
|
||||
_logger.LogInformation("密码修改成功");
|
||||
StatusMessage = "密码修改成功";
|
||||
|
||||
return RedirectToPage();
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
}
|
||||
|
||||
<h3>
|
||||
Metrics
|
||||
数据矩阵
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<a href="http://NetworkDLS.com/">NetworkDLS</a> <a href="http://TightWiki.com/">TightWiki</a> version @Model.ApplicationVersion<br /><br />
|
||||
<br /><br />
|
||||
</p>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
@@ -22,13 +22,13 @@
|
||||
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
|
||||
}
|
||||
|
||||
<h2>General</h2>
|
||||
<h2>基本数据</h2>
|
||||
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><strong>Pages</strong></td>
|
||||
<td><strong>Page Revisions</strong></td>
|
||||
<td><strong>Page Attachments</strong></td>
|
||||
<td><strong>Inter-Page Links</strong></td>
|
||||
<td><strong>页面数</strong></td>
|
||||
<td><strong>页面修订数</strong></td>
|
||||
<td><strong>页面附件数</strong></td>
|
||||
<td><strong>页面间链接数</strong></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -39,10 +39,10 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><strong>Page Tags</strong></td>
|
||||
<td><strong>Page Attachment Revisions</strong></td>
|
||||
<td><strong>Page Search Tokens</strong></td>
|
||||
<td><strong>Namespaces</strong></td>
|
||||
<td><strong>页面Tags数量</strong></td>
|
||||
<td><strong>页面附件修订数</strong></td>
|
||||
<td><strong>页面搜索Token</strong></td>
|
||||
<td><strong>命名空间数</strong></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -53,15 +53,15 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><strong>Users</strong></td>
|
||||
<td><strong>Profiles</strong></td>
|
||||
<td><strong>Exceptions</strong></td>
|
||||
<td><strong>用户数量</strong></td>
|
||||
<td><strong> </strong></td>
|
||||
<td><strong>异常</strong></td>
|
||||
<td><strong> </strong></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="@GlobalConfiguration.BasePath/Admin/Accounts">@Model.Metrics.Users.ToString("N0")</a></td>
|
||||
<td><a href="@GlobalConfiguration.BasePath/Admin/Accounts">@Model.Metrics.Profiles.ToString("N0")</a></td>
|
||||
<td> </a></td>
|
||||
<td><a href="@GlobalConfiguration.BasePath/Admin/Exceptions">@Model.Metrics.Exceptions.ToString("N0")</a></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
<h2>Cache</h2>
|
||||
@Html.Raw(ZelWiki.Library.ConfirmActionHelper.GenerateWarnLink(GlobalConfiguration.BasePath,
|
||||
"Flushing the memory cache will cause any cached items to be dropped and require database hits as pages are requested. Continue?",
|
||||
"Purge Memory Cache", "/Admin/PurgeMemoryCache", Context.Request.Path.Value))
|
||||
"所有缓存将被清理,数据将会从数据库重新获取,确认继续吗?",
|
||||
"清理本地缓存", "/Admin/PurgeMemoryCache", Context.Request.Path.Value))
|
||||
<br />
|
||||
|
||||
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
}
|
||||
|
||||
<h3>
|
||||
Pages
|
||||
页面
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
All pages contained in the wiki.<br /><br />
|
||||
<br /><br />
|
||||
</p>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
@@ -24,16 +24,16 @@
|
||||
}
|
||||
|
||||
@Html.Raw(ConfirmActionHelper.GenerateWarnLink(GlobalConfiguration.BasePath,
|
||||
"This will rebuild all pages in the wiki. This could take some time! Continue?",
|
||||
"Rebuild All Pages", "/Admin/RebuildAllPages", Context.Request.Path.Value))
|
||||
"这将重建wiki中的所有页面,这可能需要一些时间. 继续吗?",
|
||||
"重新构建所有页面", "/Admin/RebuildAllPages", Context.Request.Path.Value))
|
||||
|
||||
@Html.Raw(ConfirmActionHelper.GenerateWarnLink(GlobalConfiguration.BasePath,
|
||||
"This will compile all pages in the wiki and store them in cache. This could take some time! Continue?",
|
||||
"Pre-Cache All Pages", "/Admin/PreCacheAllPages", Context.Request.Path.Value))
|
||||
"这将编译wiki中的所有页面并将其存储在缓存中,这可能需要一些时间. 继续吗?",
|
||||
"重新缓存页面", "/Admin/PreCacheAllPages", Context.Request.Path.Value))
|
||||
|
||||
@Html.Raw(ConfirmActionHelper.GenerateDangerLink(GlobalConfiguration.BasePath,
|
||||
"Truncating the page revisions will delete all the revision history for all pages and page attachments. This will leave only the most current revision of all objects. This is generally considered a big deal! Continue?",
|
||||
"Truncate Page Revisions", "/Admin/TruncatePageRevisions", Context.Request.Path.Value))
|
||||
"这将将删除所有页面和页面附件的所有修订历史记录,只保留最新版本。危险动作!!!继续吗?",
|
||||
"截断页面修订", "/Admin/TruncatePageRevisions", Context.Request.Path.Value))
|
||||
<br />
|
||||
<br />
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Name")">Name</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Revision")">Revision</a></strong></td>
|
||||
<td><strong>Deleted Revisions</strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedBy")">Modified By</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedDate")">Modified Date</a></strong></td>
|
||||
<td><strong>Action</strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Name")">名称</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Revision")">修订号</a></strong></td>
|
||||
<td><strong>删除版本</strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedBy")">修改人</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedDate")">修改时间</a></strong></td>
|
||||
<td><strong>操作</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
<td>@p.ModifiedDate</td>
|
||||
<td>
|
||||
@Html.Raw(ConfirmActionHelper.GenerateDangerLink(GlobalConfiguration.BasePath,
|
||||
$"Deleting \"{p.Name}\" will move the page, all {p.Revision} revisions and associated file attachments to the deletion queue. This action can only be undone by an administrator or moderator. Continue?",
|
||||
"Delete", "/Admin/DeletePage/" + @p.Id, Context.Request.Path.Value))
|
||||
$"即将删除 \"{p.Name}\" , 总共 {p.Revision} 个修订版和附件将移入删除队列无法恢复.继续吗?",
|
||||
"删除", "/Admin/DeletePage/" + @p.Id, Context.Request.Path.Value))
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@@ -91,7 +91,7 @@
|
||||
{
|
||||
<div class="d-flex small text-muted mb-0">
|
||||
<strong>
|
||||
Either there are no pages or your search criteria returned no results.
|
||||
暂无结果.
|
||||
</strong>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
}
|
||||
|
||||
<h3>
|
||||
Comments for <a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation">@sessionState.Page.Name</a>.
|
||||
关于页面 <a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation">@sessionState.Page.Name</a> 的评论.
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
All comment made on the given page.
|
||||
<br />
|
||||
<br />
|
||||
</p>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
@@ -29,15 +30,15 @@
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-end mb-4">
|
||||
<div class="flex-grow-1 me-2">
|
||||
<input type="text" name="Comment" id="Comment" class="form-control" placeholder="Type comment..." />
|
||||
<input type="text" name="Comment" id="Comment" class="form-control" placeholder="输入关键字" />
|
||||
</div>
|
||||
<button type="submit" value="Find" class="btn btn-primary">Post</button>
|
||||
<button type="submit" value="Find" class="btn btn-primary">搜一搜</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@:<a href="@GlobalConfiguration.BasePath/Identity/Account/Login?returnUrl=@Context.Request.Path.Value">Login to leave a comment</a>.
|
||||
@:<a href="@GlobalConfiguration.BasePath/Identity/Account/Login?returnUrl=@Context.Request.Path.Value">登录发表评论</a>.
|
||||
}
|
||||
|
||||
if (Model.Comments.Count > 0)
|
||||
@@ -72,7 +73,7 @@
|
||||
else
|
||||
{
|
||||
<div class="d-flex small text-muted mb-0">
|
||||
<strong>The page does not have any comments, why don't you add one?</strong>
|
||||
<strong>暂无评论</strong>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -13,12 +13,11 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">
|
||||
You are viewing revision @Model.Revision of "@Model.Name" modified by @Model.ModifiedByUserName on @Model.ModifiedDate.<br />
|
||||
|
||||
<a class="btn btn-success btn-thin" href="@GlobalConfiguration.BasePath/@Model.Navigation">View latest revision</a>
|
||||
您正在浏览 @Model.ModifiedByUserName 于 @Model.ModifiedDate 修改的页面"@Model.Name"修订版 @Model.Revision<br />
|
||||
<a class="btn btn-success btn-thin" href="@GlobalConfiguration.BasePath/@Model.Navigation">浏览最新版本</a>
|
||||
@if(sessionState.CanModerate)
|
||||
{
|
||||
<a class="btn btn-warning btn-thin" href="@GlobalConfiguration.BasePath/@Model.Navigation/revert/@Model.Revision">Revert to revision @Model.Revision</a>
|
||||
<a class="btn btn-warning btn-thin" href="@GlobalConfiguration.BasePath/@Model.Navigation/revert/@Model.Revision">退回至 @Model.Revision</a>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
<div class="bodyDiv">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3>Content</h3></div>
|
||||
<div class="card-header"><h3>正文</h3></div>
|
||||
<div class="card-body">
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
{
|
||||
@@ -189,8 +189,8 @@
|
||||
<br />
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary rounded-0">Save</button>
|
||||
<a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation" target="_blank" rel="noopener" class="btn btn-success rounded-0" role="button">View</a>
|
||||
<button type="submit" class="btn btn-primary rounded-0">保存</button>
|
||||
<a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation" target="_blank" rel="noopener" class="btn btn-success rounded-0" role="button">预览</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -198,12 +198,12 @@
|
||||
<br />
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header"><h3>Attachments</h3></div>
|
||||
<div class="card-header"><h3>附件</h3></div>
|
||||
<div class="card-body">
|
||||
@if (Model?.Id > 0 && @sessionState.CanCreate == true)
|
||||
{
|
||||
<div id="dropSection" class="dropSection">
|
||||
<span class="d-inline-block">Drop file attachments here or click to upload manually.</span>
|
||||
<span class="d-inline-block">将文件拖放到此处或单击手动上传.</span>
|
||||
</div>
|
||||
<input type="file" id="fileInput" style="display:none" multiple>
|
||||
<div id="uploadStatus"></div>
|
||||
@@ -211,7 +211,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>Save the page before uploading files.</div>
|
||||
<div>上传文件前,请先保存页面.</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
}
|
||||
|
||||
<h3>
|
||||
Page Revisions for <a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation">@sessionState.Page.Name</a>.
|
||||
关于页面 <a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation">@sessionState.Page.Name</a>的修订
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
All changes that have been made to the page. <br /><br />
|
||||
<br /><br />
|
||||
</p>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
@@ -30,9 +30,9 @@
|
||||
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Revision")">Revision</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedBy")">Modified By</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedDate")">Modified Date</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Revision")">修订版本</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedBy")">修改人</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "ModifiedDate")">修改时间</a></strong></td>
|
||||
<td><strong>Summary</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Reference in New Issue
Block a user