Forked from an inaccessible project.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
course-item.component.html 5.17 KiB
<div
class="course-item {{ disabled ? 'disabled' : '' }} {{ status }}"
isFocusable="true"
isTabbable="true"
tabindex="0"
(click)="openCourseDetailsDialog()"
(keyup)="detectEnter($event)">
<div fxLayout="row" fxLayoutAlign="space-between start">
<div
fxLayout="column"
fxLayoutAlign="space-between start"
fxFlex="80"
aria-haspopup="true">
<div fxLayout="row" fxLayoutAlign="start center">
<div class="icon-number-wrapper">
<p cdkFocusRegionStart class="course-number">
{{ course | courseDescription }}
</p>
<span [ngSwitch]="status">
<i
*ngSwitchCase="'InProgress'"
class="material-icons in-progress-icon"
alt="Course is in progress"
aria-label="Course is in progress"
matTooltip="Course is in progress"
matTooltipPosition="above">
check_circle
</i>
<i
*ngSwitchCase="'Waitlisted'"
class="material-icons problem-icon"
alt="Course is waitlisted"
aria-label="Course is waitlisted"
matTooltip="Course is waitlisted"
matTooltipPosition="above">
report_problem
</i>
<i
*ngSwitchCase="'Incomplete'"
class="material-icons cancel-icon"
alt="Course is incomplete"
aria-label="Course is incomplete"
matTooltip="Course is incomplete"
matTooltipPosition="above">
cancel
</i>
<i
*ngSwitchCase="'NotOfferedInTerm'"
class="material-icons error-icon"
alt="Course is not offered in term"
aria-label="Course is not offered in term"
matTooltip="Course is not offered in term"
matTooltipPosition="above">
error
</i>
<i
*ngSwitchCase="'DoesNotExist'"
class="material-icons not-offered-icon"
alt="Course is no longer offered"
aria-label="Course is no longer offered"
matTooltip="Course is no longer offered"
matTooltipPosition="above">
remove
</i>
</span>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="start center">
<p class="course-title">
{{ course.title }}
</p>
</div>
</div>
<div fxLayout="column" fxLayoutAlign="space-between end" fxFlex="20">
<div *ngIf="!disabled" fxLayout="row" fxLayoutAlign="end center">
<button
class="course-item-menu-button"
cseClickStopPropigation
mat-icon-button
aria-label="Open course menu"
[matMenuTriggerFor]="courseMenu"
(menuOpened)="onMenuOpen()">
<mat-icon aria-label="Course menu" alt="Course menu" matTooltip="Course menu" matTooltipPosition="right">
more_horiz
</mat-icon>
</button>
<mat-menu #courseMenu="matMenu" class="course-item-menu" isFocusable="true" isTabbable="true">
<ng-template matMenuContent>
<button mat-menu-item (click)="openCourseDetailsDialog()" aria-describedby="course-details-content" aria-label="Open dialog to see course details">
Course details
</button>
<button mat-menu-item [matMenuTriggerFor]="academicYearsGroup" aria-label="Select to move this course to a different term">
Move to
</button>
<mat-menu #academicYearsGroup="matMenu" class="course-item-submenu">
<ng-template matMenuContent>
<button mat-menu-item *ngFor="let term of (droppableTermCodes$ | async)"
aria-labelledby="Move course to this term"
(click)="onMove(term)">
{{ term | getTermDescription }}
</button>
</ng-template>
</mat-menu>
<button
mat-menu-item
aria-label="Move this course to Saved for later"
*ngIf="type !== 'saved'"
(click)="onSaveForLater()">
Save for later
</button>
<button
mat-menu-item
aria-label="Remove this course from my plan"
*ngIf="type !== 'search'"
(click)="onRemove()">
Remove
</button>
</ng-template>
</mat-menu>
</div>
<div *ngIf="disabled" fxLayout="row" fxLayoutAlign="end center">
<p attr.aria-label="grade {{ course.grade }}">{{ course.grade || ' ' }}</p>
</div>
<div fxLayout="row" fxLayoutAlign="end center">
<p *ngIf="type !== 'saved'"
class="course-credits"
cdkFocusRegionEnd>
<ng-container *ngIf="course.credits !== undefined || course.creditRange !== undefined">
<span attr.aria-label="{{ course.credits ? course.credits : course.creditRange }} credits">{{ course.credits ? course.credits : course.creditRange }} Cr</span>
</ng-container>
</p>
</div>
</div>
</div>
</div>