Edit and create blog posts
This commit is contained in:
parent
47431d4650
commit
44875a6a45
6 changed files with 126 additions and 1 deletions
18
Website/Views/Blog/Edit.cshtml
Normal file
18
Website/Views/Blog/Edit.cshtml
Normal file
|
@ -0,0 +1,18 @@
|
|||
@model Website.Models.BlogPostSubmission
|
||||
|
||||
@{
|
||||
ViewBag.Title = Model != null ? "Edit Post" : "New Post";
|
||||
}
|
||||
|
||||
<form method="post" action="/blog/save">
|
||||
<input type="hidden" name="id" value="@Model?.Id"/>
|
||||
<label for="postTitle">Title: </label><input name="title" id="postTitle" value="@Model?.Title"/>
|
||||
<textarea id="postContent" name="content">@Model?.Content</textarea>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
<script>
|
||||
var simpleMde = new SimpleMDE({ element: document.getElementById("postContent"), tabSize: 4 });
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue