summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Admin/Users.cshtml
blob: 117ed3810ccff8490e53c0368a9da37e853b2712 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@model IEnumerable<Project_Unite.Models.ApplicationUser>
@{
    ViewBag.Admin = true;
    ViewBag.Title = "Users";
}

<h2>Users</h2>

<p>Below is a list of all users in the database.</p>

<ul class="nav nav-pills">
    <li><a href="@Url.Action("CreateUser")"><span class="glyphicon glyphicon-plus"></span> Create user</a></li>
</ul>

<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" })
                @if (ACL.Granted(User.Identity.Name, "CanAnonymizeUser"))
                {
                <a href="#" class="btn btn-danger" data-toggle="modal" data-target="#u_anonymize"><span class="glyphicon glyphicon-warning-sign"></span> Anonymize this user</a>
                <div class="modal fade in">
                    <div class="modal-content" id="#u_anonymize">
                        <div class="modal-header">
                            <a class="close" data-dissmiss="modal"></a>
                            <h2>Anonymize user</h2>
                        </div>
                        <div class="modal-body">
                            <p>Anonymizing this user will prevent them from ever logging in, and will purge their profile data. Continue?</p>
                        </div>
                        <div class="modal-footer">
                            <a class="btn btn-default" data-dismiss="modal">No</a>
                            @Html.ActionLink("Yes", "AnonymizeUser", "Admin", new { id = user.Id }, new { @class = "btn btn-danger" })
                        </div>
                    </div>
                </div>
                }
            </td>
        </tr>
    }
</table>