Display GD schedule as a readable vertical list

This commit is contained in:
Adilet 2026-11-06 06:24:31 +00:00
parent 6c6eb44dc7
commit df03e73807
2 changed files with 19 additions and 7 deletions

View File

@ -160,7 +160,7 @@
<!-- Визуализация запланированных встреч (placeholder) -->
<section class="schedule-visual" style="margin-top:var(--kt-ai-space-9);">
<h3 style="color:var(--kt-ai-fg);">Schedule</h3>
<div id="schedule-placeholder" style="min-height:100px; border:1px dashed rgba(255,255,255,0.5); display:flex; align-items:center; justify-content:center; color:rgba(255,255,255,0.7);">Здесь будет отображаться график встреч</div>
<div id="schedule-placeholder" style="display:flex;flex-direction:column;gap:8px;color:var(--kt-ai-fg);"></div>
</section>
</div>
<div class="right-column" style="flex:1; background:var(--kt-ai-bg-soft); color:var(--kt-ai-fg); padding:var(--kt-ai-space-6); border-radius:10px;">

View File

@ -122,6 +122,7 @@ function setupCalendar() {
// ---- Рендер ----
function renderBoard(key) {
if (key === "gdplan") renderSchedule();
const list = document.getElementById("list-" + key);
if (!list) return;
let items = state[key] || [];
@ -172,12 +173,23 @@ function renderBoard(key) {
</div>`).join("");
}
function renderSchedule(){
const placeholder=$1('#schedule-placeholder');
if(!placeholder) return;
if(!state.gdplan.length){placeholder.innerHTML='<div class="empty">Нет запланированных встреч</div>';return;}
const items=state.gdplan.slice().sort((a,b)=>{const ta=a.time||'99:99',tb=b.time||'99:99';return ta.localeCompare(tb);});
placeholder.innerHTML=items.map(t=>`<div class="schedule-item"><span class="task-time">${escapeHtml(t.time||'')}</span> ${escapeHtml(t.text)}</div>`).join('');
function renderSchedule() {
const placeholder = $1("#schedule-placeholder");
if (!placeholder) return;
if (!state.gdplan.length) {
placeholder.innerHTML = '<div class="empty">Нет запланированных встреч</div>';
return;
}
const items = state.gdplan.slice().sort((a, b) =>
(a.due || "9999-99-99").localeCompare(b.due || "9999-99-99") ||
(a.time || "99:99").localeCompare(b.time || "99:99")
);
placeholder.innerHTML = items.map(t => `
<div class="schedule-item" style="display:grid;grid-template-columns:auto auto 1fr;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--kt-ai-border);border-radius:10px;background:var(--kt-ai-surface);color:var(--kt-ai-fg);">
<span style="color:var(--kt-ai-fg-muted);font-size:13px;">${escapeHtml(fmtDateShort(t.due))}</span>
<span class="task-time">${escapeHtml(t.time || "—")}</span>
<span>${escapeHtml(t.text)}</span>
</div>`).join("");
}
function renderNews() {
const list = document.getElementById("list-news");