checkpoint
This commit is contained in:
+38
-16
@@ -5,26 +5,48 @@
|
||||
ViewData["Title"] = StringValues["Messages"];
|
||||
}
|
||||
@section Head {
|
||||
<link rel="stylesheet" href="~/styles/account.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/styles/inbox.css" asp-append-version="true"/>
|
||||
}
|
||||
|
||||
@* messages are loaded as JSON from PrivateMessageController by inbox.js *@
|
||||
<section class="inbox"
|
||||
data-api="/messages"
|
||||
data-token="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken"
|
||||
data-anonymous="@StringValues["Anonymous"]"
|
||||
data-mark-read="@StringValues["MarkRead"]"
|
||||
data-read="@StringValues["Read"]"
|
||||
data-empty="@StringValues["NoMessages"]"
|
||||
data-failed="@StringValues["LoadFailed"]">
|
||||
<header class="inbox-header">
|
||||
@if (!Model.IsAdmin)
|
||||
{
|
||||
@* no account: the admin password is checked by PrivateMessageController.Login *@
|
||||
<form method="post" asp-controller="PrivateMessage" asp-action="Login" class="auth-card" data-once>
|
||||
<h1>@StringValues["Messages"]</h1>
|
||||
<label><input type="checkbox" class="inbox-unread-only"/> @StringValues["UnreadOnly"]</label>
|
||||
</header>
|
||||
<p class="inbox-status" role="status" aria-live="polite">@StringValues["Loading"]</p>
|
||||
<ol class="inbox-list"></ol>
|
||||
</section>
|
||||
<label>@StringValues["AdminPassword"]
|
||||
<input type="password" name="password" required autocomplete="current-password" autofocus/>
|
||||
</label>
|
||||
<button type="submit">@StringValues["AdminLogin"]</button>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
@* messages are loaded as JSON from PrivateMessageController by inbox.js *@
|
||||
<section class="inbox"
|
||||
data-list="/messages/list"
|
||||
data-base="/messages"
|
||||
data-token="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken"
|
||||
data-anonymous="@StringValues["Anonymous"]"
|
||||
data-mark-read="@StringValues["MarkRead"]"
|
||||
data-read="@StringValues["Read"]"
|
||||
data-empty="@StringValues["NoMessages"]"
|
||||
data-failed="@StringValues["LoadFailed"]">
|
||||
<header class="inbox-header">
|
||||
<h1>@StringValues["Messages"]</h1>
|
||||
<label><input type="checkbox" class="inbox-unread-only"/> @StringValues["UnreadOnly"]</label>
|
||||
<form method="post" asp-controller="PrivateMessage" asp-action="Logout" class="inbox-logout">
|
||||
<button type="submit">@StringValues["AdminLogout"]</button>
|
||||
</form>
|
||||
</header>
|
||||
<p class="inbox-status" role="status" aria-live="polite">@StringValues["Loading"]</p>
|
||||
<ol class="inbox-list"></ol>
|
||||
</section>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
<script src="~/scripts/inbox.js" asp-append-version="true"></script>
|
||||
@if (Model.IsAdmin)
|
||||
{
|
||||
<script src="~/scripts/inbox.js" asp-append-version="true"></script>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user