From 527c411d87de214fef3d17674f07a771e187d8f5 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Wed, 22 Apr 2026 11:35:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=A1=E7=89=87=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E6=93=8D=E4=BD=9C=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=B8=8D=E5=86=8D=E8=A2=AB=E6=8C=A4=E5=87=BA=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xian_favor/api.py | 49 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/xian_favor/api.py b/xian_favor/api.py index d851d8c..6752a3e 100644 --- a/xian_favor/api.py +++ b/xian_favor/api.py @@ -1033,6 +1033,25 @@ INDEX_TEMPLATE = ''' .item-card h6 { font-size: 14px; margin-bottom: 2px; } .item-card p { margin-bottom: 2px; } .item-card .text-muted.small { font-size: 12px; } + /* 卡片内容自适应布局 */ + .item-card .card-content { + display: flex; + flex-wrap: wrap; + gap: 8px; + } + .item-card .card-main { + flex: 1; + min-width: 150px; + } + .item-card .card-actions { + display: flex; + align-items: center; + gap: 2px; + flex-wrap: wrap; + } + .item-card .card-actions .btn { + white-space: nowrap; + } .type-text { border-left: 4px solid #17a2b8; } .type-link { border-left: 4px solid #28a745; } .type-column { border-left: 4px solid #6f42c1; } @@ -2007,8 +2026,8 @@ function renderItems(items) { container.innerHTML = items.map(item => `
-
-
+
+
${item.is_starred ? '' : ''} ${getTypeIcon(item.type)} ${item.title || truncate(item.content || item.url, 30)} ${item.type === 'todo' && item.status === 'completed' ? ' ✓' : ''} @@ -2024,7 +2043,7 @@ function renderItems(items) { ${item.type === 'todo' ? `${getStatusLabelShort(item.status)} ${getPriorityLabelShort(item.priority)} ${item.due_date ? '📅' + formatDueDate(item.due_date) : ''}` : ''}

-
+
${item.tags.slice(0, 2).map(t => `${t}`).join('')} - -
@@ -3335,8 +3354,8 @@ function renderTrash(items, total) { container.innerHTML = header + items.map(item => `
-
-
+
+
${getTypeIcon(item.type)} ${item.title || truncate(item.content || item.url, 30)}
@@ -3344,11 +3363,11 @@ function renderTrash(items, total) { 删除时间: ${formatShortDate(item.deleted_at)}

-
- -