diff --git a/assets/scripts/competency-status-board.js b/assets/scripts/competency-status-board.js index d994c82..317924e 100755 --- a/assets/scripts/competency-status-board.js +++ b/assets/scripts/competency-status-board.js @@ -6,10 +6,68 @@ const STATES = [ { key: "comments", label: "Comments" }, ]; +const LEVELS = [ + { key: "graduate", label: "Graduate" }, + { key: "engineer", label: "Engineer" }, +]; + +let currentLevel = LEVELS[0].key; + function isMobile() { return window.matchMedia("(max-width: 600px)").matches; } +function renderLevelTabs() { + const board = document.getElementById("kanban-board"); + if (!board || document.getElementById("level-tabs")) return; + + const nav = document.createElement("div"); + nav.id = "level-tabs"; + + LEVELS.forEach(({ key, label }) => { + const btn = document.createElement("button"); + btn.textContent = label; + btn.dataset.level = key; + btn.className = "level-tab" + (key === currentLevel ? " active" : ""); + btn.addEventListener("click", () => { + currentLevel = key; + document.querySelectorAll(".level-tab").forEach(b => + b.classList.toggle("active", b.dataset.level === key) + ); + loadBoard(); + }); + nav.appendChild(btn); + }); + + board.insertAdjacentElement("beforebegin", nav); + + if (!document.getElementById("level-tab-styles")) { + const style = document.createElement("style"); + style.id = "level-tab-styles"; + style.textContent = ` + #level-tabs { + display: flex; + gap: 0.5em; + margin-bottom: 1em; + } + .level-tab { + padding: 0.4em 1.2em; + border: 1px solid #ccc; + background: none; + cursor: pointer; + border-radius: 4px; + font-size: 0.95em; + } + .level-tab.active { + background: #333; + color: #fff; + border-color: #333; + } + `; + document.head.appendChild(style); + } +} + function populateMobileControls(items) { if (!isMobile()) return; @@ -35,7 +93,6 @@ function populateMobileControls(items) { toSelect.appendChild(new Option(s.label, s.key)); }); - // Auto-fill "from" when item selected itemSelect.onchange = () => { const selected = itemSelect.selectedOptions[0]; if (selected?.dataset.state) { @@ -84,12 +141,8 @@ function countByState(items) { async function updateProgress(items) { const total = items.length; const completed = items.filter(i => i.state === "completed").length; - - const percent = total === 0 ? 0 : Math.round((completed / total) * 100); - console.log(`Progress: ${percent}% (${completed}/${total})`); - const fill = document.getElementById("progress-fill"); const label = document.getElementById("progress-label"); @@ -143,7 +196,7 @@ function createColumn(state, items, counts) { }); if (res.ok) { - loadBoard(); // simple & safe re-render + loadBoard(); } else { alert("Failed to update state"); } @@ -172,11 +225,13 @@ function renderBoard(items) { } async function loadBoard() { - const res = await fetch("/api/competencies/items"); + const res = await fetch(`/api/competencies/items?group=${currentLevel}`); const items = await res.json(); updateProgress(items); renderBoard(items); populateMobileControls(items); } + +renderLevelTabs(); loadBoard(); diff --git a/assets/styles/kanban.css b/assets/styles/kanban.css index 19d3c4b..5942e82 100755 --- a/assets/styles/kanban.css +++ b/assets/styles/kanban.css @@ -206,3 +206,48 @@ background: #22c55e; transition: width 0.3s ease; } +#level-tabs { + display: inline-flex; + align-items: center; + gap: 0; + margin-bottom: 1rem; + + //border: 1px solid var(--border-color, #ccc); + border-radius: 999px; + padding: 3px; + + background: var(--bg, #fff); + width: fit-content; +} + +.level-tab { + border: none; + background: transparent; + + padding: 0.35rem 1rem; + font-size: 0.85rem; + + border-radius: 999px; + cursor: pointer; + + color: var(--fg, #333); + + transition: + background 0.2s ease, + color 0.2s ease, + transform 0.1s ease; +} + +.level-tab:hover { + background: rgba(0,0,0,0.05); +} + +.level-tab.active { + background: #333; + color: white; + font-weight: 500; +} + +.level-tab:active { + transform: scale(0.97); +} diff --git a/blogs/blogs-list.org b/blogs/blogs-list.org index ea9bfd4..8160b4f 100755 --- a/blogs/blogs-list.org +++ b/blogs/blogs-list.org @@ -4,8 +4,8 @@ See the categories: @@html:Categories@@ * Blogs: -- [[file:2026/2026-list.org][2026 List]] @@html:08-03-2026 12:51@@ -- [[file:2025/2025-list.org][2025 List]] @@html:08-03-2026 12:51@@ +- [[file:2026/2026-list.org][2026 List]] @@html:08-03-2026 17:33@@ +- [[file:2025/2025-list.org][2025 List]] @@html:08-03-2026 17:33@@ - [[file:2026/03-march/01-03-week-review.org][[01-03-2026] - Weekly Review]] @@html:01-03-2026 12:00@@ @@html: review @@ - [[file:2026/02-february/27-02-26.org][Journeys rambles again...]] @@html:27-02-2026 17:12@@ @@html: life @@ - [[file:2026/02-february/26-02-26.org][Starting the Journeys Upgrade]] @@html:26-02-2026 17:32@@ @@html: life @@ diff --git a/home/status.org b/home/status.org index 2cac6b9..80938e3 100755 --- a/home/status.org +++ b/home/status.org @@ -4,8 +4,7 @@ #+COMMENTS: t #+SLUG: competency-board - -This page shows the status of the competencies I am working on (*grad*) +This page shows the status of the competencies I am working on. #+BEGIN_EXPORT html
diff --git a/posts/posts-list.org b/posts/posts-list.org index 6685944..e18d566 100755 --- a/posts/posts-list.org +++ b/posts/posts-list.org @@ -4,7 +4,7 @@ See the categories: @@html:Categories@@ * Posts: -- [[file:career/career-list.org][Career List]] @@html:08-03-2026 12:51@@ +- [[file:career/career-list.org][Career List]] @@html:08-03-2026 17:34@@ - [[file:career/restful-api.org][Restful API]] @@html:15-02-2026 23:00@@ @@html: @@ @@html: @@ - [[file:career/database-permissions.org][Database Permissions, Roles, and Accounts]] @@html:18-01-2026 23:00@@ @@html: @@ @@html: @@ - [[file:career/monitoring-and-logging.org][Monitoring and Logging]] @@html:18-01-2026 23:00@@ @@html: @@ @@html: @@ diff --git a/recently-updated.org b/recently-updated.org index 012c9b4..f1ebb4b 100755 --- a/recently-updated.org +++ b/recently-updated.org @@ -2,9 +2,10 @@ #+OPTIONS: toc:nil num:nil * Recently Updated (top 26 files - per lima's request) +- [[file:posts/career/restful-api.org][Restful API]] @@html:2026-03-08 17:23@@ +- [[file:home/status.org][Competency Status Board]] @@html:2026-03-08 16:28@@ - [[file:blogs/2026/02-february/27-02-26.org][Journeys rambles again...]] @@html:2026-03-07 16:33@@ - [[file:blogs/2026/03-march/01-03-week-review.org][[01-03-2026] - Weekly Review]] @@html:2026-03-07 12:45@@ -- [[file:posts/career/restful-api.org][Restful API]] @@html:2026-03-05 13:20@@ - [[file:posts/career/database-permissions.org][Database Permissions, Roles, and Accounts]] @@html:2026-03-05 13:06@@ - [[file:posts/career/monitoring-and-logging.org][Monitoring and Logging]] @@html:2026-03-05 12:58@@ - [[file:posts/career/pipelines.org][Pipelines and how they work (as well as CI/CD)]] @@html:2026-03-05 11:52@@ @@ -26,5 +27,4 @@ - [[file:blogs/2025/12-december/28-12-week-review.org][[28-12-2025] - Weekly Review]] @@html:2026-01-17 21:08@@ - [[file:blogs/2026/01-january/04-01-week-review.org][[04-01-2026] - Weekly Review]] @@html:2026-01-17 21:08@@ - [[file:posts/career/probation-objectives.org][Probation Objectives:]] @@html:2026-01-17 21:06@@ -- [[file:home/status.org][Competency Status Board]] @@html:2026-01-10 20:47@@ - [[file:posts/career/invest-principles.org][Invest Principles]] @@html:2026-01-04 17:15@@ diff --git a/sitemap.org b/sitemap.org index 40eae9f..8e5144f 100755 --- a/sitemap.org +++ b/sitemap.org @@ -9,8 +9,8 @@ - [[file:home/backlog.org][Backlog]] - [[file:home/setup.org][Setup]] - [[file:home/notes.org][Notes]] - - [[file:home/status.org][Competency Status Board]] - [[file:home/services.org][Service]] + - [[file:home/status.org][Competency Status Board]] - [[file:home/categories.org][Categories]] - posts - [[file:posts/posts-intro.org][Posts Introduction]]