feat(postlesson): show group cover photo card in post-lesson tasks; tweaks
This commit is contained in:
@@ -0,0 +1,807 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Задачи после занятия</title>
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--bg: #f5f7fc;
|
||||
--surface: #ffffff;
|
||||
--text: #19233e;
|
||||
--muted: #7b849c;
|
||||
--blue: #5278f8;
|
||||
--red: #e74750;
|
||||
--green: #2eae83;
|
||||
--border: #e8ebf4;
|
||||
--shadow: 0 8px 30px rgba(43, 64, 130, .06);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 24px;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font: 14px/1.5 Inter, system-ui, sans-serif;
|
||||
}
|
||||
|
||||
.tasks-widget {
|
||||
max-width: 1500px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.panel {
|
||||
padding: 26px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 20px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
/* HEADER */
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
background: linear-gradient(135deg, #668aff, #4f4df3);
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 7px 18px #6275f333;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
letter-spacing: -.6px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
flex-wrap: wrap;
|
||||
margin-left: auto;
|
||||
padding: 10px 14px;
|
||||
background: #f6f8ff;
|
||||
border-radius: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.blue { background: var(--blue); }
|
||||
.red { background: var(--red); }
|
||||
.green { background: var(--green); }
|
||||
.gray { background: #9ba4ba; }
|
||||
|
||||
/* FILTERS */
|
||||
|
||||
.filters {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
min-width: 130px;
|
||||
}
|
||||
|
||||
.field.search {
|
||||
flex: 1;
|
||||
min-width: 240px;
|
||||
max-width: 360px;
|
||||
}
|
||||
|
||||
.field label {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
height: 42px;
|
||||
padding: 0 13px;
|
||||
border: 1px solid #e1e6f4;
|
||||
border-radius: 11px;
|
||||
background: white;
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
outline: none;
|
||||
transition: .2s;
|
||||
}
|
||||
|
||||
input:focus,
|
||||
select:focus {
|
||||
border-color: #8ea4ff;
|
||||
box-shadow: 0 0 0 3px #5578ff17;
|
||||
}
|
||||
|
||||
.search input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.switch-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
height: 42px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
width: 42px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.switch input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.switch-track {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: #d7dce8;
|
||||
border-radius: 30px;
|
||||
cursor: pointer;
|
||||
transition: .2s;
|
||||
}
|
||||
|
||||
.switch-track::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
top: 3px;
|
||||
left: 3px;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
transition: .2s;
|
||||
}
|
||||
|
||||
.switch input:checked + .switch-track {
|
||||
background: var(--blue);
|
||||
}
|
||||
|
||||
.switch input:checked + .switch-track::before {
|
||||
transform: translateX(18px);
|
||||
}
|
||||
|
||||
/* TASKS */
|
||||
|
||||
.list-meta {
|
||||
margin-bottom: 12px;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.task-list {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.task-card {
|
||||
display: grid;
|
||||
grid-template-columns: 48px minmax(0, 1fr) auto;
|
||||
gap: 16px;
|
||||
padding: 20px;
|
||||
border: 1px solid var(--border);
|
||||
border-left: 4px solid var(--blue);
|
||||
border-radius: 16px;
|
||||
background: white;
|
||||
transition: .2s;
|
||||
}
|
||||
|
||||
.task-card:hover {
|
||||
box-shadow: 0 8px 24px #23366a0b;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.task-card.overdue {
|
||||
background: #fff8f8;
|
||||
border-left-color: var(--red);
|
||||
}
|
||||
|
||||
.task-card.done {
|
||||
background: #f5fcf9;
|
||||
border-left-color: var(--green);
|
||||
}
|
||||
|
||||
.task-symbol {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: 50%;
|
||||
background: #edf1ff;
|
||||
color: var(--blue);
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.overdue .task-symbol {
|
||||
background: #ffe1e4;
|
||||
color: var(--red);
|
||||
}
|
||||
|
||||
.done .task-symbol {
|
||||
background: #d9f5e9;
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.task-main {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.task-title {
|
||||
margin: 0;
|
||||
font-size: 17px;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.task-sub {
|
||||
margin-top: 3px;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* TAGS */
|
||||
|
||||
.chips {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 30px;
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.chip.complete {
|
||||
color: #27966f;
|
||||
background: #e2f6ee;
|
||||
}
|
||||
|
||||
.chip.pending {
|
||||
color: #a95412;
|
||||
background: #ffecd8;
|
||||
}
|
||||
|
||||
/* BUTTONS */
|
||||
|
||||
.task-footer {
|
||||
display: flex;
|
||||
gap: 9px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 14px;
|
||||
padding-top: 13px;
|
||||
border-top: 1px solid #e9edf5;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 7px;
|
||||
min-height: 36px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid #e0e6f4;
|
||||
border-radius: 11px;
|
||||
background: white;
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
font-weight: 650;
|
||||
cursor: pointer;
|
||||
transition: .15s;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
background: #f6f8ff;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background: var(--blue);
|
||||
border-color: var(--blue);
|
||||
color: white;
|
||||
box-shadow: 0 5px 12px #4d73f82b;
|
||||
}
|
||||
|
||||
.btn.primary:hover {
|
||||
background: #4166e8;
|
||||
}
|
||||
|
||||
.task-side {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 7px 11px;
|
||||
border-radius: 30px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.status.red {
|
||||
color: #c92f3a;
|
||||
background: #ffe5e7;
|
||||
}
|
||||
|
||||
.status.green {
|
||||
color: #20845f;
|
||||
background: #def5eb;
|
||||
}
|
||||
|
||||
.progress {
|
||||
color: var(--blue);
|
||||
font-size: 19px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
/* DETAILS */
|
||||
|
||||
.details {
|
||||
display: none;
|
||||
margin-top: 12px;
|
||||
padding: 12px 14px;
|
||||
background: #f7f8fc;
|
||||
border-radius: 11px;
|
||||
color: #68738d;
|
||||
}
|
||||
|
||||
.task-card.expanded .details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.empty {
|
||||
display: none;
|
||||
padding: 35px;
|
||||
text-align: center;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* RESPONSIVE */
|
||||
|
||||
@media (max-width: 900px) {
|
||||
body {
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.summary {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.panel {
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 21px;
|
||||
}
|
||||
|
||||
.field.search {
|
||||
min-width: 100%;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.field {
|
||||
flex: 1;
|
||||
min-width: calc(50% - 8px);
|
||||
}
|
||||
|
||||
.task-card {
|
||||
grid-template-columns: 38px minmax(0, 1fr);
|
||||
gap: 11px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.task-symbol {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.task-title {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.task-side {
|
||||
grid-column: 2;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.summary {
|
||||
border-radius: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<main class="tasks-widget">
|
||||
<section class="panel">
|
||||
|
||||
<header class="header">
|
||||
<div class="logo">✓</div>
|
||||
|
||||
<h1>Задачи после занятия</h1>
|
||||
|
||||
<div class="subtitle">
|
||||
Полный список задач по занятиям за выбранный период
|
||||
</div>
|
||||
|
||||
<div class="summary">
|
||||
<span class="summary-item">
|
||||
<i class="dot blue"></i>
|
||||
Всего: <strong id="total">2</strong>
|
||||
</span>
|
||||
|
||||
<span class="summary-item">
|
||||
<i class="dot green"></i>
|
||||
Выполненных: <strong id="completed">1</strong>
|
||||
</span>
|
||||
|
||||
<span class="summary-item">
|
||||
<i class="dot red"></i>
|
||||
Просроченных: <strong id="overdueCount">1</strong>
|
||||
</span>
|
||||
|
||||
<span class="summary-item">
|
||||
<i class="dot gray"></i>
|
||||
Закрытых: <strong>81</strong>
|
||||
</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="filters">
|
||||
|
||||
<div class="field search">
|
||||
<label for="search">Поиск</label>
|
||||
<input id="search" type="search"
|
||||
placeholder="Поиск по задачам или группе…">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="statusFilter">Статус</label>
|
||||
<select id="statusFilter">
|
||||
<option value="all">Все</option>
|
||||
<option value="overdue">Просроченные</option>
|
||||
<option value="done">Выполненные</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="period">Период</label>
|
||||
<select id="period">
|
||||
<option>30 дней</option>
|
||||
<option>7 дней</option>
|
||||
<option>90 дней</option>
|
||||
<option>Все время</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="perPage">На странице</label>
|
||||
<select id="perPage">
|
||||
<option>20</option>
|
||||
<option>10</option>
|
||||
<option>50</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="switch-wrap">
|
||||
<label class="switch">
|
||||
<input id="showClosed" type="checkbox">
|
||||
<span class="switch-track"></span>
|
||||
</label>
|
||||
<span>Закрытые</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="list-meta" id="listMeta">
|
||||
Показано 2 задачи · 1 требует внимания
|
||||
</div>
|
||||
|
||||
<div class="task-list" id="taskList">
|
||||
|
||||
<!-- ПРОСРОЧЕННАЯ ЗАДАЧА -->
|
||||
|
||||
<article class="task-card overdue"
|
||||
data-state="overdue"
|
||||
data-search="среда 15:30 2026-11-04 николай доп обратная связь отчет короткое сообщение">
|
||||
|
||||
<div class="task-symbol">!</div>
|
||||
|
||||
<div class="task-main">
|
||||
|
||||
<h2 class="task-title">
|
||||
Среда 15:30 · 2026-11-04
|
||||
</h2>
|
||||
|
||||
<div class="task-sub">
|
||||
15:20–17:50 · Николай · доп
|
||||
</div>
|
||||
|
||||
<div class="chips">
|
||||
<span class="chip complete">✓ Отчёт о занятии</span>
|
||||
<span class="chip complete">✓ Короткое сообщение</span>
|
||||
<span class="chip pending">◉ Обратная связь</span>
|
||||
</div>
|
||||
|
||||
<div class="task-footer">
|
||||
|
||||
<button class="btn primary close-task">
|
||||
✓ Закрыть
|
||||
</button>
|
||||
|
||||
<button class="btn details-toggle">
|
||||
◉ Подробнее
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
Осталось подготовить и отправить обратную связь по занятию.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="task-side">
|
||||
<span class="status red">◷ Просрочена</span>
|
||||
<span class="progress">2/3</span>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<!-- ВЫПОЛНЕННАЯ ЗАДАЧА -->
|
||||
|
||||
<article class="task-card done"
|
||||
data-state="done"
|
||||
data-search="среда 18:00 2026-11-04 николай отчет короткое сообщение обратная связь">
|
||||
|
||||
<div class="task-symbol">✓</div>
|
||||
|
||||
<div class="task-main">
|
||||
|
||||
<h2 class="task-title">
|
||||
Среда 18:00 · 2026-11-04
|
||||
</h2>
|
||||
|
||||
<div class="task-sub">
|
||||
17:50–20:20 · Николай
|
||||
</div>
|
||||
|
||||
<div class="chips">
|
||||
<span class="chip complete">✓ Отчёт о занятии</span>
|
||||
<span class="chip complete">✓ Короткое сообщение</span>
|
||||
<span class="chip complete">✓ Обратная связь (вернул)</span>
|
||||
</div>
|
||||
|
||||
<div class="task-footer">
|
||||
|
||||
<button class="btn reopen-task">
|
||||
↻ Открыть
|
||||
</button>
|
||||
|
||||
<button class="btn details-toggle">
|
||||
◉ Подробнее
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
Все этапы по занятию завершены. Обратная связь получена.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="task-side">
|
||||
<span class="status green">✓ Выполнено</span>
|
||||
<span class="progress">3/3</span>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="empty" id="empty">
|
||||
Ничего не найдено. Измените параметры поиска или фильтры.
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const $ = (selector, root = document) =>
|
||||
root.querySelector(selector);
|
||||
|
||||
const $$ = (selector, root = document) =>
|
||||
[...root.querySelectorAll(selector)];
|
||||
|
||||
const cards = $$('.task-card');
|
||||
const search = $('#search');
|
||||
const status = $('#statusFilter');
|
||||
const showClosed = $('#showClosed');
|
||||
const empty = $('#empty');
|
||||
|
||||
function update() {
|
||||
const term = search.value.trim().toLowerCase();
|
||||
|
||||
let visible = 0;
|
||||
let done = 0;
|
||||
let overdue = 0;
|
||||
|
||||
cards.forEach(card => {
|
||||
const state = card.dataset.state;
|
||||
|
||||
const matchesTerm =
|
||||
card.dataset.search.toLowerCase().includes(term);
|
||||
|
||||
const matchesStatus =
|
||||
status.value === 'all' ||
|
||||
status.value === state;
|
||||
|
||||
const matchesClosed =
|
||||
showClosed.checked ||
|
||||
state !== 'done';
|
||||
|
||||
const show =
|
||||
matchesTerm &&
|
||||
matchesStatus &&
|
||||
matchesClosed;
|
||||
|
||||
card.hidden = !show;
|
||||
|
||||
if (show) {
|
||||
visible++;
|
||||
|
||||
if (state === 'done') done++;
|
||||
if (state === 'overdue') overdue++;
|
||||
}
|
||||
});
|
||||
|
||||
empty.style.display = visible ? 'none' : 'block';
|
||||
|
||||
$('#listMeta').textContent =
|
||||
`Показано ${visible} задач · ${overdue} требуют внимания`;
|
||||
|
||||
$('#total').textContent = visible;
|
||||
$('#completed').textContent = done;
|
||||
$('#overdueCount').textContent = overdue;
|
||||
}
|
||||
|
||||
search.addEventListener('input', update);
|
||||
status.addEventListener('change', update);
|
||||
showClosed.addEventListener('change', update);
|
||||
|
||||
// Подробнее
|
||||
|
||||
$$('.details-toggle').forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
const card = button.closest('.task-card');
|
||||
|
||||
card.classList.toggle('expanded');
|
||||
|
||||
button.textContent =
|
||||
card.classList.contains('expanded')
|
||||
? 'Скрыть детали'
|
||||
: '◉ Подробнее';
|
||||
});
|
||||
});
|
||||
|
||||
// Закрытие задачи
|
||||
|
||||
function closeTask(card) {
|
||||
card.dataset.state = 'done';
|
||||
|
||||
card.classList.remove('overdue');
|
||||
card.classList.add('done');
|
||||
|
||||
card.querySelector('.status').className = 'status green';
|
||||
card.querySelector('.status').textContent = '✓ Выполнено';
|
||||
|
||||
card.querySelector('.progress').textContent = '3/3';
|
||||
|
||||
const button = card.querySelector('.close-task');
|
||||
|
||||
button.className = 'btn reopen-task';
|
||||
button.textContent = '↻ Открыть';
|
||||
|
||||
button.onclick = () => reopenTask(card);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
// Повторное открытие
|
||||
|
||||
function reopenTask(card) {
|
||||
card.dataset.state = 'overdue';
|
||||
|
||||
card.classList.remove('done');
|
||||
card.classList.add('overdue');
|
||||
|
||||
card.querySelector('.status').className = 'status red';
|
||||
card.querySelector('.status').textContent = '◷ Просрочена';
|
||||
|
||||
card.querySelector('.progress').textContent = '2/3';
|
||||
|
||||
const button = card.querySelector('.reopen-task');
|
||||
|
||||
button.className = 'btn primary close-task';
|
||||
button.textContent = '✓ Закрыть';
|
||||
|
||||
button.onclick = () => closeTask(card);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
$$('.close-task').forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
closeTask(button.closest('.task-card'));
|
||||
});
|
||||
});
|
||||
|
||||
$$('.reopen-task').forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
reopenTask(button.closest('.task-card'));
|
||||
});
|
||||
});
|
||||
|
||||
update();
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+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>
|
||||
|
||||
@@ -12251,7 +12251,7 @@ async function buildPostLessonTasks(user, days) {
|
||||
groupParams.push(user.id);
|
||||
}
|
||||
const { rows: groups } = await pool.query(
|
||||
`SELECT g.id, g.name, g.branch_id, g.tutor_id, g.day_of_week, g.time_start, g.time_end
|
||||
`SELECT g.id, g.name, g.branch_id, g.tutor_id, g.cover_path, g.day_of_week, g.time_start, g.time_end
|
||||
FROM groups g
|
||||
WHERE g.deleted_at IS NULL AND g.hidden = false AND g.day_of_week IS NOT NULL AND g.time_start IS NOT NULL AND g.time_end IS NOT NULL${whereGroup}`,
|
||||
groupParams
|
||||
@@ -12360,6 +12360,17 @@ async function buildPostLessonTasks(user, days) {
|
||||
const { rows: users } = await pool.query('SELECT id, name, username FROM users WHERE id = ANY($1::int[])', [tutorIds]);
|
||||
for (const u of users) tutorMap.set(u.id, u.name || u.username || '');
|
||||
}
|
||||
const { rows: coverRows } = await pool.query(
|
||||
`SELECT DISTINCT ON (group_id) group_id, photo_path FROM (
|
||||
SELECT group_id, photo_path, created_at FROM group_photos WHERE group_id = ANY($1::int[])
|
||||
UNION ALL
|
||||
SELECT e.group_id, e.photo_path, e.created_at FROM entries e
|
||||
WHERE e.group_id = ANY($1::int[]) AND e.deleted_at IS NULL AND e.photo_path IS NOT NULL AND e.photo_path <> ''
|
||||
) p
|
||||
ORDER BY group_id, created_at DESC NULLS LAST`,
|
||||
[groupIds]
|
||||
);
|
||||
const coverByGroup = new Map(coverRows.map(r => [r.group_id, r.photo_path]));
|
||||
const tasks = candidates.map(({ g, date }) => {
|
||||
const key = g.id + '|' + date;
|
||||
const reportDone = reportSet.has(key);
|
||||
@@ -12398,6 +12409,7 @@ async function buildPostLessonTasks(user, days) {
|
||||
key,
|
||||
group_id: g.id,
|
||||
group_name: g.name,
|
||||
group_cover: g.cover_path || coverByGroup.get(g.id) || null,
|
||||
tutor_id: g.tutor_id || null,
|
||||
tutor_name: g.tutor_id ? (tutorMap.get(g.tutor_id) || '') : '',
|
||||
lesson_date: date,
|
||||
|
||||
Reference in New Issue
Block a user