| | 1 | | <!-- Create Project Modal --> |
| | 2 | | @inject Services.ConferenceService conferenceService; |
| | 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 freie Rolle</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 freie Rollen</h3> |
| | 20 | | <p>Freie Rollen sind für Teilnehmende gedacht, welche nicht fester Bestandteil eines Gremium |
| | 21 | | <p class="text-warning">Teammitglieder gehören nicht zu dieser Art von Rolle. Das Team hat e |
| | 22 | | <div class="row mb-15px"> |
| | 23 | | <label class="form-label col-form-label col-md-3">Rollenname</label> |
| | 24 | | <div class="col-md-9"> |
| | 25 | | <InputText type="text" class="form-control mb-5px" placeholder="Rollenname" @bind-Va |
| | 26 | | <small class="fs-12px text-gray-500-darker">RedakteurIn, Kameramann/frau, Lehrkraft |
| | 27 | | </div> |
| | 28 | | </div> |
| | 29 | |
|
| 0 | 30 | | @if (Countries != null) |
| 0 | 31 | | { |
| | 32 | | <div class="row mb-15px"> |
| | 33 | | <label class="form-label col-form-label col-md-3">Repräsentiertes Land</label> |
| | 34 | | <div class="col-md-9"> |
| | 35 | | <InputSelect @bind-Value="@request.CountryId" class="form-select"> |
| | 36 | | <option value="-1">Keinem Land zugehörig</option> |
| 0 | 37 | | @foreach (var country in Countries) |
| 0 | 38 | | { |
| 0 | 39 | | <option value="@country.CountryId">@country.Name</option> |
| 0 | 40 | | } |
| | 41 | | </InputSelect> |
| | 42 | | <small class="fs-12px text-gray-500-darker"></small> |
| | 43 | | </div> |
| | 44 | | </div> |
| 0 | 45 | | } |
| | 46 | |
|
| 0 | 47 | | @if (Delegations != null) |
| 0 | 48 | | { |
| | 49 | | <div class="row mb-15px"> |
| | 50 | | <label class="form-label col-form-label col-md-3">DelegationWishes</label> |
| | 51 | | <div class="col-md-9"> |
| | 52 | | <InputSelect @bind-Value="@request.DelegationId" class="form-select"> |
| | 53 | | <option value="">Keine DelegationWishes</option> |
| 0 | 54 | | @foreach (var delegation in Delegations) |
| 0 | 55 | | { |
| 0 | 56 | | <option value="@delegation.DelegationId">@delegation.DelegationName</opt |
| 0 | 57 | | } |
| | 58 | | </InputSelect> |
| | 59 | | <small class="fs-12px text-gray-500-darker"></small> |
| | 60 | | </div> |
| | 61 | | </div> |
| 0 | 62 | | } |
| | 63 | |
|
| | 64 | | <div class="row mb-15px"> |
| | 65 | | <label class="form-label col-form-label col-md-3">Subkategorie</label> |
| | 66 | | <div class="col-md-9"> |
| | 67 | | <InputText type="text" class="form-control mb-5px" placeholder="Presse" @bind-Value= |
| | 68 | | <small class="fs-12px text-gray-500-darker">Hier kann eine Art erweiterte Gruppe ang |
| | 69 | | </div> |
| | 70 | | </div> |
| | 71 | | </div> |
| | 72 | | <div class="modal-footer"> |
| 0 | 73 | | <button class="btn btn-white" @onclick="() => Hide()">Abbrechen</button> |
| | 74 | | <button class="btn btn-success" type="submit">Sitz erstellen</button> |
| | 75 | | </div> |
| | 76 | | </EditForm> |
| 0 | 77 | | } |
| | 78 | | else |
| 0 | 79 | | { |
| | 80 | | <div class="modal-body"> |
| | 81 | | <div class="col-12"> |
| 0 | 82 | | @if (!response.HasError) |
| 0 | 83 | | { |
| 0 | 84 | | <div class="alert alert-success">Rolle erfolgreich erstellt <button class="btn btn-sm bt |
| 0 | 85 | | } |
| | 86 | | </div> |
| | 87 | |
|
| | 88 | | </div> |
| | 89 | | <div class="modal-footer"> |
| 0 | 90 | | <button class="btn btn-white" @onclick="() => Hide()">Schließen</button> |
| | 91 | | </div> |
| 0 | 92 | | } |
| | 93 | |
|
| | 94 | | </div> |
| | 95 | | </div> |
| | 96 | | </div> |
| | 97 | | <div class="modal-backdrop fade show"></div> |
| 0 | 98 | | } |
| | 99 | |
|
| | 100 | |
|
| | 101 | | @code { |
| 0 | 102 | | private bool isVisible = false; |
| | 103 | |
|
| 0 | 104 | | [CascadingParameter] public Task<AuthenticationState> authStateTask { get; set; } |
| | 105 | |
|
| 0 | 106 | | [Parameter] public string ConferenceId { get; set; } |
| | 107 | |
|
| 0 | 108 | | [Parameter] public EventCallback SeatCreated { get; set; } |
| | 109 | |
|
| 0 | 110 | | [Parameter] public List<MUNity.Schema.Conference.CountryInfo> Countries { get; set; } |
| | 111 | |
|
| 0 | 112 | | [Parameter] public List<MUNity.Schema.Conference.DelegationInfo> Delegations { get; set; } |
| | 113 | |
|
| 0 | 114 | | private int groupId { get; set; } |
| | 115 | |
|
| | 116 | | private Schema.Conference.CreateFreeSeatRequest request; |
| | 117 | |
|
| | 118 | | private Schema.Conference.CreateSeatResponse response; |
| | 119 | |
|
| | 120 | |
|
| | 121 | | protected override void OnInitialized() |
| 0 | 122 | | { |
| 0 | 123 | | this.request = new Schema.Conference.CreateFreeSeatRequest(); |
| 0 | 124 | | this.request.ConferenceId = ConferenceId; |
| 0 | 125 | | } |
| | 126 | |
|
| | 127 | | public void Show() |
| 0 | 128 | | { |
| 0 | 129 | | isVisible = true; |
| 0 | 130 | | StateHasChanged(); |
| 0 | 131 | | } |
| | 132 | |
|
| | 133 | | public void Hide() |
| 0 | 134 | | { |
| 0 | 135 | | isVisible = false; |
| 0 | 136 | | } |
| | 137 | |
|
| | 138 | | public async Task CreateRoleGroup() |
| 0 | 139 | | { |
| 0 | 140 | | var claim = (await authStateTask)?.User; |
| 0 | 141 | | if (claim != null) |
| 0 | 142 | | { |
| 0 | 143 | | this.response = await conferenceService.CreateFreeSeat(request, claim); |
| 0 | 144 | | if (!response.HasError) |
| 0 | 145 | | await SeatCreated.InvokeAsync(); |
| 0 | 146 | | } |
| | 147 | |
|
| 0 | 148 | | } |
| | 149 | |
|
| | 150 | | private void Reset() |
| 0 | 151 | | { |
| 0 | 152 | | request.CountryId = -1; |
| 0 | 153 | | request.DelegationId = null; |
| 0 | 154 | | request.RoleName = null; |
| 0 | 155 | | request.Subtype = null; |
| 0 | 156 | | response = null; |
| 0 | 157 | | } |
| | 158 | | } |