| | | 1 | | <!-- Create Project Modal --> |
| | | 2 | | @inject Services.ProjectService projectService; |
| | | 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">Neues Projekt</h4> |
| | 0 | 11 | | <button type="button" class="btn-close" @onclick="() => Hide()"></button> |
| | | 12 | | </div> |
| | 0 | 13 | | @if (response == null) |
| | 0 | 14 | | { |
| | | 15 | | <EditForm Model="createProjectModel" OnValidSubmit="CreateProject"> |
| | | 16 | | <DataAnnotationsValidator /> |
| | | 17 | | <ValidationSummary /> |
| | | 18 | | <div class="modal-body"> |
| | | 19 | | <h3>Über Projekte</h3> |
| | | 20 | | <p>Projekte sind den Konferenzen übergeordnet. Ein Projekt ist also eine Art Gruppe von Konf |
| | | 21 | | |
| | | 22 | | <div class="row mb-15px"> |
| | | 23 | | <label class="form-label col-form-label col-md-3">Projektname</label> |
| | | 24 | | <div class="col-md-9"> |
| | | 25 | | <InputText type="text" class="form-control mb-5px" placeholder="Model United Nations |
| | | 26 | | <small class="fs-12px text-gray-500-darker">Der Name des Projekts (Model United Nati |
| | | 27 | | </div> |
| | | 28 | | </div> |
| | | 29 | | |
| | | 30 | | <div class="row mb-15px"> |
| | | 31 | | <label class="form-label col-form-label col-md-3">Projekt Kürzel</label> |
| | | 32 | | <div class="col-md-9"> |
| | | 33 | | <InputText type="text" class="form-control mb-5px" placeholder="MUN ..." @bind-Value |
| | | 34 | | <small class="fs-12px text-gray-500-darker">Das Kürzel des Projekts (MUN Berlin)</sm |
| | | 35 | | </div> |
| | | 36 | | </div> |
| | | 37 | | </div> |
| | | 38 | | <div class="modal-footer"> |
| | 0 | 39 | | <button class="btn btn-white" @onclick="() => Hide()">Abbrechen</button> |
| | | 40 | | <button class="btn btn-success" type="submit">Projekt erstellen</button> |
| | | 41 | | </div> |
| | | 42 | | </EditForm> |
| | 0 | 43 | | } |
| | | 44 | | else |
| | 0 | 45 | | { |
| | | 46 | | <div class="modal-body"> |
| | | 47 | | <div class="col-12"> |
| | 0 | 48 | | @if (response.Status == Schema.Project.CreateProjectResponse.CreateProjectStatus.Success) |
| | 0 | 49 | | { |
| | | 50 | | <div class="alert alert-success">Das Porjekt wurde erfolgreich erstellt. <button class=" |
| | 0 | 51 | | } |
| | | 52 | | </div> |
| | | 53 | | |
| | | 54 | | </div> |
| | | 55 | | <div class="modal-footer"> |
| | 0 | 56 | | <button class="btn btn-white" @onclick="() => Hide()">Schließen</button> |
| | | 57 | | </div> |
| | 0 | 58 | | } |
| | | 59 | | |
| | | 60 | | </div> |
| | | 61 | | </div> |
| | | 62 | | </div> |
| | | 63 | | <div class="modal-backdrop fade show"></div> |
| | 0 | 64 | | } |
| | | 65 | | |
| | | 66 | | |
| | | 67 | | @code { |
| | 0 | 68 | | private bool isVisible = false; |
| | | 69 | | |
| | 0 | 70 | | [Parameter] public string OrganizationId { get; set; } |
| | | 71 | | |
| | | 72 | | private MUNity.Schema.Project.CreateProjectModel createProjectModel; |
| | | 73 | | |
| | | 74 | | private MUNity.Schema.Project.CreateProjectResponse response; |
| | | 75 | | |
| | | 76 | | protected override void OnInitialized() |
| | 0 | 77 | | { |
| | 0 | 78 | | this.createProjectModel = new Schema.Project.CreateProjectModel(); |
| | 0 | 79 | | createProjectModel.OrganizationId = OrganizationId; |
| | 0 | 80 | | } |
| | | 81 | | |
| | | 82 | | public void Show() |
| | 0 | 83 | | { |
| | 0 | 84 | | isVisible = true; |
| | 0 | 85 | | StateHasChanged(); |
| | 0 | 86 | | } |
| | | 87 | | |
| | | 88 | | public void Hide() |
| | 0 | 89 | | { |
| | 0 | 90 | | isVisible = false; |
| | 0 | 91 | | } |
| | | 92 | | |
| | | 93 | | public void CreateProject() |
| | 0 | 94 | | { |
| | 0 | 95 | | this.response = projectService.CreateProject(createProjectModel); |
| | 0 | 96 | | } |
| | | 97 | | } |