| | 1 | | @inject MUNity.Services.OrganizationService orgaService; |
| | 2 | |
|
| 0 | 3 | | @if (tinyInfos != null) |
| 0 | 4 | | { |
| | 5 | | <div class="card border-0 mb-3 bg-gray-900 text-white"> |
| | 6 | | <!-- BEGIN card-body --> |
| | 7 | | <div class="card-body"> |
| | 8 | | <!-- BEGIN title --> |
| | 9 | | <div class="mb-3 text-gray-300"> |
| | 10 | | <b>Organisationen</b> |
| | 11 | | </div> |
| | 12 | |
|
| 0 | 13 | | @foreach (var orga in tinyInfos) |
| 0 | 14 | | { |
| | 15 | | <div class="row align-items-center pb-1px"> |
| | 16 | | <!-- BEGIN col-4 --> |
| | 17 | | <div class="col-4"> |
| | 18 | | <div class="h-100px d-flex align-items-center justify-content-center"> |
| | 19 | | <img src="/img/svg/img-4.svg" class="mw-100 mh-100"> |
| | 20 | | </div> |
| | 21 | | </div> |
| | 22 | | <!-- END col-4 --> |
| | 23 | | <!-- BEGIN col-8 --> |
| | 24 | | <div class="col-8"> |
| 0 | 25 | | <div class="mb-2px text-truncate">@orga.Name</div> |
| 0 | 26 | | <div class="mb-2px text-gray-300 fs-11px">@orga.Short</div> |
| | 27 | | <a href="/Organization/@orga.OrganizationId" class="btn btn-xs btn-indigo fs-10px ps-2 pe-2">Das |
| | 28 | | </div> |
| | 29 | | <!-- END col-8 --> |
| | 30 | | </div> |
| | 31 | |
|
| | 32 | | <hr class=" bg-white-transparent-2 mt-20px mb-20px"> |
| 0 | 33 | | } |
| | 34 | | </div> |
| | 35 | | <!-- END card-body --> |
| | 36 | | </div> |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | @code { |
| | 40 | | public enum ListModes |
| | 41 | | { |
| | 42 | | ALL, |
| | 43 | | OfCurrentUser, |
| | 44 | | PublicVisible |
| | 45 | | } |
| | 46 | |
|
| | 47 | | public enum DetailLevels |
| | 48 | | { |
| | 49 | | Tiny, |
| | 50 | | Detailed |
| | 51 | | } |
| | 52 | |
|
| | 53 | | [Parameter] |
| 0 | 54 | | public ListModes ListMode { get; set; } = ListModes.OfCurrentUser; |
| | 55 | |
|
| | 56 | | [Parameter] |
| 0 | 57 | | public DetailLevels DetailLevel { get; set; } = DetailLevels.Tiny; |
| | 58 | |
|
| | 59 | | [CascadingParameter] |
| 0 | 60 | | private Task<AuthenticationState> authenticationStateTask { get; set; } |
| | 61 | |
|
| | 62 | | List<MUNity.Schema.Organization.OrganizationTinyInfo> tinyInfos; |
| | 63 | |
|
| | 64 | | protected override async Task OnInitializedAsync() |
| 0 | 65 | | { |
| 0 | 66 | | if (DetailLevel == DetailLevels.Tiny) |
| 0 | 67 | | { |
| 0 | 68 | | if (ListMode == ListModes.ALL) |
| 0 | 69 | | tinyInfos = this.orgaService.GetTyinInfosOfAllOrgas(); |
| 0 | 70 | | else if (ListMode == ListModes.OfCurrentUser) |
| 0 | 71 | | { |
| 0 | 72 | | var user = (await authenticationStateTask).User; |
| 0 | 73 | | if (user != null) |
| 0 | 74 | | { |
| 0 | 75 | | tinyInfos = this.orgaService.GetTinyInfoOfUserOrganizations(user); |
| 0 | 76 | | } |
| 0 | 77 | | } |
| 0 | 78 | | } |
| | 79 | |
|
| | 80 | | //base.OnInitialized(); |
| 0 | 81 | | } |
| | 82 | |
|
| | 83 | |
|
| | 84 | | } |