From 68f45f6b81495e2ea8d6026452af9626c89afbb4 Mon Sep 17 00:00:00 2001 From: Fabio Fenoglio Date: Tue, 7 Dec 2021 08:34:53 +0100 Subject: [PATCH 1/9] fixed "show-more-btn" toggle logic --- static/js/main.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index d1c3689..0abca1a 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -164,12 +164,9 @@ function toggleCourseVisibility(elem) { } } - // toggle the current button visibility - elem.classList.toggle("hidden"); - // toggle the alternate button visibility - if (elem.id === "show-more-btn"){ - document.getElementById("show-less-btn").classList.toggle("hidden"); - }else{ - document.getElementById("show-more-btn").classList.toggle("hidden"); + // toggle the buttons visibility + let buttonsToToggle = elem.parentNode.getElementsByClassName("show-more-btn"); + for (var i = 0; i < buttonsToToggle.length; i++) { + buttonsToToggle[i].classList.toggle("hidden"); } } From d05153411aef386445e981c3387941de07351c8d Mon Sep 17 00:00:00 2001 From: Fabio Fenoglio Date: Tue, 7 Dec 2021 09:11:45 +0100 Subject: [PATCH 2/9] allow customization of number of items to show in "taken courses" when before collapsing --- layouts/partials/sections/education-alt.html | 7 ++++--- layouts/partials/sections/education.html | 7 ++++--- static/js/main.js | 11 ++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/layouts/partials/sections/education-alt.html b/layouts/partials/sections/education-alt.html index 2994fc5..13037a8 100644 --- a/layouts/partials/sections/education-alt.html +++ b/layouts/partials/sections/education-alt.html @@ -53,6 +53,7 @@ {{ end }} {{ if .takenCourses }} + {{ $showFirst := .takenCourses.showFirst | default 2 }}
{{ i18n "taken_courses" }}
{{ if .takenCourses.showGrades }} @@ -65,7 +66,7 @@ {{ range $index,$course := .takenCourses.courses }} - + {{ $course.name }} {{ if not $hideScale }}{{ $course.outOf }}{{ end }} {{ $course.achieved }} @@ -76,11 +77,11 @@ {{ else }}
    {{ range $index,$course := .takenCourses.courses }} -
  • {{ $course.name }}
  • +
  • {{ $course.name }}
  • {{ end }}
{{ end }} - {{ if gt (len .takenCourses.courses) 2 }} + {{ if gt (len .takenCourses.courses) $showFirst }}
{{ end }} {{ if .takenCourses }} - {{ $showFirst := .takenCourses.showFirst | default 2 }} + {{ $collapseAfter := .takenCourses.collapseAfter | default 2 }}
{{ i18n "taken_courses" }}
{{ if .takenCourses.showGrades }} @@ -66,7 +66,7 @@ {{ range $index,$course := .takenCourses.courses }} - + {{ $course.name }} {{ if not $hideScale }}{{ $course.outOf }}{{ end }} {{ $course.achieved }} @@ -77,11 +77,11 @@ {{ else }}
    {{ range $index,$course := .takenCourses.courses }} -
  • {{ $course.name }}
  • +
  • {{ $course.name }}
  • {{ end }}
{{ end }} - {{ if gt (len .takenCourses.courses) $showFirst }} + {{ if gt (len .takenCourses.courses) $collapseAfter }} +
+ + + + + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/cards/skill.html b/layouts/partials/cards/skill.html index cba5529..02f684f 100644 --- a/layouts/partials/cards/skill.html +++ b/layouts/partials/cards/skill.html @@ -1,22 +1,59 @@ +{{ $skillID := replace (lower .name) " " "-" }} +{{ if .id }} + {{ $skillID = .id }} +{{ end }} +{{ $logoImage := "" }} +{{ if .logo }} + {{ $logoImage = resources.Get .logo }} + + {{/* svg don't support "Fit" operation */}} + {{ if ne $logoImage.MediaType.SubType "svg" }} + {{ $logoImage = $logoImage.Fit "24x24" }} + {{ end }} + +{{ end }} +{{ if .popup }} +{{ partial "partials/cards/skill-popup.html" (dict "skill" .) }} +{{ end }} \ No newline at end of file From def066daeb03a782e1d6edb46a5975eb4bf7d7dc Mon Sep 17 00:00:00 2001 From: Fabio Fenoglio Date: Sat, 11 Dec 2021 11:24:15 +0100 Subject: [PATCH 9/9] added entry in main readme for new feature --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 38c63ba..1afdd86 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ Here is the check list for portfolio mode, - [x] Skill Cards - [x] Markdown Support + - [x] Skills breakdown popup - [x] **Experiences**