Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin design update #748

Merged
merged 26 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 51 additions & 59 deletions src/Moonglade.Web/Pages/Admin/About.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@
var process = Process.GetCurrentProcess();
}

<partial name="_DiagnosisHeader" />

<div class="ps-4 pe-4 pb-3">
<div class="row">
<table class="table table-borderless">
<thead class="table-light">
<tr>
<th colspan="2">
<i class="bi-moon-stars"></i>
@SharedLocalizer["Moonglade Configuration"]
</th>
</tr>
</thead>
<h3 class="admin-h3 mb-3">
<i class="bi-moon-stars"></i>
@SharedLocalizer["Moonglade Configuration"]
</h3>

<div class="row mb-4 rounded-3 shadow-sm border bg-white">
<table class="table table-borderless mx-1 my-1">
<tbody>
<tr>
<td class="w-25">@SharedLocalizer["Version"]</td>
Expand All @@ -47,59 +42,56 @@
</tbody>
</table>
</div>

<h3 class="admin-h3 mb-3">
<i class="bi-tools"></i>
@SharedLocalizer["Server Information"]
</h3>

<div class="row">
<table class="table table-borderless">
<thead class="table-light">
<tr>
<th colspan="2">
<i class="bi-tools"></i>
@SharedLocalizer["Server Information"]
</th>
</tr>
</thead>
<div class="row mb-4 rounded-3 shadow-sm border bg-white">
<table class="table table-borderless mx-1 my-1">
<tbody>
<tr>
<td class="w-25">@SharedLocalizer["System"]</td>
<td>@Helper.TryGetFullOSVersion() @(Environment.Is64BitOperatingSystem ? "(64-bit)" : "(32-bit)")</td>
</tr>
<tr>
<td>@SharedLocalizer["Directory"]</td>
<td>@Environment.CurrentDirectory</td>
</tr>
<tr>
<td>@SharedLocalizer["Machine Name"]</td>
<td>@Environment.MachineName</td>
</tr>
<tr>
<td>@SharedLocalizer["User Name"]</td>
<td>@Environment.UserDomainName\@Environment.UserName</td>
</tr>
<tr>
<td>@SharedLocalizer[".NET Version"]</td>
<td>@Environment.Version</td>
</tr>
<tr>
<td>@SharedLocalizer["Worker Process"]</td>
<td>[@process.Id] @process.ProcessName @(Environment.Is64BitProcess ? "(64-bit)" : "(32-bit)")</td>
</tr>
<tr>
<td>@SharedLocalizer["Start Time"]</td>
<td>@process.StartTime.ToUniversalTime() (UTC)</td>
</tr>
<tr>
<td>@SharedLocalizer["Memory"]</td>
<td>@(process.WorkingSet64 / 1024 / 1024) MB</td>
</tr>
<tr>
<td>@SharedLocalizer["Docker Container"]</td>
<td>@(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true")</td>
</tr>
<tr>
<td class="w-25">@SharedLocalizer["System"]</td>
<td>@Helper.TryGetFullOSVersion() @(Environment.Is64BitOperatingSystem ? "(64-bit)" : "(32-bit)")</td>
</tr>
<tr>
<td>@SharedLocalizer["Directory"]</td>
<td>@Environment.CurrentDirectory</td>
</tr>
<tr>
<td>@SharedLocalizer["Machine Name"]</td>
<td>@Environment.MachineName</td>
</tr>
<tr>
<td>@SharedLocalizer["User Name"]</td>
<td>@Environment.UserDomainName\@Environment.UserName</td>
</tr>
<tr>
<td>@SharedLocalizer[".NET Version"]</td>
<td>@Environment.Version</td>
</tr>
<tr>
<td>@SharedLocalizer["Worker Process"]</td>
<td>[@process.Id] @process.ProcessName @(Environment.Is64BitProcess ? "(64-bit)" : "(32-bit)")</td>
</tr>
<tr>
<td>@SharedLocalizer["Start Time"]</td>
<td>@process.StartTime.ToUniversalTime() (UTC)</td>
</tr>
<tr>
<td>@SharedLocalizer["Memory"]</td>
<td>@(process.WorkingSet64 / 1024 / 1024) MB</td>
</tr>
<tr>
<td>@SharedLocalizer["Docker Container"]</td>
<td>@(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true")</td>
</tr>
</tbody>
</table>
</div>

<a class="mt-2 mb-2" href="https://github.com/EdiWang/Moonglade/issues" target="_blank">
<a class="mb-2" href="https://github.com/EdiWang/Moonglade/issues" target="_blank">
<i class="bi-bug"></i>
Report an issue
</a>
Expand Down
26 changes: 14 additions & 12 deletions src/Moonglade.Web/Pages/Admin/BlogPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,23 @@
</script>
}

<div class="admin-toolbar ps-4 pe-4 pt-2 pb-2 border-bottom mb-3 shadow-sm">
<a class="btn btn-outline-accent" asp-page="./EditPage">
<i class="bi-plus-lg"></i>
@SharedLocalizer["New"]
</a>

<a asp-action="ExportDownload" asp-controller="DataPorting" asp-route-type="Pages" class="btn btn-outline-accent" target="_blank">
<i class="bi-upload"></i>
@SharedLocalizer["Export"]
</a>
</div>
@section admintoolbar{
<div class="admin-toolbar pb-2 border-bottom mb-3">
<a class="btn btn-outline-accent" asp-page="./EditPage">
<i class="bi-plus-lg"></i>
@SharedLocalizer["New"]
</a>

<a asp-action="ExportDownload" asp-controller="DataPorting" asp-route-type="Pages" class="btn btn-outline-accent" target="_blank">
<i class="bi-upload"></i>
@SharedLocalizer["Export"]
</a>
</div>
}

@if (pageSegments.Any())
{
<div class="ps-4 pe-4">
<div>
@Html.AntiForgeryToken()

<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-4">
Expand Down
26 changes: 14 additions & 12 deletions src/Moonglade.Web/Pages/Admin/Category.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@
</script>
}

<div class="admin-toolbar ps-4 pe-4 pt-2 pb-2 border-bottom mb-3 shadow-sm">
<a class="btn btn-outline-accent" href="javascript:initCreateCategory();">
<i class="bi-plus-lg"></i>
@SharedLocalizer["New"]
</a>

<a asp-action="ExportDownload" asp-controller="DataPorting" asp-route-type="Categories" class="btn btn-outline-accent" target="_blank">
<i class="bi-upload"></i>
@SharedLocalizer["Export"]
</a>
</div>
@section admintoolbar{
<div class="admin-toolbar pb-2 border-bottom mb-3">
<a class="btn btn-outline-accent" href="javascript:initCreateCategory();">
<i class="bi-plus-lg"></i>
@SharedLocalizer["New"]
</a>

<a asp-action="ExportDownload" asp-controller="DataPorting" asp-route-type="Categories" class="btn btn-outline-accent" target="_blank">
<i class="bi-upload"></i>
@SharedLocalizer["Export"]
</a>
</div>
}

@Html.AntiForgeryToken()

<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-4 ps-4 pe-4">
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-4">
@foreach (var cat in Model.Categories.OrderBy(m => m.DisplayName))
{
<div class="col">
Expand Down
33 changes: 16 additions & 17 deletions src/Moonglade.Web/Pages/Admin/Comments.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
<script type="module">
import * as utils from '/js/app/utils.module.js'

$(".btn-delete").click(function() {
$(".btn-delete").click(function () {
var cid = $(this).data("commentid");
callApi('/api/comment', 'DELETE', [cid],
(success) => {
document.querySelector(`#panel-comment-${cid}`).remove();
});
});

$(".btn-reply").click(function() {
$(".btn-reply").click(function () {
var cid = $(this).data("commentid");
$(`#panel-comment-${cid} .reply-ui`).show();
});

$(".btn-reply-post").click(function() {
$(".btn-reply-post").click(function () {
var cid = $(this).data("commentid");
var replyContent = $(`#replycontent-${cid}`).val();

Expand All @@ -39,7 +39,7 @@
});
});

$(".btn-approve").click(function() {
$(".btn-approve").click(function () {
callApi(`/api/comment/${$(this).data("commentid")}/approval/toggle`, 'PUT', {},
async (resp) => {
var data = await resp.json();
Expand All @@ -48,7 +48,7 @@
});
});

window.deleteSelectedComments = function() {
window.deleteSelectedComments = function () {
var cids = [];
$('.chk-cid:checked').each(function () {
cids.push($(this).data('cid'));
Expand All @@ -66,7 +66,7 @@
</script>
}

@section head{
@section head{
<style>
.mdrendered-comment-content img {
max-width: 720px;
Expand All @@ -78,15 +78,16 @@
}
</style>
}

<div class="admin-toolbar ps-4 pe-4 pt-2 pb-2 border-bottom mb-3 shadow-sm">
@section admintoolbar{
<div class="admin-toolbar pb-2 border-bottom mb-3">
<a href="javascript:window.deleteSelectedComments();" class="btn btn-outline-danger btn-delete-selected">
<i class="bi-trash"></i> @SharedLocalizer["Delete selected"]
</a>
</div>
}

<div class="ps-4 pe-4">
@if (Model.CommentDetailedItems.Count == 0)
<div>
@if (Model.CommentDetailedItems.Count == 0)
{
<div class="alert alert-info">
@SharedLocalizer["No Comments"]
Expand All @@ -96,7 +97,7 @@
{
foreach (var item in Model.CommentDetailedItems)
{
<div id="panel-comment-@item.Id" class="mb-4 row g-1">
<div id="panel-comment-@item.Id" class="p-3 mb-2 rounded-3 shadow-sm border bg-white row g-1">
<div class="form-check col-auto">
<input type="checkbox" class="form-check-input chk-cid" id="comment-item-chk-@item.Id" data-cid="@item.Id" />
<label class="form-check-label" for="comment-item-chk-@item.Id"></label>
Expand All @@ -122,17 +123,17 @@
<small class="text-muted">
<span>
<time data-utc-label="@item.CreateTimeUtc.ToString("u")">@item.CreateTimeUtc</time>
</span>
</span>
<span class="text-muted d-none d-sm-inline">(@item.IpAddress)</span>
</small>

<div class="reply-ui mt-3" style="display: none;">
<form>
<div class="mb-2">
<textarea class="form-control"
id="replycontent-@item.Id"
name="ReplyContent"
placeholder="Content" type="text"></textarea>
id="replycontent-@item.Id"
name="ReplyContent"
placeholder="Content" type="text"></textarea>
</div>

<a class="btn btn-outline-success btn-reply-post" href="#" data-commentid="@item.Id">
Expand Down Expand Up @@ -168,8 +169,6 @@
</button>
</div>
</div>

<hr />
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/Moonglade.Web/Pages/Admin/Draft.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@
</script>
}

<partial name="_PostManageHeader" />
@section admintoolbar{
<partial name="_PostManageHeader" />
}

<div class="ps-4 pe-4">
<div>
@if (posts.Any())
{
@Html.AntiForgeryToken()

@foreach (var post in posts.OrderByDescending(p => p.LastModifiedUtc))
{
<div id="post-@post.Id">
<div id="post-@post.Id" class="p-3 mb-2 rounded-3 shadow-sm border bg-white">
<div class="d-flex">
<div class="flex-grow-1">
<a asp-page="./EditPost" asp-route-id="@post.Id">
Expand All @@ -63,7 +65,6 @@
</a>
</div>
</div>
<hr />
</div>
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Moonglade.Web/Pages/Admin/EditPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
</style>
}

<div class="p-4">
<div>

<form id="page-edit-form" method="post">
<div class="row g-2">
Expand Down
3 changes: 1 addition & 2 deletions src/Moonglade.Web/Pages/Admin/EditPost.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@
</style>
}

<div class="p-4">

<div>
<form class="post-edit-form" asp-controller="Post" asp-action="CreateOrEdit">
<input type="hidden" asp-for="ViewModel.PostId" />
<input type="hidden" asp-for="ViewModel.IsPublished" />
Expand Down
Loading
Loading