diff options
| author | Michael <[email protected]> | 2017-03-20 16:45:17 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-20 16:45:17 -0400 |
| commit | cdc61eb4ea5309769ad4db84d92594e4dc3dff67 (patch) | |
| tree | a8297a7aecc4376f07a497a5e02ab5ff165bfbd3 /Project-Unite/Views/Moderator | |
| parent | d9f475e1f33bbf39ca0d79d7a6b0c2fd501b4f2d (diff) | |
| download | project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.gz project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.bz2 project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.zip | |
Initial commit (azure deploy test)
Diffstat (limited to 'Project-Unite/Views/Moderator')
| -rw-r--r-- | Project-Unite/Views/Moderator/Bans.cshtml | 73 | ||||
| -rw-r--r-- | Project-Unite/Views/Moderator/Index.cshtml | 7 | ||||
| -rw-r--r-- | Project-Unite/Views/Moderator/Logs.cshtml | 25 | ||||
| -rw-r--r-- | Project-Unite/Views/Moderator/UserDetails.cshtml | 116 | ||||
| -rw-r--r-- | Project-Unite/Views/Moderator/Users.cshtml | 28 |
5 files changed, 249 insertions, 0 deletions
diff --git a/Project-Unite/Views/Moderator/Bans.cshtml b/Project-Unite/Views/Moderator/Bans.cshtml new file mode 100644 index 0000000..90e20fc --- /dev/null +++ b/Project-Unite/Views/Moderator/Bans.cshtml @@ -0,0 +1,73 @@ +@model Project_Unite.Models.ModeratorBanListViewModel +@{ + ViewBag.Moderator = true; + ViewBag.Title = "Bans"; +} + +<h2>Bans</h2> + +<ul id="tabs" data-tabs="tabs" class="nav nav-tabs" role="tablist"> + <li class="active"><a data-toggle="tab" href="#t_users">User bans</a></li> + <li><a data-toggle="tab" href="#t_ips">IP bans</a></li> +</ul> + +<div class="tab-content"> + <div class="tab-pane fade in active" id="t_users"> + <h4>User bans</h4> + <p>Below is a list of all user bans. User bans prevent users from logging into their accounts.</p> + <table class="table"> + <tr> + <th style="width:50%">User</th> + <th>Banner</th> + <th>Timestamp</th> + <th>Actions</th> + </tr> + + @foreach(var u in Model.UserBans.OrderByDescending(x=>x.BannedAt)) + { + <tr> + <td>@Html.UserLink(u.Id)</td> + <td>@Html.UserLink(u.BannedBy)</td> + <td>@u.BannedAt</td> + <td> + @if(ACL.Granted(User.Identity.Name, "CanIssueBan")) + { + if(ACL.CanManageRole(User.Identity.Name, u.HighestRole.Id)) + { + @Html.ActionLink("Unban", "Unban", "Moderator", new { id=u.Id}, new { @class="btn btn-default"}) + } + } + + </td> + </tr> + } + </table> + </div> + <div class="tab-pane fade in" id="t_ips"> + <h4>IP address bans</h4> + <p>Below is a list of IP address bans on the site. IP bans prevent users with a certain IP address from even attempting to access the website and multi-user domain by sending back "Forbidden" responses and denying connection.</p> + <h5>BE EXTREMELY CAUTIOUS.</h5> + <p>The system does NOT associate IP addresses with usernames - it can't. If you are unsure who's IP address you are unbanning, contact someone who is sure before taking any action. We have no idea what that computer or network is capable of.</p> + <table class="table"> + <tr> + <th style="width:50%">User</th> + <th>Banner</th> + <th>Timestamp</th> + <th>Actions</th> + </tr> + + @foreach (var u in Model.IPBans) + { + <tr> + <td>@u.Address</td> + <td> + @if (ACL.Granted(User.Identity.Name, "CanIssueIPBan")) + { + @Html.ActionLink("Unban", "UnbanIP", "Moderator", new { id = u.Id }, new { @class = "btn btn-danger" }) + } + </td> + </tr> + } + </table> + </div> +</div>
\ No newline at end of file diff --git a/Project-Unite/Views/Moderator/Index.cshtml b/Project-Unite/Views/Moderator/Index.cshtml new file mode 100644 index 0000000..d4b6569 --- /dev/null +++ b/Project-Unite/Views/Moderator/Index.cshtml @@ -0,0 +1,7 @@ + +@{ + ViewBag.Title = "Moderator CP"; +} + + + diff --git a/Project-Unite/Views/Moderator/Logs.cshtml b/Project-Unite/Views/Moderator/Logs.cshtml new file mode 100644 index 0000000..bf3ed4d --- /dev/null +++ b/Project-Unite/Views/Moderator/Logs.cshtml @@ -0,0 +1,25 @@ +@model IEnumerable<Project_Unite.Models.AuditLog> +@{ + ViewBag.Moderator = true; + ViewBag.Title = "Audit logs"; +} + +<h2>Moderator audit logs</h2> + +<p>Below is a list of all actions carried out by moderators and users that can be reviewed as evidence when investigating a guideline break.</p> + +<table class="table"> + <tr> + <th style="width:65%">Action</th> + <th>User & Timestamp</th> + <th>Level</th> + </tr> + @foreach(var i in Model.OrderByDescending(x=>x.Timestamp)) + { + <tr> + <td>@i.Description</td> + <td>@Html.UserLink(i.UserId) at @i.Timestamp</td> + <td>@i.Level</td> + </tr> + } +</table>
\ No newline at end of file diff --git a/Project-Unite/Views/Moderator/UserDetails.cshtml b/Project-Unite/Views/Moderator/UserDetails.cshtml new file mode 100644 index 0000000..74556df --- /dev/null +++ b/Project-Unite/Views/Moderator/UserDetails.cshtml @@ -0,0 +1,116 @@ +@model Project_Unite.Models.ApplicationUser +@{ + ViewBag.Moderator = true; + ViewBag.Title = "User details"; +} + +<h2>User details</h2> + +<h4>@Html.UserLink(Model.Id)</h4> + +<ul> + <li><strong>Email address: </strong><a href="mailto:@Model.Email">Email @Model.Email</a></li> + <li><strong>Display name: </strong>@Model.DisplayName + + @if (ACL.Granted(User.Identity.Name, "CanEditUsernames")) + { + if (ACL.CanManageRole(User.Identity.Name, Model.HighestRole.Id)) + { + <!-- Trigger the modal with a button --> + <a data-toggle="modal" data-target="#edit-user" href="#"><span class="glyphicon glyphicon-pencil"></span> Change</a> + + <!-- Modal --> + <div id="edit-user" class="modal fade" role="dialog"> + <div class="modal-dialog"> + + <!-- Modal content--> + <div class="modal-content"> + @using (Html.BeginForm("ChangeUsername", "Moderator", new { id = Model.Id })) + { + @Html.AntiForgeryToken() + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <h4 class="modal-title">Change username</h4> + </div> + <div class="modal-body"> + <p>Please enter a username for this user.</p> + <p><strong>@Html.DisplayNameFor(Model => Model.DisplayName)</strong>: @Html.TextBoxFor(Model => Model.DisplayName)</p> + + </div> + <div class="modal-footer"> + <input type="submit" value="Change" class="btn btn-primary" /> + <a href="#" data-dismiss="modal" class="btn btn-default">Cancel</a> + </div> + } + </div> + + </div> + </div> + } + } + </li> + @if(ACL.Granted(User.Identity.Name, "CanIssueIPBan")) + { + <li><strong>Last known IP address: </strong>@Model.LastKnownIPAddress</li> + } + <li><strong>Banned: </strong> + @if (Model.IsBanned) + { + <em>Yes</em> + if (Model.UserName != User.Identity.Name && ACL.CanManageRole(User.Identity.Name, Model.HighestRole.Id)) + { + @Html.ActionLink("Unban", "Unban", "Moderator", new { id = Model.Id }, null) + } + } + else + { + <em>No</em> + if (Model.UserName != User.Identity.Name && ACL.CanManageRole(User.Identity.Name, Model.HighestRole.Id)) + { + @Html.ActionLink("Ban", "Ban", "Moderator", new { id = Model.Id }, null) + } + } + </li> + @if(Model.IsBanned == true) + { + <li><strong>Banned on: </strong>@Model.BannedAt</li> + <li><strong>Banned by: </strong>@Html.UserLink(Model.BannedBy)</li> + } + <li> + <strong>Muted: </strong> + @if (Model.IsMuted) + { + <em>Yes</em> + if (Model.UserName != User.Identity.Name && ACL.CanManageRole(User.Identity.Name, Model.HighestRole.Id)) + { + @Html.ActionLink("Unmute", "Unmute", "Moderator", new { id = Model.Id }, null) + } + } + else + { + <em>No</em> + if (Model.UserName != User.Identity.Name && ACL.CanManageRole(User.Identity.Name, Model.HighestRole.Id)) + { + @Html.ActionLink("Mute", "Mute", "Moderator", new { id = Model.Id }, null) + } + } + </li> + @if (Model.IsMuted == true) + { + <li><strong>Muted on: </strong>@Model.MutedAt</li> + <li><strong>Muted by: </strong>@Html.UserLink(Model.MutedBy)</li> + } + <li><strong>Bio:</strong> + <p>@Html.Markdown(Model.Bio)</p> + </li> + <li> + <strong>Interests:</strong> + <p>@Model.Interests</p> + </li> + <li> + <strong>Hobbies:</strong> + <p>@Model.Hobbies</p> + </li> + + +</ul>
\ No newline at end of file diff --git a/Project-Unite/Views/Moderator/Users.cshtml b/Project-Unite/Views/Moderator/Users.cshtml new file mode 100644 index 0000000..b352d53 --- /dev/null +++ b/Project-Unite/Views/Moderator/Users.cshtml @@ -0,0 +1,28 @@ +@model IEnumerable<Project_Unite.Models.ApplicationUser> +@{ + ViewBag.Moderator = true; + ViewBag.Title = "Users"; +} + +<h2>Users</h2> + +<p>Below is a list of all users in the database.</p> + +<table class="table"> + <tr> + <th style="width:85%">User</th> + <th>Actions</th> + </tr> + @foreach (var user in Model) + { + <tr> + <td>@Html.UserLink(user.Id)</td> + <td> + + @Html.ActionLink("User details", "UserDetails", "Moderator", new { id = user.DisplayName }, new { @class = "btn btn-default" }) + + + </td> + </tr> + } +</table>
\ No newline at end of file |
