Skip to content

Commit

Permalink
SolidStudies - Added interface
Browse files Browse the repository at this point in the history
  • Loading branch information
hanschrome committed Mar 26, 2023
1 parent ee1297b commit b3c1c12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/app-components/training-app/course/course.component.html
@@ -1,5 +1,6 @@
<div class="container" *ngIf="course && lectures">
<h5>Curso: {{ course.title }}</h5>
<p>Duración: {{ Math.ceil(course.duration/3600) }} horas</p>
<h6>Lección {{ currentLectureIndex + 1 }} de {{ lectures.length }}: <b>{{ lectures[currentLectureIndex]?.skill }}</b></h6>
<div class="video-container">
<div class="progress">
Expand All @@ -13,17 +14,19 @@ <h6>Lección {{ currentLectureIndex + 1 }} de {{ lectures.length }}: <b>{{ lectu
></iframe>
</div>
<div class="lecture-navigation">
<button class="btn" (click)="goToPreviousLecture()" [disabled]="currentLectureIndex === 0">&larr;</button>
<button class="btn" (click)="goToNextLecture()" [disabled]="currentLectureIndex === lectures.length - 1 || lectures[currentLectureIndex].status === 0">&rarr;</button>
<button title="Vídeo anterior" class="btn" (click)="goToPreviousLecture()" [disabled]="currentLectureIndex === 0">&larr;</button>
<button title="Siguiente vídeo" class="btn" (click)="goToNextLecture()" [disabled]="currentLectureIndex === lectures.length - 1 || lectures[currentLectureIndex].status === 0">&rarr;</button>
</div>
<div class="lecture-action">
<div class="lecture-action" *ngIf="!isCourseCompleted()">
<label>
<input type="checkbox" [(ngModel)]="lectures[currentLectureIndex].status" (change)="markAsDone(lectures[currentLectureIndex])" [disabled]="lectures[currentLectureIndex]?.status === 1" />
<span>Visto</span>
</label>
</div>
<div *ngIf="isCourseCompleted()">
<a class="btn" href="https://studies.solidjobs.org/course/{{courseUuid}}/certificate">Obtén tu certificado</a>
<p>¡Enhorabuena! Has conseguido terminar el curso, aquí está tu certificado.</p>
<a class="btn right" target="_blank" href="https://studies.solidjobs.org/course/{{courseUuid}}/certificate">Obtén tu certificado</a>
<p style="clear: both">Y recuerda <a href="/cv">agregarlo a tu CV.</a></p>
</div>
</div>
<app-loading *ngIf="this.loading"></app-loading>
Expand Up @@ -9,6 +9,9 @@ import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';
styleUrls: ['./course.component.css']
})
export class CourseComponent implements OnInit {

Math = Math;

courseUuid: string;
course: any;
lectures: any[];
Expand Down Expand Up @@ -57,6 +60,8 @@ export class CourseComponent implements OnInit {
goToNextLecture() {
if (this.currentLectureIndex < this.lectures.length - 1) {
this.currentLectureIndex++;
} else {
this.getCourse();
}
}

Expand Down

0 comments on commit b3c1c12

Please sign in to comment.