You need to sign in or sign up before continuing.
Newer
Older
<div class="course-list-wrapper">
<div class="course-list-inner" attr.aria-label="List of courses in {{ termCode | getTermDescription }} term">
<ng-container *ngIf="enrolledCourses.length === 0">
<p *ngIf="(term$ | async).termCode.isPast()" aria-label="No courses taken" class="no-courses">
<p *ngIf="(term$ | async).termCode.isActive()" aria-label="Not enrolled in any courses" class="no-courses">
Not enrolled in any courses
</p>
</ng-container>
role="button"
aria-labelledby="enrolled-courses"
*ngFor="let course of enrolledCourses"
type="course"
[disabled]="true"
[course]="course"
[era]="(term$ | async).termCode.era">
</div>
</ng-template>
<div class="course-list-wrapper">
<div
class="course-list"
cdkDropList
id="term-{{ termCode }}"
[cdkDropListData]="(term$ | async).termCode"
[cdkDropListConnectedTo]="dropZoneIds$ | async"
(cdkDropListDropped)="drop($event)"
(cdkDropListEntered)="dragEnter($event)"
(cdkDropListExited)="dragExit($event)">
<div class="course-list-inner term-body" attr.aria-label="List of courses in {{ termCode | getTermDescription }} term">
*ngIf="plannedCourses.length === 0 && !hasItemDraggedOver">
<p *ngIf="(term$ | async).termCode.isActive()" class="no-courses">
<p *ngIf="(term$ | async).termCode.isFuture()" class="no-courses">
<p *ngIf="(term$ | async).termCode.isPast()" class="no-courses">
No courses planned
</p>
</ng-container>
<span class="assistive-text">{{ assistiveText }}</span>
<div
cdkDrag
[cdkDragData]="course"
[cdkDragDisabled]="mobileView.matches"
(cdkDragStarted)="startDrag($event)"
*ngFor="let course of plannedCourses">
role="button"
aria-labelledby="planned-courses"
[era]="(term$ | async).termCode.era">
</div>
</div>
</div>
<!-- Add course -->
<div class="add-new-wrapper" *ngIf="(term$ | async).termCode.isPast() == false">
attr.aria-label="Add course to {{ termCode | getTermDescription }}"
(click)="openCourseSearch()">
</div>
</ng-template>
<mat-card
class="term-container"
[ngClass]="{ 'no-scrolling': mobileView.matches }"
role="region"
attr.aria-label="{{ termCode | getTermDescription }} term">
<h3 class="term-description">{{ termCode | getTermDescription }}</h3>
<div fxLayout="row" fxLayoutAlign="space-between center">
<p class="text-right semi-bold credits">
<ng-container *ngIf="visibleCredits === 'planned'">
<span attr.aria-label="{{ plannedCredits }} credits">{{ plannedCredits }} Cr</span>
</ng-container>
<ng-container *ngIf="visibleCredits === 'enrolled'">
<span attr.aria-label="{{ enrolledCredits }} credits">{{ enrolledCredits }} Cr</span>
</ng-container>
</p>
<ng-container *ngIf="(note$ | async) as note; else newNote">
attr.aria-label="Edit note for {{ termCode | getTermDescription }}"
(click)="openNotesDialog(note)">
alt="Edit note"
matTooltipPosition="above">
<button
mat-icon-button
(click)="openNotesDialog()"
attr.aria-label="Add note to {{ termCode | getTermDescription }}">
alt="Add note"
matTooltipPosition="above">
<p class="credit-overload-warning" *ngIf="((visibleCredits === 'planned') && (tooManyCredits$ | async)) || ((visibleCredits === 'enrolled') && (enrolledCredits > maxAllowedCredits))">
Warning: credit overload
</p>
<!-- Render term note (if it exists) -->
<ng-container *ngIf="(note$ | async) as note">
<ng-container *ngIf="note.isLoaded; else noteIsLoading">
<div class="note-item" (click)="openNotesDialog(note)">
<p class="semi-bold">Note</p>
<p class="note-excerpt">{{ note.text }}</p>
</div>
</ng-container>
<ng-template #noteIsLoading>
<div class="note-item note-item-loading">
<p class="semi-bold">Note</p>
<p class="note-excerpt">{{ note.text }}</p>
<mat-progress-spinner
mode="indeterminate"
diameter="24">
</mat-progress-spinner>
</div>
<!-- If this term is an active term -->
<ng-container *ngIf="(term$ | async).termCode.isActive()">
<mat-tab-group (selectedTabChange)="changeVisibleCredits($event)" [selectedIndex]="(enrolledCourses.length > 0) ? 0 : 1">
<mat-tab [label]="'In Progress (' + enrolledCourses.length + ')'" [aria-label]="'In Progress courses (' + enrolledCourses.length + ')'">
<ng-container cdkFocusinitial *ngTemplateOutlet="enrolled"></ng-container>
</mat-tab>
<mat-tab [label]="(isPrimaryPlan) ? 'Cart (' + plannedCourses.length + ')' : 'Planned (' + plannedCourses.length + ')'" [aria-label]="(isPrimaryPlan) ? 'Cart courses (' + plannedCourses.length + ')' : 'Planned courses (' + plannedCourses.length + ')'">
<ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container>
</mat-tab>
</ng-container>
<!-- If this term is a past term -->
<ng-container *ngIf="(term$ | async).termCode.isPast()">
<mat-tab-group (selectedTabChange)="changeVisibleCredits($event)" [selectedIndex]="0">
<mat-tab [label]="'Completed (' + enrolledCourses.length + ')'" [aria-label]="'Completed courses (' + enrolledCourses.length + ')'">
<ng-container cdkFocusinitial *ngTemplateOutlet="enrolled"></ng-container>
</mat-tab>
<mat-tab [label]="(isPrimaryPlan) ? 'Cart (' + plannedCourses.length + ')' : 'Planned (' + plannedCourses.length + ')'" [aria-label]="(isPrimaryPlan) ? 'Cart courses (' + plannedCourses.length + ')' : 'Planned courses (' + plannedCourses.length + ')'">
<ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container>
</mat-tab>
</ng-container>
<!-- If this term is a future term -->
<ng-container *ngIf="(term$ | async).termCode.isFuture()">
<ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container>
</ng-container>