This commit is contained in:
Zel
2025-02-23 22:08:19 +08:00
parent e46a7ca31c
commit f664c43d35
20 changed files with 98 additions and 124 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -12,6 +12,7 @@ namespace ZelWiki.Models.ViewModels.Page
public string Navigation { get; set; } = string.Empty; public string Navigation { get; set; } = string.Empty;
[Display(Name = "描述")] [Display(Name = "描述")]
public string? Description { get; set; } = string.Empty; public string? Description { get; set; } = string.Empty;
[Display(Name = "正文")]
public string? Body { get; set; } = string.Empty; public string? Body { get; set; } = string.Empty;
} }
} }

View File

@@ -9,26 +9,26 @@ namespace ZelWiki.Models.ViewModels.Profile
public string Navigation { get; set; } = string.Empty; public string Navigation { get; set; } = string.Empty;
public Guid Id { get; set; } public Guid Id { get; set; }
[Display(Name = "Name")] [Display(Name = "用户名")]
public string AccountName { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty;
[Display(Name = "Personal Bio")] [Display(Name = "个人简介")]
public string Biography { get; set; } = string.Empty; public string Biography { get; set; } = string.Empty;
[Display(Name = "Avatar")] [Display(Name = "头像")]
[BindNever] [BindNever]
public byte[]? Avatar { get; set; } public byte[]? Avatar { get; set; }
[Required] [Required]
[Display(Name = "Country")] [Display(Name = "国家")]
public string Country { get; set; } = string.Empty; public string Country { get; set; } = string.Empty;
[Required] [Required]
[Display(Name = "Language")] [Display(Name = "语言")]
public string Language { get; set; } = string.Empty; public string Language { get; set; } = string.Empty;
[Required] [Required]
[Display(Name = "Time Zone")] [Display(Name = "时区")]
public string TimeZone { get; set; } = string.Empty; public string TimeZone { get; set; } = string.Empty;
public List<PageRevision> RecentlyModified { get; set; } = new(); public List<PageRevision> RecentlyModified { get; set; } = new();

View File

@@ -1,7 +1,7 @@
@page @page
@model ChangePasswordModel @model ChangePasswordModel
@{ @{
ViewData["Title"] = "Change password"; ViewData["Title"] = "修改密码";
ViewData["ActivePage"] = ManageNavPages.ChangePassword; ViewData["ActivePage"] = ManageNavPages.ChangePassword;
var sessionState = ViewData["SessionState"] as ZelWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); var sessionState = ViewData["SessionState"] as ZelWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
} }

View File

@@ -3,7 +3,7 @@
var sessionState = ViewData["SessionState"] as ZelWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); var sessionState = ViewData["SessionState"] as ZelWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
} }
<ul class="nav nav-pills flex-column"> <ul class="nav nav-pills flex-column">
<li class="nav-item"><a class="nav-link @ManageNavPages.ChangePasswordNavClass(ViewContext)" id="change-password" asp-page="./ChangePassword">ÐÞ¸ÄÃÜÂë</a></li> <li class="nav-item"><a class="nav-link @ManageNavPages.ChangePasswordNavClass(ViewContext)" id="change-password" asp-page="./ChangePassword">修改密码</a></li>
</ul> </ul>

View File

@@ -6,7 +6,7 @@ using ZelWiki.Repository;
namespace ZelWiki namespace ZelWiki
{ {
/// <summary> /// <summary>
/// Intercepts exceptions so that we can throw "UnauthorizedException" from controllers to simplify permissions. ///
/// </summary> /// </summary>
public class ExceptionHandlingMiddleware public class ExceptionHandlingMiddleware
{ {

View File

@@ -16,9 +16,6 @@
} }
else else
{ {
@* <li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">注册</a>
</li> *@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">登录</a> <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">登录</a>
</li> </li>

View File

@@ -25,8 +25,8 @@
} }
@Html.Raw(ZelWiki.Library.ConfirmActionHelper.GenerateWarnLink(GlobalConfiguration.BasePath, @Html.Raw(ZelWiki.Library.ConfirmActionHelper.GenerateWarnLink(GlobalConfiguration.BasePath,
"所有静态数据将会被清,确定吗?", "所有静态数据将会被清,确定吗?",
"清数据", "/Admin/PurgeCompilationStatistics", Context.Request.Path.Value)) "清数据", "/Admin/PurgeCompilationStatistics", Context.Request.Path.Value))
<br /> <br />
<br /> <br />
@@ -69,5 +69,5 @@
} }
</table> </table>
@Html.Raw(ZelWiki.Library.PageSelectorGenerator.Generate(Context.Request.QueryString, Model.PaginationPageCount)) @Html.Raw(PageSelectorGenerator.Generate(Context.Request.QueryString, Model.PaginationPageCount))
} }

