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.

Comment.cshtml 1.5KB

123456789101112131415161718192021222324252627282930
  1. @model Teknik.Areas.Blog.ViewModels.CommentViewModel
  2. <script>
  3. var converter = new Markdown.getSanitizingConverter();
  4. // Title Conversion
  5. var old_post = $("#title_@Model.CommentId").text();
  6. var new_post = converter.makeHtml(old_post);
  7. $("#title_@Model.CommentId").html(new_post);
  8. // Post Conversion
  9. var old_post = $("#comment_@Model.CommentId").text();
  10. var new_post = converter.makeHtml(old_post);
  11. $("#comment_@Model.CommentId").html(new_post);
  12. </script>
  13. <hr>
  14. <div class="row">
  15. <div class="col-sm-8 col-sm-offset-2">
  16. <div class="post-comment">
  17. <p class="post-comment-meta text-muted">
  18. <a href="@Url.SubRouteUrl("profile", "Profile.Index", new { username = Model.Post.Blog.User.Username })">@Model.Post.Blog.User.Username</a> replied at <time datetime="@Model.DatePosted.ToString("o")">@Model.DatePosted.ToString("HH:mm:ss tt") on @Model.DatePosted.ToString("MMMM dd, yyyy")</time>
  19. @if (Model.Post.Blog.User.Username == User.Identity.Name || User.IsInRole("Admin"))
  20. {
  21. <br />
  22. <button type="button" class="btn btn-info edit_comment" id="@Model.CommentId" data-toggle="modal" data-target="#editComment">Edit</button>
  23. <button type="button" class="btn btn-danger delete_comment" id="@Model.CommentId">Delete</button>
  24. }
  25. </p>
  26. <p id="comment_@Model.CommentId">@Model.Article</p>
  27. </div>
  28. </div>
  29. </div>