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);