View File

@@ -6,11 +6,11 @@
} }
<h3> <h3>
Configuration 系统设置
</h3> </h3>
<p> <p>
Global configuration values for the wiki, its functionality, behavior, formatting and branding.<br /><br /> <br /><br />
</p> </p>
@@ -27,7 +27,7 @@
{ {
@Html.AntiForgeryToken() @Html.AntiForgeryToken()
<div class="form-group"><button type="submit" class="btn btn-primary rounded-0">Save!</button></div> <div class="form-group"><button type="submit" class="btn btn-primary rounded-0">保存</button></div>
<br /> <br />
<br /> <br />
@@ -141,5 +141,5 @@
</div> </div>
<br /> <br />
<div class="form-group"><button type="submit" class="btn btn-primary rounded-0">Save!</button></div> <div class="form-group"><button type="submit" class="btn btn-primary rounded-0">保存</button></div>
} }

View File

@@ -6,11 +6,11 @@
} }
<h3> <h3>
Page Moderate 特殊标签页
</h3> </h3>
<p> <p>
Browse pages marked with various processing instructions to see what is in draft, pending deletion, protected, etc.<br /><br /> 浏览标有各种处理说明的页面,查看草稿、待删除、受保护等内容。<br /><br />
</p> </p>
@if (!string.IsNullOrEmpty(Model.ErrorMessage)) @if (!string.IsNullOrEmpty(Model.ErrorMessage))
@@ -29,11 +29,11 @@
<div class="col-md-6"> <div class="col-md-6">
@Html.DropDownListFor(m => m.Instruction, @Html.DropDownListFor(m => m.Instruction,
new SelectList(Model.Instructions), new SelectList(Model.Instructions),
"Select an instruction", "选择",
new { @class = "form-control", id = "instructionDropdown" }) new { @class = "form-control", id = "instructionDropdown" })
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<button type="submit" class="btn btn-primary">Refresh</button> <button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
</div> </div>
</div> </div>
@@ -44,10 +44,10 @@
<table class="table fixedTable100 table-striped" border="0" width="100%" cellspacing="0" cellpadding="0"> <table class="table fixedTable100 table-striped" border="0" width="100%" cellspacing="0" cellpadding="0">
<thead> <thead>
<tr> <tr>
<td><strong>Name</strong></td> <td><strong>名称</strong></td>
<td><strong>Revision</strong></td> <td><strong>修订</strong></td>
<td><strong>Modified By</strong></td> <td><strong>修改人</strong></td>
<td><strong>Modified Date</strong></td> <td><strong>上一次修改时间</strong></td>
</tr> </tr>
</thead> </thead>
@@ -68,7 +68,7 @@
{ {
<div class="d-flex small text-muted mb-0"> <div class="d-flex small text-muted mb-0">
<strong> <strong>
There are no pages which contain the selected processing instruction. 暂无数据
</strong> </strong>
</div> </div>
} }

View File

@@ -83,11 +83,11 @@
</div> </div>
<div class="btn-group"> <div class="btn-group">
<button class="btn btn-sm btn-outline-primary" onclick="copyToClipboard('@x.Name', this); return false;"> <button class="btn btn-sm btn-outline-primary" onclick="copyToClipboard('@x.Name', this); return false;">
<i class="bi bi-clipboard"></i> Copy Tag <i class="bi bi-clipboard"></i> 复制Tag
</button>&nbsp; </button>&nbsp;
@if (@sessionState.CanDelete == true) @if (@sessionState.CanDelete == true)
{ {
<a href="#detachLink" id="@x.FileNavigation" class="btn btn-sm btn-outline-danger">Detach</a> <a href="#detachLink" id="@x.FileNavigation" class="btn btn-sm btn-outline-danger">删除</a>
} }
</div> </div>
</div> </div>

