Skip to content

Commit

Permalink
Merge branch 'dev' into CSCEXAM-1163-2
Browse files Browse the repository at this point in the history
  • Loading branch information
VirmasaloA committed Sep 26, 2024
2 parents 02c4fe4 + 2ec42d2 commit fba3fb7
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ng-template #content>
<div class="row m-2 xm-study-item-container">
<div class="col-md-9 col-6">
<h3>{{ exam.name }}</h3>
<h2>{{ exam.name }}</h2>
<div class="student-details-subtitle">
@if (!exam.reservationMade && exam.alreadyEnrolled && !exam.noTrialsLeft) {
<span class="text-danger">
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/enrolment/exams/exam-enrolments.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { EnrolmentDetailsComponent } from './exam-enrolment-details.component';
@if (exams.length > 0) {
<div class="row mt-2 ms-2 me-2">
<div class="col-12 ms-4">
<h3>{{ 'i18n_student_exams' | translate }}</h3>
<h2>{{ 'i18n_student_exams' | translate }}</h2>
</div>
</div>
@for (exam of exams; track exam) {
Expand Down
6 changes: 2 additions & 4 deletions ui/src/app/exam/editor/exam-tabs.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<xm-page-header [text]="examInfo.title || 'loading'" [prependTemplate]="linkBack" [appendTemplate]="status" />
<xm-page-content [content]="content" />
<ng-template #linkBack>
<a [routerLink]="[user.isAdmin ? '/staff/admin' : '/staff/teacher']">
<img class="pointer arrow_icon pe-4" src="/assets/images/icon_history.png" alt="go back" />
</a>
<xm-history-back></xm-history-back>
</ng-template>
<ng-template #status>
@if (exam?.state) {
<span class="exam-status float-end me-3">{{ 'i18n_' + exam.state | lowercase | translate }} </span>
<span class="exam-status float-end pe-3">{{ 'i18n_' + exam.state | lowercase | translate }} </span>
}
</ng-template>
<ng-template #content>
Expand Down
2 changes: 2 additions & 0 deletions ui/src/app/exam/editor/exam-tabs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import type { User } from 'src/app/session/session.service';
import { SessionService } from 'src/app/session/session.service';
import { PageContentComponent } from 'src/app/shared/components/page-content.component';
import { PageHeaderComponent } from 'src/app/shared/components/page-header.component';
import { HistoryBackComponent } from 'src/app/shared/history/history-back.component';
import { CourseCodeService } from 'src/app/shared/miscellaneous/course-code.service';
import type { UpdateProps } from './exam-tabs.service';
import { ExamTabService } from './exam-tabs.service';
Expand All @@ -44,6 +45,7 @@ import { ExamTabService } from './exam-tabs.service';
TranslateModule,
PageHeaderComponent,
PageContentComponent,
HistoryBackComponent,
],
styleUrl: './exam-tabs.component.scss',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ export class ExaminationQuestionComponent implements OnInit, AfterViewInit {
}

parseAriaLabel(expanded: string): string {
return (
this.translate?.instant(expanded) +
' ' +
this.translate?.instant('i18n_question') +
' ' +
this.questionTitle
);
return `${this.translate.instant(expanded)} ${this.translate.instant('i18n_question')} ${this.questionTitle}`;
}

ngAfterViewInit() {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/question/basequestion/question.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}
<xm-page-content [content]="content" />
<ng-template #linkBack>
<img (click)="cancel()" class="pointer arrow_icon pe-3" src="/assets/images/icon_history.png" alt="go back" />
<xm-history-back></xm-history-back>
</ng-template>
<ng-template #content>
<div class="row">
Expand Down
10 changes: 9 additions & 1 deletion ui/src/app/question/basequestion/question.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@ import { QuestionService } from 'src/app/question/question.service';
import type { User } from 'src/app/session/session.service';
import { PageContentComponent } from 'src/app/shared/components/page-content.component';
import { PageHeaderComponent } from 'src/app/shared/components/page-header.component';
import { HistoryBackComponent } from 'src/app/shared/history/history-back.component';
import { QuestionBodyComponent } from './question-body.component';

@Component({
selector: 'xm-question',
templateUrl: './question.component.html',
styleUrls: ['../question.shared.scss'],
standalone: true,
imports: [FormsModule, QuestionBodyComponent, TranslateModule, PageHeaderComponent, PageContentComponent],
imports: [
FormsModule,
QuestionBodyComponent,
TranslateModule,
PageHeaderComponent,
PageContentComponent,
HistoryBackComponent,
],
})
export class QuestionComponent implements OnInit, OnDestroy, CanComponentDeactivate {
@Input() newQuestion = false;
Expand Down
11 changes: 9 additions & 2 deletions ui/src/app/shared/history/history-back.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@
*
*/
import { Component } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';

@Component({
selector: 'xm-history-back',
template: `
<button class="btn btn-link" (click)="goBack($event)" (keydown)="onKeyDown($event)">
<img class="pointer arrow_icon" src="/assets/images/icon_history.png" alt="go back" />
<button
class="btn btn-link"
(click)="goBack($event)"
(keydown)="onKeyDown($event)"
[attr.aria-label]="'i18n_go_back' | translate"
>
<img class="pointer arrow_icon h-80 align-self-center" src="/assets/images/icon_history.png" alt="" />
</button>
`,
standalone: true,
imports: [TranslateModule],
})
export class HistoryBackComponent {
goBack = (event: Event) => {
Expand Down

0 comments on commit fba3fb7

Please sign in to comment.