| | 1 | | @namespace Syki.Front.Pages.Student |
| | 2 | |
|
| | 3 | | @page "/student/disciplines" |
| | 4 | | @attribute [Authorize(Roles = "Student")] |
| | 5 | |
|
| | 6 | | <SykiPageTitle Title="Disciplinas" /> |
| | 7 | |
|
| | 8 | | <MudContainer Class="my-4 px-4"> |
| | 9 | | <SykiPageHeader Icon="@Icons.Material.Filled.Apps" Title="Disciplinas" /> |
| | 10 | | <MudContainer Class="px-0 my-4"> |
| 0 | 11 | | @if (_loading) |
| | 12 | | { |
| | 13 | | <MudContainer Class="px-0"> |
| | 14 | | <MudCard> |
| | 15 | | <MudCardContent> |
| | 16 | | <MudProgressLinear Color="Color.Info" Indeterminate="true" /> |
| | 17 | | </MudCardContent> |
| | 18 | | </MudCard> |
| | 19 | | </MudContainer> |
| | 20 | | } |
| | 21 | | else |
| | 22 | | { |
| | 23 | | <MudExpansionPanels MultiExpansion="true"> |
| 0 | 24 | | @foreach (var period in _disciplines.ConvertAll(d => d.Period).Distinct().Order()) |
| | 25 | | { |
| | 26 | | <MudExpansionPanel Expanded="@(period == 1)"> |
| | 27 | | <TitleContent> |
| | 28 | | <div class="d-flex"> |
| | 29 | | <MudIcon Icon="@Icons.Material.Filled.ArrowRight" class="mr-3"></MudIcon> |
| | 30 | | <MudText><strong>@($"{period}º Período")</strong></MudText> |
| | 31 | | </div> |
| | 32 | | </TitleContent> |
| | 33 | | <ChildContent> |
| 0 | 34 | | <MudTable Items="@_disciplines.Where(x => x.Period == period).OrderBy(x => x.Name)" Breakpoi |
| | 35 | | <HeaderContent> |
| | 36 | | <MudTh>Nome</MudTh> |
| | 37 | | <MudTh>Créditos</MudTh> |
| | 38 | | <MudTh>CH</MudTh> |
| | 39 | | <MudTh>Situação</MudTh> |
| | 40 | | </HeaderContent> |
| | 41 | | <RowTemplate> |
| | 42 | | <MudTd DataLabel="Nome">@context.Name</MudTd> |
| | 43 | | <MudTd DataLabel="Créditos">@context.Credits</MudTd> |
| | 44 | | <MudTd DataLabel="CH">@context.Workload</MudTd> |
| | 45 | | <MudTd DataLabel="Status">@context.StudentDisciplineStatus.GetDescription()</MudTd> |
| | 46 | | </RowTemplate> |
| | 47 | | </MudTable> |
| | 48 | | </ChildContent> |
| | 49 | | </MudExpansionPanel> |
| | 50 | | } |
| | 51 | | </MudExpansionPanels> |
| | 52 | | } |
| | 53 | | </MudContainer> |
| | 54 | | </MudContainer> |
| | 55 | |
|
| | 56 | | @inject GetStudentDisciplinesClient Client |
| | 57 | |
|
| | 58 | | @code |
| | 59 | | { |
| | 60 | | private bool _loading; |
| 0 | 61 | | private List<DisciplineOut> _disciplines = []; |
| | 62 | |
|
| | 63 | | protected override async Task OnInitializedAsync() |
| | 64 | | { |
| 0 | 65 | | _loading = true; |
| 0 | 66 | | _disciplines = await Client.Get(); |
| 0 | 67 | | _loading = false; |
| 0 | 68 | | } |
| | 69 | | } |