diff --git a/NotificationsWeb/Api/NotificationsController.cs b/NotificationsWeb/Api/NotificationsController.cs index 5142ee37..f29ebd8e 100644 --- a/NotificationsWeb/Api/NotificationsController.cs +++ b/NotificationsWeb/Api/NotificationsController.cs @@ -7,12 +7,12 @@ namespace NotificationsWeb.Api public class NotificationsController:UmbracoApiController { [HttpGet] - public string SubscribeToForumTopic(int topicId) + public string SubscribeToForumTopic(int id) { var currentMemberId = Members.GetCurrentMember().Id; if (currentMemberId > 0) { - BusinessLogic.ForumTopic.Subscribe(topicId, currentMemberId); + BusinessLogic.ForumTopic.Subscribe(id, currentMemberId); return "true"; } @@ -21,12 +21,12 @@ namespace NotificationsWeb.Api } [HttpGet] - public string UnSubscribeFromForumTopic(int topicId) + public string UnSubscribeFromForumTopic(int id) { var currentMemberId = Members.GetCurrentMember().Id; if (currentMemberId > 0) { - BusinessLogic.ForumTopic.UnSubscribe(topicId, currentMemberId); + BusinessLogic.ForumTopic.UnSubscribe(id, currentMemberId); return "true"; } @@ -35,12 +35,12 @@ namespace NotificationsWeb.Api } [HttpGet] - public string SubscribeToForum(int forumId) + public string SubscribeToForum(int id) { var currentMemberId = Members.GetCurrentMember().Id; if (currentMemberId > 0) { - BusinessLogic.Forum.Subscribe(forumId, currentMemberId); + BusinessLogic.Forum.Subscribe(id, currentMemberId); return "true"; } @@ -49,12 +49,12 @@ namespace NotificationsWeb.Api } [HttpGet] - public string UnSubscribeFromForum(int forumId) + public string UnSubscribeFromForum(int id) { var currentMemberId = Members.GetCurrentMember().Id; if (currentMemberId > 0) { - BusinessLogic.Forum.UnSubscribe(forumId, currentMemberId); + BusinessLogic.Forum.UnSubscribe(id, currentMemberId); return "true"; } diff --git a/OurUmbraco.Site/Assets/js/community.js b/OurUmbraco.Site/Assets/js/community.js index 7f44fe57..5eed9267 100644 --- a/OurUmbraco.Site/Assets/js/community.js +++ b/OurUmbraco.Site/Assets/js/community.js @@ -40,12 +40,12 @@ }); }, - followThread: function (id) { - $.get("/umbraco/api/Notifications/SubscribeToForumTopic/?topicId=" + id); + follow: function (id,controller) { + $.get("/umbraco/api/Notifications/SubscribeToForum"+controller+"/?id=" + id); }, - unfollowThread: function (id) { - $.get("/umbraco/api/Notifications/UnSubscribeFromForumTopic/?topicId=" + id); + unfollow: function (id,controller) { + $.get("/umbraco/api/Notifications/UnSubscribeFromForum"+controller+"/?id=" + id); }, markAsSpam: function (id,controller) { @@ -197,15 +197,16 @@ $(function () { e.preventDefault(); var data = $(this).data(); var id = parseInt(data.id); + var controller = data.controller; if ($(this).hasClass("following")) { - community.unfollowThread(id); + community.unfollow(id,controller); $(this).removeClass("following"); $("span", $(this)).text("Follow"); } else { - community.followThread(id); + community.follow(id,controller); $(this).addClass("following"); $("span", $(this)).text("Following"); } diff --git a/OurUmbraco.Site/OurUmbraco.Site.csproj b/OurUmbraco.Site/OurUmbraco.Site.csproj index 217b56f7..b8eccb5e 100644 --- a/OurUmbraco.Site/OurUmbraco.Site.csproj +++ b/OurUmbraco.Site/OurUmbraco.Site.csproj @@ -1797,6 +1797,7 @@ + diff --git a/OurUmbraco.Site/Views/MacroPartials/Forum/ForumActions.cshtml b/OurUmbraco.Site/Views/MacroPartials/Forum/ForumActions.cshtml new file mode 100644 index 00000000..f2eb6842 --- /dev/null +++ b/OurUmbraco.Site/Views/MacroPartials/Forum/ForumActions.cshtml @@ -0,0 +1,28 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + + + Create new + + +@if (Members.IsLoggedIn()) +{ + + var mem = Members.GetCurrentMember(); + + var subscribed = NotificationsWeb.Library.Utils.IsSubscribedToForum(CurrentPage.Id, mem.Id); + + if (CurrentPage.Level == 4) { + if (subscribed) + { + + } + else + { + + } + } +} diff --git a/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml b/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml index 560bcd98..5f907b3e 100644 --- a/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml +++ b/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml @@ -15,12 +15,12 @@ if (subscribed) { - } else { - } diff --git a/OurUmbraco.Site/masterpages/Forum.master b/OurUmbraco.Site/masterpages/Forum.master index 1cbdef17..6d775211 100644 --- a/OurUmbraco.Site/masterpages/Forum.master +++ b/OurUmbraco.Site/masterpages/Forum.master @@ -9,10 +9,10 @@ + + + - - Create new -