oliverbooth.dev/OliverBooth/Pages/Admin/EditBlogPost.cshtml

55 lines
2.1 KiB
Plaintext
Raw Permalink Normal View History

2024-02-26 02:50:48 +00:00
@page "/admin/blog-posts/edit/{id}"
@using Markdig
2024-03-02 01:04:42 +00:00
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using OliverBooth.Common.Data.Blog
2024-02-26 02:50:48 +00:00
@model OliverBooth.Pages.Admin.EditBlogPost
@inject MarkdownPipeline MarkdownPipeline
@{
Layout = "Shared/_AdminLayout";
ViewData["Title"] = "Edit Post";
IBlogPost post = Model.BlogPost;
}
<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-29 18:05:00 +00:00
<article id="article-preview" style="background: #333; max-width: 700px; margin: 20px auto; padding: 20px;">
<div id="editorjs"></div>
</article>
@*
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-27 00:27:14 +00:00
<table class="table">
<tr>
<th>Post ID</th>
<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>
<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">
<div class="flex-fill mb-0 highlighting-container" style="border-right: 2px dashed #FFFFFF;">
<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-29 18:05:00 +00:00
</div>*@