mirror of
https://github.com/Jetsparrow/jetherald.git
synced 2026-01-20 23:56:08 +03:00
79 lines
2.6 KiB
Plaintext
79 lines
2.6 KiB
Plaintext
@model AdminUsersModel
|
|
|
|
<h3>users</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Login</th>
|
|
<th>Role</th>
|
|
<th>Plan</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var user in Model.Users)
|
|
{
|
|
<tr>
|
|
<form asp-controller="AdminUsers" asp-action="SetPerms" asp-route-userid="@user.UserId" method="POST"
|
|
enctype="application/x-www-form-urlencoded" style="display:inline">
|
|
|
|
<td>@user.Name </td>
|
|
<td><span class="username">@@@user.Login</span></td>
|
|
<td>
|
|
@if (Context.UserCan("admin.users.setperms"))
|
|
{
|
|
@:<select name="roleId" required class="blueunderline">
|
|
@foreach (var role in Model.Roles.Values)
|
|
{
|
|
if (role.RoleId == user.RoleId)
|
|
{
|
|
<option value="@role.RoleId" selected>@role.Name</option>
|
|
}
|
|
else
|
|
{
|
|
<option value="@role.RoleId">@role.Name</option>
|
|
}
|
|
}
|
|
@:</select>
|
|
}
|
|
else
|
|
{
|
|
@Model.Roles[user.RoleId].Name
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (Context.UserCan("admin.users.setperms"))
|
|
{
|
|
@:<select name="planId" required class="blueunderline">
|
|
@foreach (var plan in Model.Plans.Values)
|
|
{
|
|
if (plan.PlanId == user.PlanId)
|
|
{
|
|
<option value="@plan.PlanId" selected>@plan.Name</option>
|
|
}
|
|
else
|
|
{
|
|
<option value="@plan.PlanId">@plan.Name</option>
|
|
}
|
|
}
|
|
@:</select>
|
|
}
|
|
else
|
|
{
|
|
@Model.Plans[user.PlanId].Name
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (Context.UserCan("admin.users.setperms"))
|
|
{
|
|
<input type="submit" value="Apply">
|
|
}
|
|
</td>
|
|
|
|
</form>
|
|
</tr>
|
|
|
|
}
|
|
</tbody>
|
|
</table> |