Add optional variable to education

Scales for courses doesnt always apply
This commit is contained in:
Roxedus 2021-02-16 01:01:31 +01:00
parent b1e1b7c5d6
commit db6ee061c5
No known key found for this signature in database
GPG key ID: 9B4E311961C63639
2 changed files with 8 additions and 6 deletions

View file

@ -51,18 +51,19 @@
{{ if .takenCourses }} {{ if .takenCourses }}
<div class="taken-courses"> <div class="taken-courses">
<h6 class="text-muted">{{ i18n "taken_courses" }}</h6> <h6 class="text-muted">{{ i18n "taken_courses" }}</h6>
{{ if .takenCourses.showGrades }} {{ if .takenCourses.showGrades }}
{{ $isScale := .takenCourses.isScale }}
<table> <table>
<thead> <thead>
<th>{{ i18n "course_name" }}</th> <th>{{ i18n "course_name" }}</th>
<th>{{ i18n "total_credit" }}</th> {{ if $isScale }}<th>{{ i18n "total_credit" }}</th>{{ end }}
<th>{{ i18n "obtained_credit" }}</th> <th>{{ i18n "obtained_credit" }}</th>
</thead> </thead>
<tbody> <tbody>
{{ range $index,$course := .takenCourses.courses }} {{ range $index,$course := .takenCourses.courses }}
<tr class="course {{ if gt $index 1 }}hidden-course{{ end}}"> <tr class="course {{ if gt $index 1 }}hidden-course{{ end}}">
<td>{{ $course.name }}</td> <td>{{ $course.name }}</td>
<td>{{ $course.outOf }}</td> {{ if $isScale }}<td>{{ $course.outOf }}</td>{{ end }}
<td>{{ $course.achieved }}</td> <td>{{ $course.achieved }}</td>
</tr> </tr>
{{ end }} {{ end }}

View file

@ -51,18 +51,19 @@
{{ if .takenCourses }} {{ if .takenCourses }}
<div class="taken-courses"> <div class="taken-courses">
<h6 class="text-muted">{{ i18n "taken_courses"}}</h6> <h6 class="text-muted">{{ i18n "taken_courses"}}</h6>
{{ if .takenCourses.showGrades }} {{ if .takenCourses.showGrades }}
{{ $isScale := .takenCourses.isScale }}
<table> <table>
<thead> <thead>
<th>{{ i18n "course_name"}}</th> <th>{{ i18n "course_name"}}</th>
<th>{{ i18n "total_credit"}}</th> {{ if $isScale }}<th>{{ i18n "total_credit"}}</th>{{ end }}
<th>{{ i18n "obtained_credit"}}</th> <th>{{ i18n "obtained_credit"}}</th>
</thead> </thead>
<tbody> <tbody>
{{ range $index,$course := .takenCourses.courses }} {{ range $index,$course := .takenCourses.courses }}
<tr class="course {{ if gt $index 1 }}hidden-course{{ end}}"> <tr class="course {{ if gt $index 1 }}hidden-course{{ end}}">
<td>{{ $course.name }}</td> <td>{{ $course.name }}</td>
<td>{{ $course.outOf }}</td> {{ if $isScale }}<td>{{ $course.outOf }}</td>{{ end }}
<td>{{ $course.achieved }}</td> <td>{{ $course.achieved }}</td>
</tr> </tr>
{{ end }} {{ end }}