summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Admin/RoleDetails.cshtml
blob: 404e0a0d4b4a753d9f8e84ef223f86adee8a674a (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
@using Microsoft.AspNet.Identity

@model Project_Unite.Models.Role

@{
    ViewBag.Title = "Details for " + Model.Name;
}

<h2>Role details</h2>

    <h4 style="color:@Model.ColorHex">@Model.Name</h4>
    <p><strong>ID: </strong>@Model.Id</p>
    <p><strong>Description:</strong></p>
    <p>@Model.Description</p>
    <p><strong>Priority: </strong>@Model.Priority</p>

<hr/>

<h2>Users</h2>

<p>Below is a list of users in this role.</p>

<ul class="nav nav-pills">
    <li><a href="@Url.Action("AddUserToRole", new { id = Model.Id })"><span class="glyphicon glyphicon-plus"></span> Add user to role</a></li>
</ul>

<table class="table">
    <tr>
        <th style="width:65%">User</th>
        <th>Actions</th>
    </tr>
    @foreach(var user in Model.Users)
    {
        <tr>
            <td>@Html.UserLink(user.UserId)</td>
            <td>
                @if(User.Identity.GetUserId() != user.UserId)
                {
                    @Html.ActionLink("Remove", "RemoveUserFromRole", "Admin", new { id = user.RoleId, usr = user.UserId}, new { @class="btn btn-danger"})

                }
                @Html.ActionLink("User details", "UserDetails", "Moderator", new { id = user.UserId }, new { @class = "btn btn-default" })


            </td>
        </tr>
    }
</table>