summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Forum/Index.cshtml
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-17 09:52:57 -0400
committerMichael <[email protected]>2017-05-17 09:52:57 -0400
commit7e54c9b3fad48c7bce1134f7937924f120f1999c (patch)
treef922e35184e7e9f0cc90d0dc11f4541a414d35bd /Project-Unite/Views/Forum/Index.cshtml
parent1abd027bdbd55fac59ad5bcdd8df301bb2499204 (diff)
downloadproject-unite-7e54c9b3fad48c7bce1134f7937924f120f1999c.tar.gz
project-unite-7e54c9b3fad48c7bce1134f7937924f120f1999c.tar.bz2
project-unite-7e54c9b3fad48c7bce1134f7937924f120f1999c.zip
More fixes, specifically with forum
Diffstat (limited to 'Project-Unite/Views/Forum/Index.cshtml')
-rw-r--r--Project-Unite/Views/Forum/Index.cshtml28
1 files changed, 24 insertions, 4 deletions
diff --git a/Project-Unite/Views/Forum/Index.cshtml b/Project-Unite/Views/Forum/Index.cshtml
index 8e26c24..b579eeb 100644
--- a/Project-Unite/Views/Forum/Index.cshtml
+++ b/Project-Unite/Views/Forum/Index.cshtml
@@ -2,12 +2,16 @@
@{
ViewBag.Title = "Forums";
+ bool noForums = true;
}
<h2>Welcome to the forums.</h2>
@foreach (var cat in Model)
{
+ if (ACL.CanSee(User?.Identity?.Name, cat.Id))
+ {
+ noForums = false;
<table class="table">
<tr>
<th>@cat.Name</th>
@@ -16,16 +20,21 @@
<th>Most Recent Post</th>
</tr>
@foreach (var subcat in cat.Children)
- {
+ {
+ if (ACL.CanSee(User?.Identity?.Name, subcat.Id))
+ {
<tr>
<td>@Html.ActionLink(subcat.Name, "ViewForum", "Forum", new { id = subcat.Id }, null) <br/>
<p>@subcat.Description</p>
- @if(subcat.Children.Length > 0)
+ @if (subcat.Children.Length > 0)
{
<p><strong>Subforums: </strong>
- @foreach(var subfrm in subcat.Children)
+ @foreach (var subfrm in subcat.Children)
{
+ if (ACL.CanSee(User?.Identity?.Name, subfrm.Id))
+ {
<em> @Html.ActionLink(subfrm.Name, "ViewForum", "Forum", new { id = subfrm.Id }, null)&nbsp;</em>
+ }
}
</p>
}
@@ -34,6 +43,17 @@
<td></td>
<td></td>
</tr>
- }
+ }
+ }
</table>
+ }
+}
+
+@if(noForums == true)
+{
+ <div class="panel panel-danger">
+ <div class="panel-body">
+ <p><span class="glyphicon glyphicon-ban-circle"></span> <strong>No forums to show!</strong> There are no forums that you have read access to. If you are a guest, please @Html.ActionLink("log in", "Login", "Account"). If not, please contact an admin.</p>
+ </div>
+ </div>
} \ No newline at end of file