| | | 1 | | @using MUNity.Database.Models.Website |
| | | 2 | | @using MUNity.Database.Context |
| | | 3 | | @inject Services.UserConferenceAuthService conferenceAuthService |
| | | 4 | | @inject MunityContext dbContext |
| | | 5 | | |
| | 0 | 6 | | @if (isAuthorized) |
| | 0 | 7 | | { |
| | | 8 | | <table class="table"> |
| | | 9 | | <thead> |
| | | 10 | | <tr> |
| | | 11 | | <th>Eigenschaft</th> |
| | | 12 | | <th>Wert</th> |
| | | 13 | | </tr> |
| | | 14 | | </thead> |
| | | 15 | | <tbody> |
| | | 16 | | <tr> |
| | | 17 | | <td>Bewerbung auf Delegation</td> |
| | 0 | 18 | | <td>@((dbContext.ConferenceApplicationOptions.Any(a => a.Conference.ConferenceId == ConferenceId && a.Al |
| | | 19 | | </tr> |
| | | 20 | | <tr> |
| | | 21 | | <td>Bewerbung auf Rollen</td> |
| | 0 | 22 | | <td>@((dbContext.ConferenceApplicationOptions.Any(a => a.Conference.ConferenceId == ConferenceId && a.Al |
| | | 23 | | </tr> |
| | | 24 | | <tr> |
| | | 25 | | <td>Bewerbung auf Team-Rollen</td> |
| | 0 | 26 | | <td>@((dbContext.ConferenceApplicationOptions.Any(a => a.Conference.ConferenceId == ConferenceId && a.Al |
| | | 27 | | </tr> |
| | | 28 | | <tr> |
| | | 29 | | <td>Anzahl Delegation-Slots</td> |
| | 0 | 30 | | <td>@dbContext.Delegates.Count(n => n.Conference.ConferenceId == ConferenceId && n.ApplicationState == E |
| | | 31 | | </tr> |
| | | 32 | | <tr> |
| | | 33 | | <td>Anzahl Rollen mit Direktbewerbung</td> |
| | 0 | 34 | | <td>@dbContext.Delegates.Count(n => n.Conference.ConferenceId == ConferenceId && n.ApplicationState == E |
| | | 35 | | </tr> |
| | | 36 | | <tr> |
| | | 37 | | <td>Anzahl Rollen mit geschlossener Bewerbung</td> |
| | 0 | 38 | | <td>@dbContext.Delegates.Count(n => n.Conference.ConferenceId == ConferenceId && n.ApplicationState == E |
| | | 39 | | </tr> |
| | | 40 | | <tr> |
| | | 41 | | <td>Anzahl eingereichter DelegationWishesbewerbungen</td> |
| | 0 | 42 | | <td>@dbContext.DelegationApplications.Count(n => n.DelegationWishes.Select(a => a.Delegation.Conference) |
| | | 43 | | </tr> |
| | | 44 | | <tr> |
| | | 45 | | <td>Delegationen welche durch Bewerbungen abgedeckt sind</td> |
| | | 46 | | <td> |
| | | 47 | | @{ |
| | 0 | 48 | | var totalCount = dbContext.Delegations.Count(n => n.Conference.ConferenceId == ConferenceId); |
| | 0 | 49 | | var coveredCount = dbContext.Delegations.Count(n => n.Conference.ConferenceId == ConferenceId && |
| | 0 | 50 | | int percentage = coveredCount * 100 / totalCount; |
| | | 51 | | |
| | | 52 | | <div class="widget-chart-info-progress"> |
| | | 53 | | <b>Abdeckung</b> |
| | 0 | 54 | | <span class="float-end">@percentage %</span> |
| | | 55 | | </div> |
| | | 56 | | <div class="progress h-10px"> |
| | | 57 | | <div class="progress-bar rounded-pill" style="width:@(percentage)%;"></div> |
| | | 58 | | </div> |
| | | 59 | | <small class="text-secondary">Achtung, diese Zahl gibt nur an, wie auf welche Delegationen ein B |
| | | 60 | | } |
| | | 61 | | </td> |
| | | 62 | | |
| | | 63 | | </tr> |
| | | 64 | | <tr> |
| | | 65 | | <td>Delegationen welche durch erstwünsche abgedeckt sind</td> |
| | | 66 | | <td> |
| | | 67 | | @{ |
| | 0 | 68 | | var coveredCountByPrioZero = dbContext.Delegations.Count(n => n.Conference.ConferenceId == Confe |
| | 0 | 69 | | int percentagePrioZero = coveredCountByPrioZero * 100 / totalCount; |
| | | 70 | | |
| | | 71 | | <div class="widget-chart-info-progress"> |
| | | 72 | | <b>Abdeckung</b> |
| | 0 | 73 | | <span class="float-end">@percentagePrioZero %</span> |
| | | 74 | | </div> |
| | | 75 | | <div class="progress h-10px"> |
| | | 76 | | <div class="progress-bar rounded-pill" style="width:@(percentagePrioZero)%;"></div> |
| | | 77 | | </div> |
| | | 78 | | <small class="text-secondary">Diese Zahl gibt an, wie viele Delegationen besetzt sind, wenn die |
| | | 79 | | } |
| | | 80 | | </td> |
| | | 81 | | |
| | | 82 | | </tr> |
| | | 83 | | </tbody> |
| | | 84 | | </table> |
| | | 85 | | |
| | 0 | 86 | | } |
| | | 87 | | else |
| | 0 | 88 | | { |
| | | 89 | | <div class="alert alert-muted"> |
| | | 90 | | Daten werden geladen... |
| | | 91 | | </div> |
| | 0 | 92 | | } |
| | | 93 | | |
| | | 94 | | @code { |
| | 0 | 95 | | [Parameter] public string ConferenceId { get; set; } |
| | | 96 | | |
| | 0 | 97 | | [CascadingParameter] public Task<AuthenticationState> AuthStateTask { get; set; } |
| | | 98 | | |
| | 0 | 99 | | private bool isAuthorized = false; |
| | | 100 | | |
| | | 101 | | |
| | | 102 | | protected override async Task OnInitializedAsync() |
| | 0 | 103 | | { |
| | 0 | 104 | | await base.OnInitializedAsync(); |
| | 0 | 105 | | var claim = (await AuthStateTask)?.User; |
| | 0 | 106 | | if (claim != null) |
| | 0 | 107 | | { |
| | 0 | 108 | | this.isAuthorized = await conferenceAuthService.IsUserAllowedToEditConference(ConferenceId, claim); |
| | 0 | 109 | | } |
| | 0 | 110 | | } |
| | | 111 | | |
| | | 112 | | } |