summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Forum/Index.cshtml
diff options
context:
space:
mode:
Diffstat (limited to 'Project-Unite/Views/Forum/Index.cshtml')
-rw-r--r--Project-Unite/Views/Forum/Index.cshtml39
1 files changed, 39 insertions, 0 deletions
diff --git a/Project-Unite/Views/Forum/Index.cshtml b/Project-Unite/Views/Forum/Index.cshtml
new file mode 100644
index 0000000..8e26c24
--- /dev/null
+++ b/Project-Unite/Views/Forum/Index.cshtml
@@ -0,0 +1,39 @@
+@model IEnumerable<Project_Unite.Models.ForumCategory>
+
+@{
+ ViewBag.Title = "Forums";
+}
+
+<h2>Welcome to the forums.</h2>
+
+@foreach (var cat in Model)
+{
+ <table class="table">
+ <tr>
+ <th>@cat.Name</th>
+ <th>Topics</th>
+ <th>Posts</th>
+ <th>Most Recent Post</th>
+ </tr>
+ @foreach (var subcat in cat.Children)
+ {
+ <tr>
+ <td>@Html.ActionLink(subcat.Name, "ViewForum", "Forum", new { id = subcat.Id }, null) <br/>
+ <p>@subcat.Description</p>
+ @if(subcat.Children.Length > 0)
+ {
+ <p><strong>Subforums: </strong>
+ @foreach(var subfrm in subcat.Children)
+ {
+ <em> @Html.ActionLink(subfrm.Name, "ViewForum", "Forum", new { id = subfrm.Id }, null)&nbsp;</em>
+ }
+ </p>
+ }
+ </td>
+ <td>@subcat.Topics.Length</td>
+ <td></td>
+ <td></td>
+ </tr>
+ }
+ </table>
+} \ No newline at end of file