View File

@@ -45,7 +45,7 @@
@if (ZelWiki.Models.GlobalConfiguration.EnablePageComments && ZelWiki.Models.GlobalConfiguration.ShowCommentsOnPageFooter) @if (ZelWiki.Models.GlobalConfiguration.EnablePageComments && ZelWiki.Models.GlobalConfiguration.ShowCommentsOnPageFooter)
{ {
<hr class="mt-5 mb-5"> <hr class="mt-5 mb-5">
<h2>Comments</h2> <h2>评论</h2>
} }
@if (ZelWiki.Models.GlobalConfiguration.EnablePageComments && ZelWiki.Models.GlobalConfiguration.ShowCommentsOnPageFooter) @if (ZelWiki.Models.GlobalConfiguration.EnablePageComments && ZelWiki.Models.GlobalConfiguration.ShowCommentsOnPageFooter)
{ {
@@ -55,7 +55,7 @@
<div class="container"> <div class="container">
<div class="d-flex justify-content-end mb-4"> <div class="d-flex justify-content-end mb-4">
<div class="flex-grow-1 me-2"> <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> </div>
<button type="submit" value="Post" class="btn btn-primary">Post</button> <button type="submit" value="Post" class="btn btn-primary">Post</button>
</div> </div>
@@ -64,7 +64,7 @@
} }
else 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>.
<br /> <br />
} }
} }
@@ -83,7 +83,7 @@
</div> </div>
@if (sessionState.CanModerate == true || h.UserId == sessionState.Profile?.UserId) @if (sessionState.CanModerate == true || h.UserId == sessionState.Profile?.UserId)
{ {
<a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Comments?Delete=@h.Id" class="small text-danger text-decoration-none" onclick="return confirm('Are you sure you want to delete this comment?')">Delete</a> <a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Comments?Delete=@h.Id" class="small text-danger text-decoration-none" onclick="return confirm('确定要删除此评论吗?')">Delete</a>
} }
</div> </div>
</div> </div>

View File

