Skip to content
Snippets Groups Projects
term-container.component.html 3.08 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>
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed
      <div fxLayout="row" fxLayoutAlign="space-between center">
Isaac Evavold's avatar
Isaac Evavold committed
        <p class="text-right semi-bold credits">{{ credits$ | async }} Cr</p>
Isaac Evavold's avatar
Isaac Evavold committed
        <ng-container *ngIf="(note$ | async) as note; else newNote">
          <button mat-icon-button [disabled]="note.isLoaded === false" (click)="openNotesDialog(note)">
Isaac Evavold's avatar
Isaac Evavold committed
            <mat-icon
              aria-label="Open dialog with notes in this term"
              color="primary"
              matTooltip="Edit Note"
              matTooltipPosition="above">
              insert_drive_file
            </mat-icon>
Isaac Evavold's avatar
Isaac Evavold committed
          </button>
        </ng-container>
        <ng-template #newNote>
          <button mat-icon-button (click)="openNotesDialog()">
Isaac Evavold's avatar
Isaac Evavold committed
            <mat-icon
              aria-label="Open dialog with notes in this term"
              color="primary"
              matTooltip="Add Note"
              matTooltipPosition="above">
              note_add
            </mat-icon>
Isaac Evavold's avatar
Isaac Evavold committed
          </button>
        </ng-template>
Isaac Evavold's avatar
Isaac Evavold committed
      </div>
    </div>
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed
    <div id="term-{{termCode}}" class="term-body" cdkDropList
Isaac Evavold's avatar
Isaac Evavold committed
      [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
        <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>
        </ng-template>
Isaac Evavold's avatar
Isaac Evavold committed
      </ng-container>
Isaac Evavold's avatar
Isaac Evavold committed
      <!-- Render list of courses in this term -->
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed
      <div class="course-wrapper" *ngFor="let course of courses$ | async"
Isaac Evavold's avatar
Isaac Evavold committed
        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>