Added groups view model, implemented basic groups table view

This commit is contained in:
2025-10-11 13:29:59 +02:00
parent d9127736d9
commit fd5dcb5618
5 changed files with 65 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
@using Microsoft.AspNetCore.Mvc.Localization
@using Berufsschule_HAM.Models
@using System.Buffers.Text
@* @model UsersIndexViewModel *@
@model GroupsIndexViewModel
@inject IViewLocalizer T
@{
ViewData["Title"] = T["Groups"];
@@ -23,39 +23,38 @@
<tr>
<th style="text-align: center">Group</th>
<th style="text-align: center">@T["Can"]:<br/>@T["inventorize"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["Manage users"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["Manage locations"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["Manage assets"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["manage users"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["manage locations"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["manage assets"]</th>
<th style="text-align: center">@T["Can"]:<br/>@T["manage groups"]</th>
<th style="text-align: center">@T["Action"]</th>
</tr>
</thead>
<tbody>
@* @{
foreach (UserTableViewModel userTableViewModel in Model.UserTableViewModels)
@{
foreach (GroupsTableViewModel userTableViewModel in Model.GroupsTableViewModels)
{
<tr>
<td>
<img class="rounded-circle user-icon" src="data:image/jpeg;base64,@userTableViewModel.JpegPhoto" alt="Photo" style="max-width:300px;" />
</td>
<td>@userTableViewModel.Uid</td>
<td>@userTableViewModel.Title</td>
<td>@userTableViewModel.Name</td>
<td>@userTableViewModel.Surname</td>
<td>@userTableViewModel.Workplace</td>
<td>
<div class="d-flex gap-2">
<td style="text-align: center">@userTableViewModel.Group</td>
<td style="text-align: center">@userTableViewModel.CanInventorize</td>
<td style="text-align: center">@userTableViewModel.CanManageUsers</td>
<td style="text-align: center">@userTableViewModel.CanManageLocations</td>
<td style="text-align: center">@userTableViewModel.CanManageAssets</td>
<td style="text-align: center">@userTableViewModel.CanManageGroups</td>
<td style="text-align: center">
<div class="d-flex gap-2 justify-content-center">
<button class="btn btn-sm btn-primary">Update</button>
<button class="btn btn-sm btn-danger btn-delete"
data-user-id="@userTableViewModel.Uid"
data-user-id="@userTableViewModel.Cn"
data-bs-toggle="modal"
data-bs-target="#deleteModal">
🗑️ Delete
Delete
</button>
</div>
</td>
</tr>
}
} *@
}
</tbody>
</table>
</div>