Set user groups
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
|
||||
<h2>Benutzerverwaltung <span style="font-size: .5em; line-height: 0;">Admin</span></h2>
|
||||
|
||||
<div class="my-2">
|
||||
<Button Color="Color.Primary" Disabled="@(SelectedUser == null)">Passwort setzen</Button>
|
||||
</div>
|
||||
|
||||
<DataGrid TItem="User"
|
||||
@ref="UserDataGrid"
|
||||
Data="@UserList"
|
||||
@@ -31,11 +35,12 @@
|
||||
PopupTitleTemplate="PopupTitleTemplate"
|
||||
RowInserted="RowInserted"
|
||||
RowUpdated="RowUpdated"
|
||||
SelectedRow="SelectedUser"
|
||||
RowDoubleClicked="arg => UserDataGrid.Edit(arg.Item)"
|
||||
Editable
|
||||
Responsive>
|
||||
<DataGridColumns>
|
||||
<DataGridCommandColumn TItem="User" Width="100px" CellStyle="@(_ => "display: flex; padding-left: 0; padding-right: 0; justify-content: center; align-items: center;")">
|
||||
<DataGridCommandColumn TItem="User" Width="100px" CellClass="@(_ => "px-0 d-flex align-items-center justify-content-center")">
|
||||
<NewCommandTemplate>
|
||||
<Button Size="Size.ExtraSmall" Color="Color.Success" Clicked="@context.Clicked" Class="mr-1" Style="min-width: auto;">
|
||||
<i class="oi oi-plus"></i>
|
||||
@@ -74,6 +79,31 @@
|
||||
</DataGridColumn>
|
||||
<DataGridColumn TItem="User" Field="@nameof(User.Name)" Caption="Name" Editable="true" Width="250px"></DataGridColumn>
|
||||
<DataGridColumn TItem="User" Field="@nameof(User.Mail)" Caption="E-Mail" Editable="true"></DataGridColumn>
|
||||
|
||||
<DataGridColumn TItem="User" Field="@nameof(User.GroupsList)" Caption="Gruppen" Editable="true">
|
||||
<EditTemplate>
|
||||
<Autocomplete TItem="UserGroup"
|
||||
TValue="UserGroup"
|
||||
Size="Size.ExtraSmall"
|
||||
Data="@UserGroups"
|
||||
TextField="@(( item ) => item.ToString())"
|
||||
ValueField="@(( item ) => item)"
|
||||
Multiple="true"
|
||||
SelectedValues="@((List<UserGroup>) context.CellValue)"
|
||||
SelectedValuesChanged="@(v => context.CellValue = v)"
|
||||
@bind-SelectedTexts="SelectedCompanyTexts">
|
||||
</Autocomplete>
|
||||
<small>Verfügbar: @string.Join(", ", Enum.GetValues<UserGroup>())</small>
|
||||
</EditTemplate>
|
||||
<DisplayTemplate>
|
||||
@if (string.IsNullOrWhiteSpace(context.Groups))
|
||||
{
|
||||
<span style="font-style: italic;">Keine Gruppen</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@string.Join(", ", context.GroupsList)</span>
|
||||
}
|
||||
</DisplayTemplate>
|
||||
</DataGridColumn>
|
||||
</DataGridColumns>
|
||||
</DataGrid>
|
||||
Reference in New Issue
Block a user