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 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @model Teknik.Areas.Blog.Models.Post
  2. <script>
  3. var converter = new Markdown.getSanitizingConverter();
  4. // Title Conversion
  5. var old_post = $("#title_@Model.PostId").text();
  6. var new_post = converter.makeHtml(old_post);
  7. $("#title_@Model.PostId").html(new_post);
  8. // Post Conversion
  9. var old_post = $("#post_@Model.PostId").text();
  10. var new_post = converter.makeHtml(old_post);
  11. $("#post_@Model.PostId").html(new_post);
  12. </script>
  13. <div class="row">
  14. <div class="col-sm-10 col-sm-offset-1">
  15. <div class="blog-post">
  16. <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>
  17. <p class="blog-post-meta text-center text-muted">
  18. Posted on @Model.DatePublished.ToString("F d, Y") by <a href="@Url.Action("Index", "Profile", new { area = "Profile" })/@Model.Blog.User.Username">@Model.Blog.User.Username</a>
  19. <?php
  20. if ($own_blog)
  21. {
  22. ?>
  23. <br />
  24. <button type="button" class="btn btn-info edit_post" id="<?php echo $post_id; ?>" data-toggle="modal" data-target="#editPost">Edit</button>
  25. <?php
  26. if ($published)
  27. {
  28. ?>
  29. <button type="button" class="btn btn-warning unpublish_post" id="<?php echo $post_id; ?>">Unpublish</button>
  30. <?php
  31. }
  32. else
  33. {
  34. ?>
  35. <button type="button" class="btn btn-success publish_post" id="<?php echo $post_id; ?>">Publish</button>
  36. <?php
  37. }
  38. ?>
  39. <button type="button" class="btn btn-danger delete_post" id="<?php echo $post_id; ?>">Delete</button>
  40. <?php
  41. }
  42. ?>
  43. </p>
  44. <p id="post_@Model.PostId">@Model.Article</p>
  45. </div>
  46. </div>
  47. </div>
  48. <!-- NO POSTS -->
  49. <div class="row">
  50. <div class="col-sm-12 text-center">
  51. <h2>There are currently no articles.</h2>
  52. </div>
  53. </div>