The next generation of the Teknik Services. Written in ASP.NET.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.9 KiB

@model Teknik.Areas.Blog.ViewModels.PostViewModel
var converter = new Markdown.getSanitizingConverter();
// Title Conversion
var old_post = $("#title_@Model.PostId").text();
var new_post = converter.makeHtml(old_post);
// Post Conversion
var old_post = $("#post_@Model.PostId").text();
var new_post = converter.makeHtml(old_post);
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="blog-post">
<h2 class="blog-post-title text-center"><a href="@Url.Action("Post", "Blog", new { area = "Blog", username = Model.Blog.User.Username, id = Model.PostId })" id="title_@Model.PostId">@Model.Title</a></h2>
<p class="blog-post-meta text-center text-muted">
Posted on @Model.DatePublished.ToString("MMMM dd, yyyy") by <a href="@Url.Action("Index", "Profile", new { area = "Profile", username = Model.Blog.User.Username })">@Model.Blog.User.Username</a>
@if (Model.Blog.User.Username == User.Identity.Name)
<br />
<button type="button" class="btn btn-info edit_post" id="@Model.PostId" data-toggle="modal" data-target="#editPost">Edit</button>
if (Model.Published)
<button type="button" class="btn btn-warning unpublish_post" id="@Model.PostId">Unpublish</button>
<button type="button" class="btn btn-success publish_post" id="@Model.PostId">Publish</button>
<button type="button" class="btn btn-danger delete_post" id="@Model.PostId">Delete</button>
<p id="post_@Model.PostId">@Model.Article</p>