diff options
| author | Michael <[email protected]> | 2017-03-27 16:11:39 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-27 16:11:39 -0400 |
| commit | 32e2eecdd4904383df6c377cb3ea64f8f0a8f1e4 (patch) | |
| tree | f2a465f61c7ebdc971cff20e905a749696f9f253 /Project-Unite/Views | |
| parent | 93734dd552b9c95da23b517ea1f65854f22c68f6 (diff) | |
| download | project-unite-32e2eecdd4904383df6c377cb3ea64f8f0a8f1e4.tar.gz project-unite-32e2eecdd4904383df6c377cb3ea64f8f0a8f1e4.tar.bz2 project-unite-32e2eecdd4904383df6c377cb3ea64f8f0a8f1e4.zip | |
Finish unread posts
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 |
