diff options
Diffstat (limited to 'Project-Unite/Views')
| -rw-r--r-- | Project-Unite/Views/Forum/ViewTopic.cshtml | 8 | ||||
| -rw-r--r-- | Project-Unite/Views/Forum/ViewUnread.cshtml | 34 |
2 files changed, 42 insertions, 0 deletions
diff --git a/Project-Unite/Views/Forum/ViewTopic.cshtml b/Project-Unite/Views/Forum/ViewTopic.cshtml index 4348518..ceeaa97 100644 --- a/Project-Unite/Views/Forum/ViewTopic.cshtml +++ b/Project-Unite/Views/Forum/ViewTopic.cshtml @@ -32,6 +32,14 @@ @foreach (var post in Model.Posts.OrderBy(x => x.PostedAt)) { + if (Request.IsAuthenticated) + { + if (ACL.IsUnread(User.Identity.GetUserId(), post.Id)) + { + ACL.MarkRead(User.Identity.GetUserId(), post.Id); + } + } + <div class="row panel panel-default"> <div class="panel-body"> <div class="col-xs-4"> <!--Mini profile data--> diff --git a/Project-Unite/Views/Forum/ViewUnread.cshtml b/Project-Unite/Views/Forum/ViewUnread.cshtml new file mode 100644 index 0000000..260999e --- /dev/null +++ b/Project-Unite/Views/Forum/ViewUnread.cshtml @@ -0,0 +1,34 @@ +@model Project_Unite.Models.ForumPost[] +@{ + ViewBag.Title = "Unread posts"; +} + +<h2>Unread Forum Posts</h2> + +<p>Here is a summary of what's been said since you last visited the forums:</p> + +<table class="table"> + <tr> + <th style="width:75%">Post</th> + <th>Actions</th> + </tr> + @if(Model.Length == 0) + { + <tr> + <td><em>No unread posts! You're all caught up :)</em></td> + <td></td> + </tr> + } + @foreach(var post in Model) + { + <tr> + <td>re: @Html.TopicLinkFor(post.Parent) <br/> + <p>By <strong>@Html.UserLink(post.AuthorId)</strong> on @post.PostedAt</p> + </td> + <td> + @Html.ActionLink("Mark as read", "MarkRead", "Forum", new { id = post.Id }, new { @class = "btn btn-default" }); + </td> + </tr> + + } +</table>
\ No newline at end of file |
