From cdc61eb4ea5309769ad4db84d92594e4dc3dff67 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 20 Mar 2017 16:45:17 -0400 Subject: Initial commit (azure deploy test) --- Project-Unite/Views/Forum/ViewForum.cshtml | 166 +++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 Project-Unite/Views/Forum/ViewForum.cshtml (limited to 'Project-Unite/Views/Forum/ViewForum.cshtml') diff --git a/Project-Unite/Views/Forum/ViewForum.cshtml b/Project-Unite/Views/Forum/ViewForum.cshtml new file mode 100644 index 0000000..01f1d01 --- /dev/null +++ b/Project-Unite/Views/Forum/ViewForum.cshtml @@ -0,0 +1,166 @@ +@model Project_Unite.Models.ForumCategory +@{ + ViewBag.Title = "View forum"; +} + +

@Model.Name

+ +@if (Model.Parent == "root") +{ + @Html.ActionLink("Back", "Index", "Forum", null, new { @class = "btn btn-default" }) + +} +else +{ + @Html.ActionLink("Back", "ViewForum", "Forum", new { id=Model.Parent}, new { @class = "btn btn-default" }) +} + +@if(ACL.CanPost(User.Identity.Name, Model.Id)) +{ + @Html.ActionLink("New topic", "CreateTopic", "Forum", new { id=Model.Id}, new { @class = "btn btn-default" }) +} + +

@Model.Description

+ +@if (Model.Children.Length > 0) +{ + + + + + + + + @foreach (var cat in Model.Children) + { + + + + + + + } +
SubforumsTopicsPostsMost Recent Post
@Html.ActionLink(cat.Name, "ViewForum", "Forum", new { id = cat.Id }, null) +

@cat.Description

+
+ @cat.Topics.Length +
+} + +
+ +@if (Model.Topics.Length > 0) +{ + + + + + + + @{ + var stickies = Model.Topics.Where(x => x.IsSticky == true); + var stickiesSorted = stickies.OrderByDescending(x => x.StartedAt); + var topicsSorted = Model.Topics.Where(x => x.IsSticky != true).OrderByDescending(x => x.StartedAt); + } + + @foreach (var topic in stickiesSorted) + { + bool showTopic = true; + if (topic.IsUnlisted == true) + { + if(!ACL.Granted(User.Identity.Name, "CanSeeUnlistedTopics")) + { + showTopic = false; + } + } + + if (showTopic == true) + { + + + + + + } + } + @foreach (var topic in topicsSorted) + { + + bool showTopic = true; + if (topic.IsUnlisted == true) + { + if (!ACL.Granted(User.Identity.Name, "CanSeeUnlistedTopics")) + { + showTopic = false; + } + } + + if (showTopic == true) + { + + + + + + } + } + + +
TopicsPostsMost recent post
  + @if(topic.IsUnlisted == true) + { + + } + @if (topic.IsLocked == true) + { + + } + + @Html.ActionLink(topic.Subject, "ViewTopic", "Forum", new { id = topic.Discriminator }, null) +

Started by @Html.UserLink(topic.AuthorId) on @topic.StartedAt

+
+ @topic.Posts.Length + + @if (topic.Posts.Length > 0) + { + var mostRecent = topic.Posts.OrderByDescending(x => x.PostedAt).First(); + Re: @topic.Subject + by @Html.UserLink(mostRecent.AuthorId) +

at @mostRecent.PostedAt

+ } + else + { + No posts. + } +
+ @if(topic.IsUnlisted == true) + { + + } + + @if (topic.IsLocked == true) + { + + } + @Html.ActionLink(topic.Subject, "ViewTopic", "Forum", new { id = topic.Discriminator }, null) +

Started by @Html.UserLink(topic.AuthorId) on @topic.StartedAt

+
+ @topic.Posts.Length + + @if (topic.Posts.Length > 0) + { + var mostRecent = topic.Posts.OrderByDescending(x => x.PostedAt).First(); + Re: @topic.Subject + by @Html.UserLink(mostRecent.AuthorId) +

at @mostRecent.PostedAt

+ } + else + { + No posts. + } +
+} +else +{ +

No topics exist in this category. Be the first to start one!

+} \ No newline at end of file -- cgit v1.2.3