diff --git a/OurUmbraco.Site/Assets/js/community.js b/OurUmbraco.Site/Assets/js/community.js index 390c7bcd..5de616e8 100644 --- a/OurUmbraco.Site/Assets/js/community.js +++ b/OurUmbraco.Site/Assets/js/community.js @@ -7,6 +7,18 @@ highFiveComment: function (id) { $.get("/umbraco/api/Powers/Action/?alias=LikeComment&pageId=" + id); + }, + + deleteComment: function (id) { + + $.ajax({ + url: "/umbraco/api/Forum/Comment/" + id, + type: 'DELETE', + success: function (result) { + // Do something with the result + } + }); + } }; }(); @@ -17,7 +29,7 @@ $(function () { /*FORUM*/ //Mark as solution - $(".comment").on("click","a.solved",function (e) { + $(".comments").on("click","a.solved",function (e) { e.preventDefault(); var data = $(this).data(); var id = parseInt(data.id); @@ -41,4 +53,14 @@ $(function () { $(".highfive-count", cont).html(count); }); + + //Delete comment + $(".comments").on("click", "a.delete-reply", function (e) { + e.preventDefault(); + var data = $(this).data(); + var id = parseInt(data.id); + community.deleteComment(id); + $(this).closest(".comment").slideUp( function () { $(this).closest(".comment").remove(); }); + + }); }); diff --git a/OurUmbraco.Site/Views/MacroPartials/Forum/TopicForm.cshtml b/OurUmbraco.Site/Views/MacroPartials/Forum/TopicForm.cshtml index 97122fcf..a2d51cd5 100644 --- a/OurUmbraco.Site/Views/MacroPartials/Forum/TopicForm.cshtml +++ b/OurUmbraco.Site/Views/MacroPartials/Forum/TopicForm.cshtml @@ -94,6 +94,11 @@ Copy Link + + + Delete post + + Reply diff --git a/OurUmbraco.Site/Views/Partials/Forum/Comment.cshtml b/OurUmbraco.Site/Views/Partials/Forum/Comment.cshtml index e97cbf20..b322692b 100644 --- a/OurUmbraco.Site/Views/Partials/Forum/Comment.cshtml +++ b/OurUmbraco.Site/Views/Partials/Forum/Comment.cshtml @@ -86,7 +86,7 @@ } - + Delete post @@ -100,4 +100,12 @@ } + else + { +
+ + Copy Link + +
+ } \ No newline at end of file diff --git a/OurUmbraco.Site/Views/Partials/Forum/Question.cshtml b/OurUmbraco.Site/Views/Partials/Forum/Question.cshtml index ab741179..76fe3aec 100644 --- a/OurUmbraco.Site/Views/Partials/Forum/Question.cshtml +++ b/OurUmbraco.Site/Views/Partials/Forum/Question.cshtml @@ -54,10 +54,6 @@ Reply - - Delete post - - Mark as spam