feat(postlesson): show group cover photo card in post-lesson tasks; tweaks
This commit is contained in:
+13
-4
@@ -119,6 +119,15 @@ function renderPostLessonTasks() {
|
||||
else if (t.overdue) { badgeCls = 'overdue'; badgeText = 'Просрочена'; barColor = '#ef4444'; }
|
||||
return `
|
||||
<div class="post-task ${allDone ? 'all-done' : ''} ${isOverdue ? 'overdue' : ''} ${isDismissed ? 'dismissed' : ''}" data-task-key="${esc(t.key)}" data-task-link="${esc(link)}">
|
||||
<div class="post-task-body">
|
||||
${t.group_cover
|
||||
? `<button type="button" class="post-task-photo" data-img="${esc(API + t.group_cover)}" title="Открыть фото"><img src="${esc(thumbSrc(t.group_cover))}" alt="${esc(t.group_name)}" loading="lazy"></button>`
|
||||
: `<div class="post-task-photo post-task-photo--empty" title="Нет фото"><i data-lucide="image"></i></div>`}
|
||||
<div class="post-task-content">
|
||||
<div class="post-task-progress">
|
||||
<div class="post-task-progress-track"><div class="post-task-progress-bar" style="width:${pct}%;background:${barColor}"></div></div>
|
||||
<span class="post-task-progress-count">${completed}/${steps2.length}</span>
|
||||
</div>
|
||||
<div class="post-task-head">
|
||||
<div class="post-task-main">
|
||||
<div class="post-task-title">${esc(t.group_name)}<span class="post-task-date"> · ${esc(t.lesson_date)}</span></div>
|
||||
@@ -126,10 +135,6 @@ function renderPostLessonTasks() {
|
||||
</div>
|
||||
<span class="post-task-badge ${badgeCls}">${badgeText}</span>
|
||||
</div>
|
||||
<div class="post-task-progress">
|
||||
<div class="post-task-progress-track"><div class="post-task-progress-bar" style="width:${pct}%;background:${barColor}"></div></div>
|
||||
<span class="post-task-progress-count">${completed}/${steps2.length}</span>
|
||||
</div>
|
||||
<div class="post-task-steps">
|
||||
${steps2.map((s, i) => {
|
||||
const related = (s.key === 'shorts' && Array.isArray(s.related) && s.related.length) ? s.related : [];
|
||||
@@ -147,6 +152,8 @@ function renderPostLessonTasks() {
|
||||
: `<button type="button" class="btn-xs post-task-close" data-close-task="${esc(t.key)}" title="Закрыть задачу">Закрыть задачу</button>`}
|
||||
<button type="button" class="btn-xs post-task-detail" data-detail-task="${esc(t.key)}" title="Подробнее">Подробнее</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}).join('');
|
||||
renderPager(visible.length);
|
||||
@@ -298,6 +305,8 @@ if (plList) {
|
||||
if (detailBtn) { e.stopPropagation(); openPostTaskDetail(detailBtn.dataset.detailTask); return; }
|
||||
const step = e.target.closest('[data-step-key]');
|
||||
if (step) { e.stopPropagation(); togglePostTaskStep(step.dataset.taskKey, step.dataset.stepKey); return; }
|
||||
const photo = e.target.closest('.post-task-photo[data-img]');
|
||||
if (photo) { e.stopPropagation(); showImg(photo.dataset.img); return; }
|
||||
const card = e.target.closest('.post-task[data-task-link]');
|
||||
if (card && card.dataset.taskLink) { window.location.href = card.dataset.taskLink; }
|
||||
});
|
||||
|
||||
+23
-1
@@ -7,10 +7,13 @@
|
||||
<link rel="stylesheet" href="admin.css">
|
||||
<style>
|
||||
@keyframes postTaskBlink { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.45; transform:scale(1.03); } }
|
||||
#plList { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-items:start; }
|
||||
#plList > .dash-empty { grid-column:1 / -1; }
|
||||
.post-task {
|
||||
border-left:4px solid #f59e0b;
|
||||
padding:14px 16px;
|
||||
margin-bottom:12px;
|
||||
margin-bottom:0;
|
||||
min-width:0;
|
||||
border-radius:12px;
|
||||
background:var(--card);
|
||||
box-shadow:0 1px 3px rgba(0,0,0,.06);
|
||||
@@ -22,6 +25,16 @@
|
||||
.post-task.overdue { border-left-color:#ef4444; }
|
||||
.post-task.dismissed { opacity:.5; border-left-color:#94a3b8; }
|
||||
.post-task.dismissed:hover { transform:none; box-shadow:0 1px 3px rgba(0,0,0,.06); }
|
||||
.post-task-body { display:flex; gap:14px; align-items:flex-start; }
|
||||
.post-task-photo {
|
||||
flex:0 0 150px; width:150px; height:100px; padding:0; border:none;
|
||||
border-radius:10px; overflow:hidden; background:rgba(0,0,0,.06);
|
||||
cursor:zoom-in; display:block;
|
||||
}
|
||||
.post-task-photo img { width:100%; height:100%; object-fit:cover; display:block; }
|
||||
.post-task-photo--empty { display:flex; align-items:center; justify-content:center; color:var(--muted); cursor:default; }
|
||||
.post-task-photo--empty i { width:32px; height:32px; }
|
||||
.post-task-content { flex:1; min-width:0; }
|
||||
.post-task-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
|
||||
.post-task-main { min-width:0; }
|
||||
.post-task-title { font-weight:700; font-size:15px; line-height:1.35; }
|
||||
@@ -61,6 +74,12 @@
|
||||
.pl-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:14px; }
|
||||
.pl-toolbar input, .pl-toolbar select { padding:6px 10px; border:1px solid var(--border); border-radius:8px; font-size:13px; }
|
||||
.pl-summary { font-size:13px; color:var(--muted); margin-bottom:10px; }
|
||||
@media (max-width: 900px) {
|
||||
#plList { grid-template-columns:1fr; }
|
||||
}
|
||||
@media (max-width: 560px) {
|
||||
.post-task-photo { flex:0 0 120px; width:120px; height:80px; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.post-task-step.next { animation:none; }
|
||||
.post-task, .post-task:hover { transform:none; transition:none; }
|
||||
@@ -135,6 +154,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="toast" id="toast"></div>
|
||||
<div class="modal-overlay" id="imgModal">
|
||||
<img id="imgModalSrc" alt="">
|
||||
</div>
|
||||
<script src="vendor/lucide.min.js"></script>
|
||||
<script src="js/datetime.js"></script>
|
||||
<script src="admin.js"></script>
|
||||
|
||||
+2
-2
@@ -125,7 +125,7 @@
|
||||
<label for="shortsLines">Список строк <span class="req">*</span>
|
||||
<button type="button" id="shortsAiBtn" class="ai-btn" title="Улучшить текст ИИ"><i data-lucide="sparkles" style="width:14px;height:14px"></i> ИИ</button>
|
||||
</label>
|
||||
<textarea id="shortsLines" class="settings-input" rows="5" placeholder="Иванов И.И. - Отличная работа на занятии Петров П.П. — Продолжили изучение Photoshop"></textarea>
|
||||
<textarea id="shortsLines" class="settings-input" rows="15" placeholder="Иванов И.И. - Отличная работа на занятии Петров П.П. — Продолжили изучение Photoshop"></textarea>
|
||||
<div class="shorts-lines-foot">
|
||||
<span class="field-note" id="shortsLinesHint">Формат: ФИО - текст или ФИО — текст; опц. −1/+1</span>
|
||||
<span class="field-note" id="shortsLinesCount"></span>
|
||||
@@ -264,4 +264,4 @@
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user