| | 1 | | <!-- Create Project Modal --> |
| | 2 | | @inject Services.ConferenceRoleService _conferenceRoleService |
| | 3 | |
|
| 0 | 4 | | @if (isVisible) |
| 0 | 5 | | { |
| | 6 | | <div class="modal fade show" style="display: block;" role="dialog"> |
| | 7 | | <div class="modal-dialog"> |
| | 8 | | <div class="modal-content"> |
| | 9 | | <div class="modal-header"> |
| | 10 | | <h4 class="modal-title">Neue Teamrollengruppe</h4> |
| 0 | 11 | | <button type="button" class="btn-close" @onclick="() => Hide()"></button> |
| | 12 | | </div> |
| 0 | 13 | | @if (response == null) |
| 0 | 14 | | { |
| | 15 | | <EditForm Model="request" OnValidSubmit="CreateRoleGroup"> |
| | 16 | | <DataAnnotationsValidator /> |
| | 17 | | <ValidationSummary /> |
| | 18 | | <div class="modal-body"> |
| | 19 | | <h3>Über Gruppen</h3> |
| | 20 | | <p>Die Rollen für das Team eine Konferenz werden in Gruppen zusammengefasst. Diese Gruppen k |
| | 21 | | <p>Diesen Gruppen sind dann einzelne Rollen zugeordnet, wie die Projektleitung, Generalserek |
| | 22 | |
|
| | 23 | | <div class="row mb-15px"> |
| | 24 | | <label class="form-label col-form-label col-md-3">Gruppenname</label> |
| | 25 | | <div class="col-md-9"> |
| | 26 | | <InputText type="text" class="form-control mb-5px" placeholder="Projektleitung" @bin |
| | 27 | | <small class="fs-12px text-gray-500-darker">Der Name der Gruppe. Zum Beispiel (erwei |
| | 28 | | </div> |
| | 29 | | </div> |
| | 30 | |
|
| | 31 | | <div class="row mb-15px"> |
| | 32 | | <label class="form-label col-form-label col-md-3">Vollständiger Gruppenname</label> |
| | 33 | | <div class="col-md-9"> |
| | 34 | | <InputText type="text" class="form-control mb-5px" placeholder="Projektleitung MUN.. |
| | 35 | | <small class="fs-12px text-gray-500-darker">Ein erweiterter Name für die Gruppe. Zum |
| | 36 | | </div> |
| | 37 | | </div> |
| | 38 | |
|
| | 39 | | <div class="row mb-15px"> |
| | 40 | | <label class="form-label col-form-label col-md-3">Gruppenkürzel</label> |
| | 41 | | <div class="col-md-9"> |
| | 42 | | <InputText type="text" class="form-control mb-5px" placeholder="PL" @bind-Value="@re |
| | 43 | | <small class="fs-12px text-gray-500-darker">Eine Kurzform für die Gruppe zum Beispie |
| | 44 | | </div> |
| | 45 | | </div> |
| | 46 | |
|
| | 47 | | <div class="row mb-15px"> |
| | 48 | | <label class="form-label col-form-label col-md-3">Hierarchielevel</label> |
| | 49 | | <div class="col-md-9"> |
| | 50 | | <InputNumber class="form-control mb-5px" @bind-Value="@request.GroupLevel" /> |
| | 51 | | <small class="fs-12px text-gray-500-darker">Eine Einschätzung auf welcher Stufe dies |
| | 52 | | </div> |
| | 53 | | </div> |
| | 54 | | </div> |
| | 55 | | <div class="modal-footer"> |
| 0 | 56 | | <button class="btn btn-white" @onclick="() => Hide()">Abbrechen</button> |
| | 57 | | <button class="btn btn-success" type="submit">Gruppe erstellen</button> |
| | 58 | | </div> |
| | 59 | | </EditForm> |
| 0 | 60 | | } |
| | 61 | | else |
| 0 | 62 | | { |
| | 63 | | <div class="modal-body"> |
| | 64 | | <div class="col-12"> |
| 0 | 65 | | @if (!response.HasError) |
| 0 | 66 | | { |
| 0 | 67 | | <div class="alert alert-success">Die Gruppe wurde erfolgreich erstellt <button class="bt |
| 0 | 68 | | } |
| | 69 | | </div> |
| | 70 | |
|
| | 71 | | </div> |
| | 72 | | <div class="modal-footer"> |
| 0 | 73 | | <button class="btn btn-white" @onclick="() => Hide()">Schließen</button> |
| | 74 | | </div> |
| 0 | 75 | | } |
| | 76 | |
|
| | 77 | | </div> |
| | 78 | | </div> |
| | 79 | | </div> |
| | 80 | | <div class="modal-backdrop fade show"></div> |
| 0 | 81 | | } |
| | 82 | |
|
| | 83 | |
|
| | 84 | | @code { |
| 0 | 85 | | private bool isVisible = false; |
| | 86 | |
|
| 0 | 87 | | [Parameter] public string ConferenceId { get; set; } |
| | 88 | |
|
| 0 | 89 | | [CascadingParameter] public Task<AuthenticationState> authStateTask { get; set; } |
| | 90 | |
|
| 0 | 91 | | [Parameter] public EventCallback GroupCreated { get; set; } |
| | 92 | |
|
| | 93 | |
|
| | 94 | | private Schema.Conference.CreateTeamRoleGroupRequest request; |
| | 95 | |
|
| | 96 | | private Schema.Conference.CreateTeamRoleGroupResponse response; |
| | 97 | |
|
| | 98 | |
|
| | 99 | | protected override void OnInitialized() |
| 0 | 100 | | { |
| 0 | 101 | | this.request = new Schema.Conference.CreateTeamRoleGroupRequest(); |
| 0 | 102 | | request.ConferenceId = ConferenceId; |
| 0 | 103 | | } |
| | 104 | |
|
| | 105 | | public void Show() |
| 0 | 106 | | { |
| 0 | 107 | | isVisible = true; |
| 0 | 108 | | StateHasChanged(); |
| 0 | 109 | | } |
| | 110 | |
|
| | 111 | | public void Hide() |
| 0 | 112 | | { |
| 0 | 113 | | isVisible = false; |
| 0 | 114 | | } |
| | 115 | |
|
| | 116 | | public async Task CreateRoleGroup() |
| 0 | 117 | | { |
| 0 | 118 | | var claim = (await authStateTask)?.User; |
| 0 | 119 | | if (claim != null) |
| 0 | 120 | | { |
| 0 | 121 | | this.response = await _conferenceRoleService.CreateTeamRoleGroupAsync(request, claim); |
| 0 | 122 | | if (!response.HasError) |
| 0 | 123 | | await GroupCreated.InvokeAsync(); |
| 0 | 124 | | } |
| | 125 | |
|
| 0 | 126 | | } |
| | 127 | |
|
| | 128 | | private void Reset() |
| 0 | 129 | | { |
| 0 | 130 | | request.GroupFullName = null; |
| 0 | 131 | | request.GroupName = null; |
| 0 | 132 | | request.GroupShort = null; |
| 0 | 133 | | request.GroupLevel = request.GroupLevel + 1; |
| 0 | 134 | | response = null; |
| 0 | 135 | | } |
| | 136 | | } |