@model Project_Unite.Models.ForumCategory @{ ViewBag.Title = "View forum"; }

@Model.Name

@Model.Description

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

@cat.Description

@cat.Topics.Length
} } @{ var db = new Project_Unite.Models.ApplicationDbContext(); var globals = Model.Topics.Where(x => x.ShouldShow == true&&x.IsGlobal==true).OrderByDescending(x => x.StartedAt); } @if (globals.Count() > 0) {
Global announcements
Posts
Most recent post
foreach (var topic in globals) {
@if (topic.IsSticky) { } @if (topic.IsAnnounce) { } @if (topic.IsGlobal) { } @if (topic.IsUnlisted) { } @if (topic.IsLocked) { } @Html.ActionLink(topic.Subject, "ViewTopic", "Forum", new { id = topic.Discriminator }, null)

Started by @Html.UserLink(topic.AuthorId) at @topic.StartedAt • @topic.Likes.Length • @topic.Dislikes.Length

@topic.Posts.Length
@topic.Posts.OrderByDescending(x => x.PostedAt).First().Subject
by @Html.UserLink(topic.Posts.OrderByDescending(x => x.PostedAt).First().AuthorId)
at @topic.Posts.OrderByDescending(x => x.PostedAt).First().PostedAt
} }
@if (Model.Topics.Length > 0) {
Topics
Posts
Most recent post
var topics = Model.Topics.Where(x => x.ShouldShow == true).OrderByDescending(x=>x.StartedAt).ThenByDescending(x=>x.Priority); foreach(var topic in topics) {
@if (topic.IsSticky) { } @if (topic.IsAnnounce) { } @if (topic.IsGlobal) { } @if (topic.IsUnlisted) { } @if (topic.IsLocked) { } @Html.ActionLink(topic.Subject, "ViewTopic", "Forum", new { id = topic.Discriminator }, null)

Started by @Html.UserLink(topic.AuthorId) at @topic.StartedAt • @topic.Likes.Length • @topic.Dislikes.Length

@topic.Posts.Length
@topic.Posts.OrderByDescending(x => x.PostedAt).First().Subject
by @Html.UserLink(topic.Posts.OrderByDescending(x => x.PostedAt).First().AuthorId)
at @topic.Posts.OrderByDescending(x => x.PostedAt).First().PostedAt
} } else {

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

}