|
5 | 5 | <div class="space-container"> |
6 | 6 | <mat-toolbar class="primary-color font-size-1"> |
7 | 7 | <h3 class="margin-lr-3 ellipsis-title"><ng-container i18n>Step</ng-container> {{stepNum}}<span *ngIf="stepDetail.stepTitle">: </span>{{stepDetail.stepTitle}}</h3> |
8 | | - <button *ngIf="isOpenai && stepDetail?.description" mat-stroked-button class="margin-lr-3" (click)="showChat = !showChat" i18n> |
9 | | - {{ showChat ? 'Hide Course Chat' : 'Show Course Chat' }} |
10 | | - </button> |
11 | 8 | <span class="toolbar-fill"></span> |
12 | 9 | <div class="toolbar-actions"> |
13 | 10 | <button mat-icon-button *ngIf="resource?._attachments && !showChat" (click)="this.isGridView = !this.isGridView"> |
14 | 11 | <mat-icon>{{isGridView ? 'view_list' : 'view_column'}}</mat-icon> |
15 | 12 | </button> |
16 | 13 | <span class="margin-lr-10" *ngIf="attempts && !parent" i18n>Past attempts: {{attempts}}</span> |
17 | | - <a |
18 | | - mat-raised-button |
19 | | - color="accent" |
20 | | - class="margin-lr-10" |
21 | | - *ngIf="attempts > 0" |
22 | | - (click)="openReviewDialog()" i18n> |
23 | | - Review Attempts |
24 | | - </a> |
25 | | - <a |
26 | | - mat-raised-button |
27 | | - color="accent" |
28 | | - class="margin-lr-10" |
29 | | - *ngIf="stepDetail?.exam?.questions.length && isUserEnrolled" |
30 | | - (click)="goToExam()" i18n> |
31 | | - {examText, select, take {Take Test} continue {Continue Test} retake {Retake Test}} |
32 | | - </a> |
33 | | - <a |
34 | | - mat-raised-button |
35 | | - color="accent" |
36 | | - class="margin-lr-10" |
37 | | - *ngIf="stepDetail?.survey?.questions.length && isUserEnrolled" |
38 | | - (click)="goToExam('survey')" i18n> |
39 | | - Take Survey |
40 | | - </a> |
41 | | - <button *ngIf="canManage && (stepDetail?.exam?.questions.length || stepDetail?.survey?.questions.length)" class="margin-lr-10" color="accent" mat-raised-button [matMenuTriggerFor]="previewMenu" (click)="menuTriggerButtonClick()" i18n> |
42 | | - Preview |
43 | | - </button> |
44 | | - <mat-menu #previewMenu="matMenu"> |
45 | | - <a mat-menu-item |
46 | | - *ngIf="stepDetail?.exam?.questions.length" |
47 | | - (click)="goToExam('exam', true)" i18n> |
48 | | - Preview Test |
49 | | - </a> |
50 | | - <a mat-menu-item |
51 | | - *ngIf="stepDetail?.survey?.questions.length" |
52 | | - (click)="goToExam('survey', true)" i18n> |
53 | | - Preview Survey |
54 | | - </a> |
55 | | - </mat-menu> |
56 | | - <a |
57 | | - mat-raised-button |
58 | | - color="accent" |
59 | | - class="margin-lr-10" |
60 | | - *ngIf="stepDetail.resources.length !== 0" |
61 | | - [routerLink]="['/resources/view', resource._id]" |
62 | | - target="_blank" |
63 | | - i18n> |
64 | | - View Resource Details |
65 | | - </a> |
| 14 | + <ng-container *ngIf="!isMobile"> |
| 15 | + <ng-container *ngTemplateOutlet="actionButtons"></ng-container> |
| 16 | + </ng-container> |
| 17 | + <ng-container *ngIf="isMobile && hasActionButtons"> |
| 18 | + <button mat-icon-button [matMenuTriggerFor]="mobileActionsMenu"> |
| 19 | + <mat-icon>more_vert</mat-icon> |
| 20 | + </button> |
| 21 | + <mat-menu #mobileActionsMenu="matMenu" class="actions-menu"> |
| 22 | + <ng-container *ngTemplateOutlet="actionButtons"></ng-container> |
| 23 | + </mat-menu> |
| 24 | + </ng-container> |
66 | 25 | <span>{{stepNum}}/{{maxStep}}</span> |
67 | 26 | <button mat-icon-button *ngIf="maxStep !== 1" [disabled]="stepNum === 1 || isLoading" (click)="changeStep(-1)"><mat-icon>navigate_before</mat-icon></button> |
68 | 27 | <button mat-icon-button *ngIf="stepNum !== maxStep" [disabled]="isLoading || !canProceedToNextStep()" (click)="changeStep(1)"><mat-icon>navigate_next</mat-icon></button> |
69 | | - <button mat-raised-button color="accent" class="margin-lr-10" *ngIf="stepNum === maxStep" [disabled]="isLoading || !canProceedToNextStep()" (click)="backToCourseDetail()" i18n>Finish</button> |
| 28 | + <button mat-icon-button i18n-matTooltip matTooltip="Finish" *ngIf="stepNum === maxStep && isMobile" [disabled]="isLoading || !canProceedToNextStep()" (click)="backToCourseDetail()"><mat-icon>check</mat-icon></button> |
| 29 | + <button mat-raised-button color="accent" class="margin-lr-10" *ngIf="stepNum === maxStep && !isMobile" [disabled]="isLoading || !canProceedToNextStep()" (click)="backToCourseDetail()" i18n>Finish</button> |
70 | 30 | </div> |
71 | 31 | </mat-toolbar> |
| 32 | + |
| 33 | + <ng-template #actionButtons> |
| 34 | + <button *ngIf="isOpenai && stepDetail?.description" |
| 35 | + mat-stroked-button |
| 36 | + [ngClass]="{ 'margin-lr-3': !isMobile }" |
| 37 | + (click)="showChat = !showChat" i18n> |
| 38 | + {{ showChat ? 'Hide Course Chat' : 'Show Course Chat' }} |
| 39 | + </button> |
| 40 | + <a |
| 41 | + mat-raised-button |
| 42 | + color="accent" |
| 43 | + [ngClass]="{ 'margin-lr-10': !isMobile }" |
| 44 | + *ngIf="attempts > 0" |
| 45 | + (click)="openReviewDialog()" i18n> |
| 46 | + Review Attempts |
| 47 | + </a> |
| 48 | + <a |
| 49 | + mat-raised-button |
| 50 | + color="accent" |
| 51 | + [ngClass]="{ 'margin-lr-10': !isMobile }" |
| 52 | + *ngIf="stepDetail?.exam?.questions.length && isUserEnrolled" |
| 53 | + (click)="goToExam()" i18n> |
| 54 | + {examText, select, take {Take Test} continue {Continue Test} retake {Retake Test}} |
| 55 | + </a> |
| 56 | + <a |
| 57 | + mat-raised-button |
| 58 | + color="accent" |
| 59 | + [ngClass]="{ 'margin-lr-10': !isMobile }" |
| 60 | + *ngIf="stepDetail?.survey?.questions.length && isUserEnrolled" |
| 61 | + (click)="goToExam('survey')" i18n> |
| 62 | + Take Survey |
| 63 | + </a> |
| 64 | + <button *ngIf="canManage && (stepDetail?.exam?.questions.length || stepDetail?.survey?.questions.length)" |
| 65 | + #previewTrigger="matMenuTrigger" |
| 66 | + [ngClass]="{ 'margin-lr-10': !isMobile }" |
| 67 | + color="accent" mat-raised-button [matMenuTriggerFor]="previewMenu" (click)="menuTriggerButtonClick()" i18n> |
| 68 | + Preview |
| 69 | + </button> |
| 70 | + <mat-menu #previewMenu="matMenu"> |
| 71 | + <a mat-menu-item |
| 72 | + *ngIf="stepDetail?.exam?.questions.length" |
| 73 | + (click)="goToExam('exam', true)" i18n> |
| 74 | + Preview Test |
| 75 | + </a> |
| 76 | + <a mat-menu-item |
| 77 | + *ngIf="stepDetail?.survey?.questions.length" |
| 78 | + (click)="goToExam('survey', true)" i18n> |
| 79 | + Preview Survey |
| 80 | + </a> |
| 81 | + </mat-menu> |
| 82 | + <a |
| 83 | + mat-raised-button |
| 84 | + color="accent" |
| 85 | + [ngClass]="{ 'margin-lr-10': !isMobile }" |
| 86 | + *ngIf="stepDetail.resources.length !== 0" |
| 87 | + [routerLink]="['/resources/view', resource._id]" |
| 88 | + target="_blank" |
| 89 | + i18n> |
| 90 | + View Resource Details |
| 91 | + </a> |
| 92 | + </ng-template> |
72 | 93 | <div class="view-container view-full-height" [ngClass]="{'grid-view': showChat, 'flex-view': !isGridView && !showChat}" *ngIf="stepDetail?.description || resource?._attachments; else emptyRecord"> |
73 | 94 | <planet-chat-window *ngIf="showChat" [context]="{type: 'coursestep', data: localizedStepInfo, resource: { id: resource?._id, attachments: resource?._attachments } }" [conversations]="conversations"></planet-chat-window> |
74 | 95 | <ng-container *ngIf="showChat; else stepViewContent"> |
|
0 commit comments