From 733b545c40d33ba23077c7d2fb5e847208475fb3 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 17 May 2017 10:20:54 -0400 Subject: [PATCH] Start ViewTopic revamp --- Project-Unite/Content/Site.css | 4 +++ Project-Unite/Views/Forum/ViewTopic.cshtml | 39 +++++++++------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/Project-Unite/Content/Site.css b/Project-Unite/Content/Site.css index fa3b04e..de84403 100644 --- a/Project-Unite/Content/Site.css +++ b/Project-Unite/Content/Site.css @@ -2,6 +2,10 @@ /* padding-top: 50px; */ padding-bottom: 20px; } +/*make avatars rounded*/ +.avatar { + border-radius: 100%; +} /* Set padding to keep content from hitting the edges */ .body-content { diff --git a/Project-Unite/Views/Forum/ViewTopic.cshtml b/Project-Unite/Views/Forum/ViewTopic.cshtml index 97b3918..35607e0 100644 --- a/Project-Unite/Views/Forum/ViewTopic.cshtml +++ b/Project-Unite/Views/Forum/ViewTopic.cshtml @@ -5,15 +5,6 @@ ViewBag.Title = Model.Subject; } -@if(ViewBag.Error != null) -{ -
-
-

@ViewBag.Error

-
-
-} - @if(Model.IsUnlisted == true) {
@@ -27,10 +18,6 @@

Started by @Html.UserLink(Model.AuthorId) at @Model.StartedAt

-@{ - Html.RenderPartial("~/Views/Shared/_ModeratorBar.cshtml", Model); -} - @foreach (Project_Unite.Models.ForumPost post in PaginationExtensions.GetItemsOnPage(Model.Posts.OrderBy(x => x.PostedAt).ToArray(), ViewBag.Page, ViewBag.PageSize)) { if (Request.IsAuthenticated) @@ -44,20 +31,17 @@
-
+
@Html.UserLink(post.AuthorId)
@{ var user = ACL.GetUserInfo(post.AuthorId);

@user.Codepoints Codepoints

@user.HighestRole.Name

- @if (ACL.Granted(User.Identity.Name, "CanAccessModCP")) - { - if (ACL.Granted(User.Identity.Name, "CanViewUserInfo")) + @if (User?.Identity?.IsModerator()==true) { @Html.ActionLink("User info", "UserDetails", "Moderator", new { id = ACL.UserNameRaw(post.AuthorId) }, new { @class = "btn btn-default" }) } - }

}
@@ -65,18 +49,25 @@

@Model.Subject

@Html.UserLink(post.AuthorId) at @post.PostedAt

@Html.Markdown(post.Body)

- @{ - Html.RenderPartial("~/Views/Shared/_PostModerationBar.cshtml", post); + + @if (post.EditHistory.Length > 0) + { +
+
+

Latest edit

+ @{ + var edit = post.EditHistory.OrderByDescending(x => x.EditedAt).First(); + } +

By @Html.UserLink(edit.UserId) at @edit.EditedAt

+

Reason: @Html.Markdown(edit.EditReason)

+
+
}
} -@{ - Html.RenderPartial("~/Views/Shared/_ModeratorBar.cshtml", Model); -} -

Pages: