From 35f6de168641142636f28b46ee341b821aa2301a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Sun, 22 Jan 2017 16:40:35 +0100 Subject: [PATCH] ForumTopicActions to partial from macro --- OurUmbraco.Site/OurUmbraco.Site.csproj | 2 +- OurUmbraco.Site/Views/DisplayTopic.cshtml | 2 +- .../MacroPartials/Forum/TopicActions.cshtml | 50 ------------------- .../Views/Partials/Forum/TopicActions.cshtml | 39 +++++++++++++++ 4 files changed, 41 insertions(+), 52 deletions(-) delete mode 100644 OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml create mode 100644 OurUmbraco.Site/Views/Partials/Forum/TopicActions.cshtml diff --git a/OurUmbraco.Site/OurUmbraco.Site.csproj b/OurUmbraco.Site/OurUmbraco.Site.csproj index ff70d39f..680887c1 100644 --- a/OurUmbraco.Site/OurUmbraco.Site.csproj +++ b/OurUmbraco.Site/OurUmbraco.Site.csproj @@ -1697,7 +1697,6 @@ - @@ -4366,6 +4365,7 @@ + web.config diff --git a/OurUmbraco.Site/Views/DisplayTopic.cshtml b/OurUmbraco.Site/Views/DisplayTopic.cshtml index 2fa94169..539ce909 100644 --- a/OurUmbraco.Site/Views/DisplayTopic.cshtml +++ b/OurUmbraco.Site/Views/DisplayTopic.cshtml @@ -11,7 +11,7 @@ @Html.Action("Render", "Breadcrumb", new { linkToCurrent = true }) - @Umbraco.RenderMacro("ForumTopicActions") + @Html.Partial("~/Views/Partials/Forum/TopicActions.cshtml")
diff --git a/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml b/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml deleted file mode 100644 index 1247ad7a..00000000 --- a/OurUmbraco.Site/Views/MacroPartials/Forum/TopicActions.cshtml +++ /dev/null @@ -1,50 +0,0 @@ -@using OurUmbraco.Forum.Extensions -@using OurUmbraco.Forum.Services -@using OurUmbraco.NotificationsWeb.Library -@inherits Umbraco.Web.Macros.PartialViewMacroPage -@{ - var topicService = new TopicService(ApplicationContext.DatabaseContext); - var topic = topicService.CurrentTopic(this.Context, ApplicationContext.ApplicationCache.RequestCache); -} - -
- @if(topic != null) - { - if (Members.IsLoggedIn()) - { - var mem = Members.GetCurrentMember(); - var subscribed = false; - if (mem != null) - { - subscribed = Utils.IsSubscribedToForumTopic(topic.Id, mem.Id); - } - - if (Members.IsAdmin()) - { - - Delete thread - - } - - if (subscribed) - { - - } - else - { - - } - } - - if (topic.Answer > 0) - { - - Go to solution - - } - } -
\ No newline at end of file diff --git a/OurUmbraco.Site/Views/Partials/Forum/TopicActions.cshtml b/OurUmbraco.Site/Views/Partials/Forum/TopicActions.cshtml new file mode 100644 index 00000000..ed908149 --- /dev/null +++ b/OurUmbraco.Site/Views/Partials/Forum/TopicActions.cshtml @@ -0,0 +1,39 @@ +@using OurUmbraco.Forum.Services +@using OurUmbraco.NotificationsWeb.Library +@inherits OurUmbraco.Our.Models.OurUmbracoTemplatePage +@{ + var topicService = new TopicService(ApplicationContext.DatabaseContext); + var topic = topicService.CurrentTopic(Context, ApplicationContext.ApplicationCache.RequestCache); +} + +
+ @if (topic != null) + { + if (MemberData != null) + { + var subscribed = false; + if (MemberData != null) + { + subscribed = Utils.IsSubscribedToForumTopic(topic.Id, MemberData.Member.Id); + } + + if (MemberData.IsAdmin) + { + + Delete thread + + } + + + } + + if (topic.Answer > 0) + { + + Go to solution + + } + } +
\ No newline at end of file