2024-02-26 02:50:48 +00:00
|
|
|
@page "/admin/blog-posts/edit/{id}"
|
|
|
|
@using Markdig
|
|
|
|
@using OliverBooth.Data.Blog
|
|
|
|
@model OliverBooth.Pages.Admin.EditBlogPost
|
|
|
|
@inject MarkdownPipeline MarkdownPipeline
|
|
|
|
|
|
|
|
@{
|
|
|
|
Layout = "Shared/_AdminLayout";
|
|
|
|
ViewData["Title"] = "Edit Post";
|
|
|
|
IBlogPost post = Model.BlogPost;
|
|
|
|
}
|
|
|
|
|
2024-02-28 16:04:56 +00:00
|
|
|
<component type="typeof(MarkdownEditor)" render-mode="Server"/>
|
|
|
|
|
2024-02-26 02:50:48 +00:00
|
|
|
<input type="hidden" data-blog-pid="@post.Id">
|
|
|
|
|
2024-02-27 00:27:14 +00:00
|
|
|
<div class="d-flex flex-column" style="height: calc(100vh - 35px)">
|
|
|
|
<div class="mb-3">
|
|
|
|
<button id="save-button" class="btn btn-primary"><i class="fa-solid fa-floppy-disk fa-fw"></i> Save <span class="text-muted">(Ctrl+S)</span></button>
|
|
|
|
<a href="/blog/@post.Published.ToString(@"yyyy\/MM\/dd")/@post.Slug" target="_blank" class="btn btn-info"><i class="fa-solid fa-magnifying-glass"></i> Preview</a>
|
|
|
|
</div>
|
2024-02-26 17:43:58 +00:00
|
|
|
|
2024-02-27 00:27:14 +00:00
|
|
|
<table class="table">
|
|
|
|
<tr>
|
|
|
|
<th>Post ID</th>
|
2024-02-28 16:04:56 +00:00
|
|
|
<td>
|
|
|
|
<input class="form-control" type="text" value="@post.Id" disabled="disabled">
|
|
|
|
</td>
|
2024-02-27 00:27:14 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Title</th>
|
2024-02-28 16:04:56 +00:00
|
|
|
<td>
|
|
|
|
<input class="form-control" id="post-title" type="text" value="@post.Title">
|
|
|
|
</td>
|
2024-02-27 00:27:14 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2024-02-26 02:50:48 +00:00
|
|
|
|
2024-02-27 00:27:14 +00:00
|
|
|
<div class="d-flex flex-row flex-fill">
|
2024-02-27 12:48:33 +00:00
|
|
|
<div class="flex-fill mb-0 highlighting-container" style="border-right: 2px dashed #FFFFFF;">
|
2024-02-27 16:08:55 +00:00
|
|
|
<textarea id="content" class="tab-support" spellcheck="false">@post.Body</textarea>
|
2024-02-27 00:27:14 +00:00
|
|
|
<pre id="highlighting" aria-hidden="true"><code id="highlighting-content" class="language-markdown">@post.Body</code></pre>
|
|
|
|
</div>
|
|
|
|
<div class="flex-fill mb-0" style="overflow-y: scroll; background: #1E1E1E; max-height: calc(100vh - 35px)">
|
|
|
|
<article id="article-preview" style="background: #333; max-width: 700px; margin: 20px auto; padding: 20px;">
|
|
|
|
@Html.Raw(Markdown.ToHtml(post.Body, MarkdownPipeline))
|
|
|
|
</article>
|
|
|
|
</div>
|
2024-02-26 02:50:48 +00:00
|
|
|
</div>
|
2024-02-28 16:04:56 +00:00
|
|
|
</div>
|