Skip to content
Snippets Groups Projects
term-container.component.html 2.1 KiB
Newer Older
<mat-card class="term-container">
	<div class="term-inner">
		<div fxLayout="row" class="term-header" fxLayoutAlign="space-between center">
			<h2>{{ term.termCode | getTermDescription }}</h2>
			<div fxLayout="row" fxLayoutAlign="end center">
				<p class="text-right semi-bold credits">{{ getTotalCredits() }} Cr</p>
				<button mat-icon-button>
					<ng-container *ngIf="term.note as note; else newNote">
						<mat-icon
							aria-label="Open dialog with notes in this term"
							class="add-note-icon"
							(click)="openNotesDialog()"
							matTooltip="Edit Note"
							matTooltipPosition="above">insert_drive_file</mat-icon>
					</ng-container>
					<ng-template #newNote>
						<mat-icon
							aria-label="Open dialog with notes in this term"
							class="add-note-icon"
							(click)="openNotesDialog()"
							matTooltip="Add Note"
							matTooltipPosition="above">note_add</mat-icon>
					</ng-template>
				 </button>
			</div>
		</div>
			id="term-{{term.termCode}}"
			[cdkDropListData]="term.courses"
			class="course-list"

			<ng-container *ngIf="term.note as note">
				<div class="note-item" (click)="openNotesDialog()">
					<p class="semi-bold">Note</p>
					<p class="note-excerpt">{{ note.note }}</p>
				</div>
			</ng-container>
			<div 
				class="course-wrapper" 
				cdkDrag
				[cdkDragDisabled]="(isPastTerm$ | async) || course.id === null"
				[cdkDragData]="course" 
				*ngFor="let course of term.courses"
			>
				<div class="course-wrapper-inner">
					<cse-course-item [course]="course" type="course" [disabled]="(isPastTerm$ | async) || course.id === null" [isPastTerm]="(isPastTerm$ | async)" [isCurrentTerm]="(isCurrentTerm$ | async)"></cse-course-item>
				</div>
			</div>

			<div class="no-courses" *ngIf="term.courses.length === 0">
				<p>No Courses Taken</p>
			</div>
		</div>
	</div>
	<div class="add-new-wrapper" *ngIf="!(isPastTerm$ | async)">
Scott Berg's avatar
Scott Berg committed
		<button mat-raised-button (click)="toggleCourseSearch()" class="add-course-button">+ Add Course</button>
</mat-card>