Skip to content
Snippets Groups Projects
term-container.component.html 2.61 KiB
Newer Older
<mat-card class="term-container">
Isaac Evavold's avatar
Isaac Evavold committed
  <div class="term-inner">
    <div fxLayout="row" class="term-header" fxLayoutAlign="space-between center">
      <h2>{{ termCode | getTermDescription }}</h2>
      <div fxLayout="row" fxLayoutAlign="end center">
        <p class="text-right semi-bold credits">{{ credits$ | async }} Cr</p>
        <button mat-icon-button>
          <ng-container *ngIf="(note$ | async) as note; else newNote">
            <mat-icon
              aria-label="Open dialog with notes in this term"
              color="primary"
              matTooltip="Edit Note"
Isaac Evavold's avatar
Isaac Evavold committed
              (click)="openNotesDialog(note)"
Isaac Evavold's avatar
Isaac Evavold committed
              matTooltipPosition="above">
              insert_drive_file
            </mat-icon>
          </ng-container>
          <ng-template #newNote>
            <mat-icon
              aria-label="Open dialog with notes in this term"
              color="primary"
              matTooltip="Add Note"
Isaac Evavold's avatar
Isaac Evavold committed
              (click)="openNotesDialog()"
Isaac Evavold's avatar
Isaac Evavold committed
              matTooltipPosition="above">
              note_add
            </mat-icon>
          </ng-template>
         </button>
      </div>
    </div>
    <div
      id="term-{{termCode}}"
      cdkDropList
      [cdkDropListData]="(term$ | async).termCode"
      [cdkDropListConnectedTo]="dropZoneIds$ | async"
      (cdkDropListDropped)="drop($event)">
Isaac Evavold's avatar
Isaac Evavold committed
      <!-- Render term note (if it exists) -->
      <ng-container *ngIf="note$ | async as note">
Isaac Evavold's avatar
Isaac Evavold committed
        <div class="note-item" (click)="openNotesDialog(note)">
Isaac Evavold's avatar
Isaac Evavold committed
          <p class="semi-bold">Note</p>
          <p class="note-excerpt">{{ note.note }}</p>
        </div>
      </ng-container>
Isaac Evavold's avatar
Isaac Evavold committed
      <!-- Render list of courses in this term -->
      <div
        class="course-wrapper"
        *ngFor="let course of courses$ | async"
        cdkDrag
        [cdkDragDisabled]="(isPastTerm$ | async) || course.id === null"
        [cdkDragData]="course">
        <div class="course-wrapper-inner">
          <cse-course-item
            type="course"
            [course]="course"
            [isPastTerm]="(isPastTerm$ | async)"
            [isCurrentTerm]="(isCurrentTerm$ | async)"
            [disabled]="(isPastTerm$ | async) || (course.id === null)">
          </cse-course-item>
        </div>
      </div>
Isaac Evavold's avatar
Isaac Evavold committed
      <div class="no-courses" *ngIf="(courses$ | async).length === 0">
        <p>{{ (isPastTerm$ | async) ? 'No Courses Taken' : 'No Courses Planned' }}</p>
      </div>
    </div>
  </div>
  <div class="add-new-wrapper" *ngIf="(isPastTerm$ | async) === false">
    <button
      mat-raised-button
      class="add-course-button"
Isaac Evavold's avatar
Isaac Evavold committed
      + Add Course
    </button>
Isaac Evavold's avatar
Isaac Evavold committed
</mat-card>