The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.

Post.cshtml 1.8KB

1234567891011121314151617181920212223242526272829303132333435
  1. @model Teknik.Areas.Blog.ViewModels.PostViewModel
  2. @using Teknik.Helpers
  3. <div class="row">
  4. <div class="col-sm-10 col-sm-offset-1">
  5. <div class="blog-post">
  6. <h2 class="blog-post-title text-center"><a href="@Url.SubRouteUrl("blog", "Blog.Post", new { username = Model.Blog.User.Username, id = Model.PostId })" id="title_@Model.PostId">@Html.Markdown(@Model.Title)</a></h2>
  7. <p class="blog-post-meta text-center text-muted">
  8. Posted on <time datetime="@Model.DatePosted.ToString("o")">@Model.DatePosted.ToString("MMMM dd, yyyy")</time>
  9. @if (!Model.System)
  10. {
  11. <text>
  12. by <a href="@Url.SubRouteUrl("user", "User.Index", new { username = Model.Blog.User.Username })">@Model.Blog.User.Username</a>
  13. </text>
  14. }
  15. @if (Model.Blog.User.Username == User.Identity.Name || User.IsInRole("Admin"))
  16. {
  17. <br />
  18. <a href="@Url.SubRouteUrl("blog", "Blog.Edit", new { username = Model.Blog.User.Username, id = Model.PostId })" role="button" class="btn btn-primary">Edit</a>
  19. if (Model.Published)
  20. {
  21. <button type="button" class="btn btn-warning unpublish_post" id="@Model.PostId">Unpublish</button>
  22. }
  23. else
  24. {
  25. <button type="button" class="btn btn-success publish_post" id="@Model.PostId">Publish</button>
  26. }
  27. <button type="button" class="btn btn-danger delete_post" id="@Model.PostId">Delete</button>
  28. }
  29. </p>
  30. <p id="post_@Model.PostId">@Html.Markdown(@Model.Article)</p>
  31. </div>
  32. </div>
  33. </div>