|
|
|
|
@@ -539,11 +539,11 @@ INDEX_TEMPLATE = '''
|
|
|
|
|
.content { padding: 20px; }
|
|
|
|
|
.card { margin-bottom: 8px; transition: transform 0.2s; }
|
|
|
|
|
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
|
|
|
|
|
.card-body { padding: 10px 15px; }
|
|
|
|
|
.card-body { padding: 8px 12px; }
|
|
|
|
|
.tag { margin-right: 5px; }
|
|
|
|
|
.item-card { font-size: 14px; }
|
|
|
|
|
.item-card h6 { font-size: 14px; margin-bottom: 4px; }
|
|
|
|
|
.item-card p { margin-bottom: 4px; }
|
|
|
|
|
.item-card h6 { font-size: 14px; margin-bottom: 2px; }
|
|
|
|
|
.item-card p { margin-bottom: 2px; }
|
|
|
|
|
.item-card .text-muted.small { font-size: 12px; }
|
|
|
|
|
.type-text { border-left: 4px solid #17a2b8; }
|
|
|
|
|
.type-link { border-left: 4px solid #28a745; }
|
|
|
|
|
@@ -1184,6 +1184,9 @@ function renderItems(items) {
|
|
|
|
|
${item.url ? truncate(item.url, 50) : item.content ? truncate(item.content, 50) : item.note ? truncate(item.note, 50) : ''}
|
|
|
|
|
${item.type === 'todo' ? `${getStatusLabelShort(item.status)} ${getPriorityLabelShort(item.priority)} ${item.due_date ? '📅' + formatDueDate(item.due_date) : ''}` : ''}
|
|
|
|
|
</p>
|
|
|
|
|
<p class="text-muted mb-0" style="font-size:10px; opacity:0.6;">
|
|
|
|
|
${formatShortDate(item.created_at)}${item.updated_at && item.updated_at !== item.created_at ? ' → ' + formatShortDate(item.updated_at) : ''}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="d-flex align-items-center gap-1 flex-wrap ms-2" onclick="event.stopPropagation();">
|
|
|
|
|
${item.tags.slice(0, 2).map(t => `<span class="badge bg-secondary" style="font-size:10px;">${t}</span>`).join('')}
|
|
|
|
|
@@ -1628,6 +1631,17 @@ function truncate(str, len) {
|
|
|
|
|
return str && str.length > len ? str.substring(0, len) + '...' : str || '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 简短日期格式(用于卡片显示)
|
|
|
|
|
function formatShortDate(dateStr) {
|
|
|
|
|
if (!dateStr) return '';
|
|
|
|
|
const date = new Date(dateStr);
|
|
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
const hour = String(date.getHours()).padStart(2, '0');
|
|
|
|
|
const min = String(date.getMinutes()).padStart(2, '0');
|
|
|
|
|
return `${month}-${day} ${hour}:${min}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatDate(dateStr) {
|
|
|
|
|
return new Date(dateStr).toLocaleString('zh-CN');
|
|
|
|
|
}
|
|
|
|
|
|