Kaynağa Gözat

Add optional variable to education for courses where scaling doesn't make sense (#231)

* Add optional variable to education

Scales for courses doesnt always apply

* Rename var

*not* !important

* Rename var

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Roxedus 4 yıl önce
ebeveyn
işleme
0104c49a4a

+ 4 - 3
layouts/partials/sections/education-alt.html

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

+ 4 - 3
layouts/partials/sections/education.html

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