@@ -27,9 +27,9 @@
} }
#dropSection { #dropSection {
width: 100%; /* Makes the section fully responsive */ width: 100%;
height: auto; /* Allow the height to adjust with content */ height: auto;
min-height: 150px; /* Minimum height to allow space for content */ min-height: 150px;
border: 2px dashed #007bff; border: 2px dashed #007bff;
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
@@ -37,15 +37,15 @@
color: #007bff; color: #007bff;
margin-bottom: 20px; margin-bottom: 20px;
padding: 20px; padding: 20px;
background-color: var(--bs-card-bg); /* Uses Bootstrap background color */ background-color: var(--bs-card-bg);
word-wrap: break-word; /* Forces long words to break and wrap */ word-wrap: break-word;
white-space: normal; /* Ensures normal text wrapping */ white-space: normal;
} }
#dropSection span { #dropSection span {
display: inline-block; /* Ensure the text behaves like inline elements */ display: inline-block;
max-width: 100%; /* Restrict the width to 100% of the container */ max-width: 100%;
line-height: normal; /* Use normal line height for multi-line text */ line-height: normal;
} }
#dropSection.dragover { #dropSection.dragover {
@@ -67,41 +67,34 @@
const dropSection = document.getElementById('dropSection'); const dropSection = document.getElementById('dropSection');
const fileInput = document.getElementById('fileInput'); const fileInput = document.getElementById('fileInput');
const uploadStatus = document.getElementById('uploadStatus'); const uploadStatus = document.getElementById('uploadStatus');
// Handle dragover event
dropSection.addEventListener('dragover', (e) => { dropSection.addEventListener('dragover', (e) => {
e.preventDefault(); e.preventDefault();
dropSection.classList.add('dragover'); dropSection.classList.add('dragover');
dropSection.textContent = "Drop files here..."; dropSection.textContent = "将文件放到此处";
}); });
// Handle dragleave event
dropSection.addEventListener('dragleave', () => { dropSection.addEventListener('dragleave', () => {
dropSection.classList.remove('dragover'); dropSection.classList.remove('dragover');
dropSection.textContent = "Attach files by dropping them here or by manually selecting them below:"; dropSection.textContent = "通过将文件拖放到此处或在下面手动选择来附加文件:";
}); });
// Handle drop event
dropSection.addEventListener('drop', (e) => { dropSection.addEventListener('drop', (e) => {
e.preventDefault(); e.preventDefault();
dropSection.classList.remove('dragover'); dropSection.classList.remove('dragover');
dropSection.textContent = "Attach files by dropping them here or by manually selecting them below:"; dropSection.textContent = "通过将文件拖放到此处或在下面手动选择来附加文件:";
const files = e.dataTransfer.files; const files = e.dataTransfer.files;
handleFileUpload(files); handleFileUpload(files);
}); });
// Open file input dialog on click
dropSection.addEventListener('click', () => { dropSection.addEventListener('click', () => {
fileInput.click(); fileInput.click();
}); });
// Handle file input change (manual upload)
fileInput.addEventListener('change', () => { fileInput.addEventListener('change', () => {
const files = fileInput.files; const files = fileInput.files;
handleFileUpload(files); handleFileUpload(files);
}); });
// Function to handle file upload
function handleFileUpload(files) { function handleFileUpload(files) {
const formData = new FormData(); const formData = new FormData();
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
@@ -110,14 +103,13 @@
uploadFiles(formData); uploadFiles(formData);
} }
// Function to upload files using fetch API
function uploadFiles(formData) { function uploadFiles(formData) {
fetch('@Url.Action("UploadDragDrop", "File")/@sessionState.PageNavigationEscaped', { fetch('@Url.Action("UploadDragDrop", "File")/@sessionState.PageNavigationEscaped', {
method: 'POST', method: 'POST',
body: formData body: formData
}) })
.then(response => response.json()) // Read the response as JSON .then(response => response.json())
.then(result => { .then(result => {
if (result.success) { if (result.success) {
uploadStatus.innerHTML = `<p>Upload successful: ${result.message}</p>`; uploadStatus.innerHTML = `<p>Upload successful: ${result.message}</p>`;
@@ -151,8 +143,8 @@
@Html.HiddenFor(x => x.Id) @Html.HiddenFor(x => x.Id)
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-primary rounded-0">Save</button> <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">View</a> <a href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation" target="_blank" rel="noopener" class="btn btn-success rounded-0" role="button">预览</a>
</div> </div>
<br /> <br />
<strong>@Html.LabelFor(x => x.Name)</strong> <strong>@Html.LabelFor(x => x.Name)</strong>

View File

@@ -55,13 +55,13 @@
@if (Model.RecentlyModified.Count > 0) @if (Model.RecentlyModified.Count > 0)
{ {
<hr class="mt-5 mb-5"> <hr class="mt-5 mb-5">
<h2>Recently Modified</h2> <h2>最近修改</h2>
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0"> <table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
<thead> <thead>
<tr> <tr>
<td><strong>Page</strong></td> <td><strong>页面</strong></td>
<td><strong>Modified</strong></td> <td><strong>修改时间</strong></td>
<td><strong>Summary</strong></td> <td><strong>摘要</strong></td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -3,7 +3,7 @@
@using ZelWiki.Models @using ZelWiki.Models
@{ @{
var sessionState = ViewData["SessionState"] as SessionState ?? throw new Exception("Wiki State Context cannot be null."); var sessionState = ViewData["SessionState"] as SessionState ?? throw new Exception("Wiki State Context cannot be null.");
string navBarClass = $"navbar navbar-expand-sm navbar-toggleable-sm {(ZelWiki.Models.GlobalConfiguration.FixedMenuPosition ? "fixed-top" : "")} navbar-light bg-white border-bottom box-shadow mb-3"; var navBarClass = $"navbar navbar-expand-sm navbar-toggleable-sm {(GlobalConfiguration.FixedMenuPosition ? "fixed-top" : "")} navbar-light bg-white border-bottom box-shadow mb-3";
} }
<!DOCTYPE html> <!DOCTYPE html>
@@ -19,21 +19,21 @@
<script src="@Url.Content("~/syntax/highlight.min.js")"></script> <script src="@Url.Content("~/syntax/highlight.min.js")"></script>
<script>hljs.highlightAll();</script> <script>hljs.highlightAll();</script>
<!-- Syntax Highlighter:End --> <!-- Syntax Highlighter:End -->
@if (string.IsNullOrWhiteSpace(ZelWiki.Models.GlobalConfiguration.HTMLHeader) == false) @if (string.IsNullOrWhiteSpace(GlobalConfiguration.HTMLHeader) == false)
{ {
<!-- HTMLHeader:Begin --> <!-- HTMLHeader:Begin -->
@Html.Raw(ZelWiki.Models.GlobalConfiguration.HTMLHeader) @Html.Raw(GlobalConfiguration.HTMLHeader)
<!-- HTMLHeader:Begin --> <!-- HTMLHeader:Begin -->
} }
@if (ZelWiki.Models.GlobalConfiguration.IncludeWikiDescriptionInMeta) @if (GlobalConfiguration.IncludeWikiDescriptionInMeta)
{ {
<!-- PageDescription:Begin --> <!-- PageDescription:Begin -->
<meta name="description" content="@sessionState.Page.Description"> <meta name="description" content="@sessionState.Page.Description">
<!-- PageDescription:Begin --> <!-- PageDescription:Begin -->
} }
@if (ZelWiki.Models.GlobalConfiguration.IncludeWikiTagsInMeta) @if (GlobalConfiguration.IncludeWikiTagsInMeta)
{ {
<!-- PageTags:Begin --> <!-- PageTags:Begin -->
<meta name="keywords" content="@sessionState.PageTags"> <meta name="keywords" content="@sessionState.PageTags">
@@ -75,10 +75,10 @@
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<a class="navbar-brand" href="@GlobalConfiguration.BasePath/"><span class="glyphicon text-dark"><img src="@Url.Content(ZelWiki.Models.GlobalConfiguration.BrandImageSmall)" /> @ZelWiki.Models.GlobalConfiguration.Name</span></a> <a class="navbar-brand" href="@GlobalConfiguration.BasePath/"><span class="glyphicon text-dark"><img src="@Url.Content(GlobalConfiguration.BrandImageSmall)" /> @GlobalConfiguration.Name</span></a>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"> <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1"> <ul class="navbar-nav flex-grow-1">
@foreach (ZelWiki.Models.DataModels.MenuItem item in ZelWiki.Models.GlobalConfiguration.MenuItems) @foreach (ZelWiki.Models.DataModels.MenuItem item in GlobalConfiguration.MenuItems)
{ {
if (item.Link.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) || item.Link.StartsWith("https://", StringComparison.InvariantCultureIgnoreCase)) if (item.Link.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) || item.Link.StartsWith("https://", StringComparison.InvariantCultureIgnoreCase))
{ {
@@ -87,18 +87,18 @@
<li class="nav-item"><a class="nav-link text-dark" href="@GlobalConfiguration.BasePath@item.Link">@item.Name</a></li> <li class="nav-item"><a class="nav-link text-dark" href="@GlobalConfiguration.BasePath@item.Link">@item.Name</a></li>
} }
@if (sessionState.CanCreate == true @if (sessionState.CanCreate
|| (sessionState.ShouldCreatePage == true && sessionState.CanCreate == true) || (sessionState.ShouldCreatePage && sessionState.CanCreate )
|| (sessionState.Page.Exists == true && (sessionState.CanEdit == true || sessionState.CanModerate == true || sessionState.CanDelete == true)) || (sessionState.Page.Exists && (sessionState.CanEdit || sessionState.CanModerate || sessionState.CanDelete ))
) )
{ {
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">页面</a> <a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">页面</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
@if (sessionState.CanCreate == true) @if (sessionState.CanCreate )
{ {
if (sessionState.ShouldCreatePage == true) if (sessionState.ShouldCreatePage)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Page/Create">Create "@sessionState.PageNavigation"</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Page/Create">Create "@sessionState.PageNavigation"</a>
} }
@@ -106,37 +106,37 @@
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Page/Create">新建页面</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Page/Create">新建页面</a>
} }
@if (sessionState.Page.Exists == true) @if (sessionState.Page.Exists)
{ {
@if (sessionState.CanCreate == true) @if (sessionState.CanCreate)
{ {
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
} }
if (sessionState.CanView == true && ZelWiki.Models.GlobalConfiguration.EnablePageComments) if (sessionState.CanView && GlobalConfiguration.EnablePageComments)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Comments">评论</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Comments">评论</a>
} }
if (sessionState.CanDelete == true) if (sessionState.CanDelete)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Delete">删除 this page</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Delete">删除当前页面</a>
} }
if (sessionState.CanEdit == true && sessionState.Page.IsHistoricalVersion == false) if (sessionState.CanEdit && sessionState.Page.IsHistoricalVersion == false)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Edit">编辑</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Edit">编辑</a>
} }
if (sessionState.CanView == true) if (sessionState.CanView)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Revisions">修订</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Revisions">修订</a>
} }
if (sessionState.CanCreate == true) if (sessionState.CanCreate)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Refresh">刷新</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/Refresh">刷新</a>
} }
if (sessionState.CanModerate == true && sessionState.Page.IsHistoricalVersion == true) if (sessionState.CanModerate && sessionState.Page.IsHistoricalVersion)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/revert/@sessionState.Page.Revision">恢复至 @sessionState.Page.Revision</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation/revert/@sessionState.Page.Revision">恢复至 @sessionState.Page.Revision</a>
} }
if (sessionState.CanView == true && ZelWiki.Models.GlobalConfiguration.EnablePageComments) if (sessionState.CanView &&GlobalConfiguration.EnablePageComments)
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation">浏览</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/@sessionState.PageNavigation">浏览</a>
} }
@@ -145,10 +145,10 @@
</li> </li>
} }
@if (sessionState.IsAuthenticated == true && (sessionState.CanModerate == true || sessionState.Role == ZelWiki.Library.Constants.Roles.Administrator)) @if (sessionState.IsAuthenticated && (sessionState.CanModerate || sessionState.Role == ZelWiki.Library.Constants.Roles.Administrator))
{ {
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Admin</a> <a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">账号</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
@if (sessionState.Role == ZelWiki.Library.Constants.Roles.Administrator) @if (sessionState.Role == ZelWiki.Library.Constants.Roles.Administrator)
{ {
@@ -166,12 +166,12 @@
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/DeletedPages">删除页</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/DeletedPages">删除页</a>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/MissingPages">丢失页</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/MissingPages">丢失页</a>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/Moderate">页面说明</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/Moderate">特殊页</a>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/Namespaces">命名空间</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/Namespaces">命名空间</a>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/OrphanedPageAttachments">附件</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/OrphanedPageAttachments">附件</a>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/Pages">页面</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/Pages">页面</a>
} }
else if (sessionState.CanModerate == true) else if (sessionState.CanModerate )
{ {
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/DeletedPages">删除页面</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/DeletedPages">删除页面</a>
<a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/MissingPages">丢失页</a> <a class="dropdown-item text-dark" href="@GlobalConfiguration.BasePath/Admin/MissingPages">丢失页</a>
@@ -183,7 +183,7 @@
</li> </li>
} }
@if (sessionState.IsAuthenticated == true) @if (sessionState.IsAuthenticated)
{ {
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">我</a> <a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">我</a>
@@ -201,7 +201,7 @@
<li class="nav-item"><a class="nav-link text-dark" href="@GlobalConfiguration.BasePath/Identity/Account/Login?returnUrl=@UrlEncoder.Default.Encode($"{GlobalConfiguration.BasePath}{Context.Request.Path.Value}")">登录</a></li> <li class="nav-item"><a class="nav-link text-dark" href="@GlobalConfiguration.BasePath/Identity/Account/Login?returnUrl=@UrlEncoder.Default.Encode($"{GlobalConfiguration.BasePath}{Context.Request.Path.Value}")">登录</a></li>
} }
@if (ZelWiki.Models.GlobalConfiguration.IncludeSearchOnNavbar) @if (GlobalConfiguration.IncludeSearchOnNavbar)
{ {
<li class="nav-item ms-auto d-none d-lg-block"> <li class="nav-item ms-auto d-none d-lg-block">
<div class="collapse navbar-collapse justify-content-end"> <div class="collapse navbar-collapse justify-content-end">
@@ -218,23 +218,23 @@
</nav> </nav>
</header> </header>
<div class="container" @(ZelWiki.Models.GlobalConfiguration.FixedMenuPosition ? "style=margin-top:80px;" : "")> <div class="container" @(GlobalConfiguration.FixedMenuPosition ? "style=margin-top:80px;" : "")>
<main role="main" class="pb-3"> <main role="main" class="pb-3">
@Html.Raw(ZelWiki.Models.GlobalConfiguration.HTMLPreBody) @Html.Raw(GlobalConfiguration.HTMLPreBody)
@if (ZelWiki.Repository.UsersRepository.AdminPasswordStatus() != ZelWiki.Library.Constants.AdminPasswordChangeState.HasBeenChanged) @if (ZelWiki.Repository.UsersRepository.AdminPasswordStatus() != ZelWiki.Library.Constants.AdminPasswordChangeState.HasBeenChanged)
{ {
<div class="card bg-warning mb-3"> <div class="card bg-warning mb-3">
<div class="card-header"><strong>Default password has not been changed</strong></div> <div class="card-header"><strong>初始密码未修改</strong></div>
<div class="card-body"> <div class="card-body">
<p class="card-text"> <p class="card-text">
管理密码为默认值,<i>建议</i> 您立即更换!<br /> 管理密码为默认值,<i>建议</i> 您立即更换!<br />
<br /> <br />
您可以登录账号后, 导航至 “我的” -&gt; “账号” -&gt; “密码”来更换密码<br /> 您可以登录账号后, 导航至 “我的” -&gt; “账号” -&gt; “密码”来更换密码<br />
<br /> <br />
<strong>Current admin login:</strong><br /> <strong>当前管理账号登录:</strong><br />
&nbsp;&nbsp;&nbsp;<strong>Username:</strong>"admin@tightwiki.com"<br /> &nbsp;&nbsp;&nbsp;<strong>账号:</strong>"admin@ipangci.com"<br />
&nbsp;&nbsp;&nbsp;<strong>Password:</strong>"@ZelWiki.Library.Constants.DEFAULTPASSWORD"<br /> &nbsp;&nbsp;&nbsp;<strong>密码:</strong>"@ZelWiki.Library.Constants.DEFAULTPASSWORD"<br />
<br /> <br />
</p> </p>
</div> </div>
@@ -242,26 +242,27 @@
} }
@RenderBody() @RenderBody()
@Html.Raw(ZelWiki.Models.GlobalConfiguration.HTMLPostBody) @Html.Raw(GlobalConfiguration.HTMLPostBody)
</main> </main>
</div> </div>
<div class="container"> <div class="container">
@if (ZelWiki.Models.GlobalConfiguration.FooterBlurb != null || ZelWiki.Models.GlobalConfiguration.Copyright != null) @if (GlobalConfiguration.FooterBlurb != null || GlobalConfiguration.Copyright != null)
{ {
<hr class="mt-5 mb-5"> <hr class="mt-5 mb-5">
@if (ZelWiki.Models.GlobalConfiguration.FooterBlurb != null) @if (GlobalConfiguration.FooterBlurb != null)
{ {
@Html.Raw(ZelWiki.Models.GlobalConfiguration.FooterBlurb) @Html.Raw(GlobalConfiguration.FooterBlurb)
} }
@if (ZelWiki.Models.GlobalConfiguration.Copyright != null) @if (GlobalConfiguration.Copyright != null)
{ {
<br /> <br />
@Html.Raw(ZelWiki.Models.GlobalConfiguration.Copyright) @Html.Raw(GlobalConfiguration.Copyright)
} }
} }
@Html.Raw(ZelWiki.Models.GlobalConfiguration.HTMLFooter)
@Html.Raw(GlobalConfiguration.HTMLFooter)
</div> </div>
</body> </body>

View File

@@ -1,20 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
/*
* =====================================================================================
*
* Filename: mode/tightwiki/tightwiki.js
*
* Description: CodeMirror mode for tightwiki
*
* Created: 10/30/2022
*
* Author: Josh Patterson
* Company: NetworkDLS
*
* =====================================================================================
*/
(function (mod) { (function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS if (typeof exports == "object" && typeof module == "object") // CommonJS