summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Admin/Forums.cshtml
diff options
context:
space:
mode:
Diffstat (limited to 'Project-Unite/Views/Admin/Forums.cshtml')
-rw-r--r--Project-Unite/Views/Admin/Forums.cshtml49
1 files changed, 49 insertions, 0 deletions
diff --git a/Project-Unite/Views/Admin/Forums.cshtml b/Project-Unite/Views/Admin/Forums.cshtml
new file mode 100644
index 0000000..904e3c5
--- /dev/null
+++ b/Project-Unite/Views/Admin/Forums.cshtml
@@ -0,0 +1,49 @@
+@model IEnumerable<Project_Unite.Models.ForumCategory>
+@{
+ ViewBag.Title = "Manage forums";
+ ViewBag.Modals = new Dictionary<string, string>();
+}
+
+<h2>Forums</h2>
+
+<p>The forums are a way for users to start conversations about various topics. Here you can define where users can post and what roles can post where.</p>
+
+@foreach (var cat in Model)
+{
+ <table class="table">
+ <tr>
+ <th>@cat.Name [@Html.ActionLink("Edit", "EditForum", "Admin", new { id = cat.Id }, null) | <a href="#[email protected]" data-toggle="modal" data-target="#[email protected]">Delete</a>]
+ <!-- Modal -->
+
+ </th>
+ <th>Topics</th>
+ <th>Posts</th>
+ <th>Actions</th>
+ </tr>
+ @foreach (var subcat in cat.Children)
+ {
+ <tr>
+ <td>
+ @Html.ActionLink(subcat.Name, "ViewForum", "Forum", new { id = subcat.Id }) <br />
+ <p>@subcat.Description</p>
+ </td>
+ <td>@subcat.Topics?.Count</td>
+ <td></td>
+ <td>
+ @Html.ActionLink("Edit", "EditForum", "Admin", new { id = subcat.Id }, new { @class = "btn btn-default" })
+
+ <!-- Trigger the modal with a button -->
+ <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#[email protected]">Delete</button>
+
+
+ </td>
+ </tr>
+ ViewBag.Modals.Add(subcat.Id, "/Admin/DeleteForum?id=" + subcat.Id);
+ }
+
+ </table>
+ ViewBag.Modals.Add(cat.Id, "/Admin/DeleteForum?id=" + cat.Id);
+
+}
+
[email protected]("Add category", "AddForumCategory", "Admin", null, new { @class = "btn btn-default"})