From 8ac6f1af6bb064c9939924a29091e3b601fb3db5 Mon Sep 17 00:00:00 2001 From: mac Date: Thu, 4 Jun 2026 16:38:54 +0800 Subject: [PATCH] =?UTF-8?q?v1.4.5=20=E2=80=94=20=E8=93=9D=E5=9B=BE?= =?UTF-8?q?=E5=8E=BB=E7=BB=9F=E8=AE=A1=E6=95=B0+=E5=8B=A4=E5=AD=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 六板块卡片移除统计数字,仅保留 emoji+名称 - 勤学项在列表中显示备注 note --- app.py | 1 + static/app.js | 13 +++---------- static/style.css | 9 +++++++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app.py b/app.py index 5b21940..2eccdab 100644 --- a/app.py +++ b/app.py @@ -137,6 +137,7 @@ def compute_stats(): all_study_items.append({ 'name': name.strip(), 'done': si.get('done', False) if isinstance(si, dict) else False, + 'note': si.get('note', '') if isinstance(si, dict) else '', 'pillar': pillar }) diff --git a/static/app.js b/static/app.js index e09f88a..a263152 100644 --- a/static/app.js +++ b/static/app.js @@ -1026,18 +1026,9 @@ if (!container) return; var html = ''; PILLARS.forEach(function(p){ - var info = pb[p.name] || {}; - var m = info.morning || 0, e = info.evening || 0, s = info.study || 0; - var total = m + e + s; html += '
' + '
' + p.emoji + '
' + '
' + p.name + '
' + - '
' + - (m ? '🥼' + m + '' : '') + - (e ? '🔍' + e + '' : '') + - (s ? '📚' + s + '' : '') + - (total === 0 ? '' : '') + - '
' + '
'; }); container.innerHTML = html; @@ -1057,7 +1048,7 @@ (info.evening_items || []).forEach(function(ei){ items.push({pillar: p, text: ei.mistake || ei.improvement, type: 'evening'}); }); } if (blueprintFilter === 'all' || blueprintFilter === 'study') { - (info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', done: si.done}); }); + (info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', done: si.done, note: si.note}); }); } }); if (items.length === 0) { @@ -1069,10 +1060,12 @@ var typeLabels = {morning: '立志', evening: '责善', study: '勤学'}; var html = ''; items.forEach(function(item){ + var noteHtml = item.type === 'study' && item.note ? '' + esc(item.note) + '' : ''; html += '
' + '' + item.pillar.emoji + ' ' + item.pillar.name + '' + '' + (typeLabels[item.type] || item.type) + '' + '' + esc(item.text) + '' + + noteHtml + '
'; }); list.innerHTML = html; diff --git a/static/style.css b/static/style.css index 71c7204..27d6645 100644 --- a/static/style.css +++ b/static/style.css @@ -1531,6 +1531,15 @@ body { text-overflow: ellipsis; white-space: nowrap; } +.bp-item-note { + font-size: 11px; + color: var(--text-muted); + margin-left: 8px; + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .bp-list-empty { font-size: 13px; color: var(--text-muted);