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

-
- -