135 lines
8.9 KiB
HTML
135 lines
8.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>Дайджест — Админ-панель</title>
|
|
<link rel="stylesheet" href="admin.css">
|
|
<style>
|
|
.digest-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
|
|
.digest-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
|
|
.digest-card.pinned { border-left: 4px solid #f59e0b; background: rgba(245,158,11,.04); }
|
|
.digest-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
.digest-title { font-weight: 600; font-size: 1.05rem; word-break: break-word; margin: 0; }
|
|
.digest-meta { font-size: .82rem; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
|
|
.digest-badge { padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600; background: rgba(245,158,11,.12); color: #b45309; }
|
|
.digest-body { font-size: .95rem; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
.digest-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
|
|
.digest-actions { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
.digest-empty { color: var(--muted); font-size: .95rem; padding: 16px; }
|
|
.digest-new-btn { margin-left: auto; }
|
|
.digest-preview-img { max-width: 240px; max-height: 150px; border: 1px solid var(--border); border-radius: 8px; margin: 8px 0 4px 0; display: block; }
|
|
.digest-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
|
|
.digest-image { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; width: 130px; height: 95px; flex-shrink: 0; }
|
|
.digest-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
.digest-image-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 6px; padding: 2px 7px; font-size: .75rem; cursor: pointer; }
|
|
.digest-image-remove:hover { background: #ef4444; }
|
|
.digest-date-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
|
|
.digest-date-row .settings-field { flex: 1; min-width: 200px; margin: 0; }
|
|
.field-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; display: block; }
|
|
.digest-none { color: var(--muted); font-size: .85rem; font-style: italic; }
|
|
.digest-head-img { margin: 8px 0 10px 0; }
|
|
.digest-images-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
|
|
.digest-card-thumb { width: 70px; height: 55px; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; flex-shrink: 0; display: block; }
|
|
.digest-shot { position: relative; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; padding: 0; cursor: pointer; border-radius: 6px; overflow: hidden; }
|
|
.digest-shot-zoom { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff; border-radius: 4px; padding: 2px 5px; font-size: .65rem; opacity: 0; transition: opacity .15s; }
|
|
.digest-shot:hover .digest-shot-zoom { opacity: 1; }
|
|
.digest-hidden { opacity: 0.72; }
|
|
.digest-highlight { outline: 2px solid #f59e0b; outline-offset: 2px; border-radius: 8px; }
|
|
#digestModal .edit-modal { width: 1000px; max-width: none; }
|
|
#digestModal .bookmark-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
|
|
.digest-modal-body { max-height: 62vh; overflow-y: auto; padding: 12px 0 8px 0; }
|
|
.digest-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
|
|
@media (max-width: 720px) { .digest-modal-grid { grid-template-columns: 1fr; } }
|
|
.digest-modal-col { display: flex; flex-direction: column; gap: 12px; }
|
|
.digest-modal-col .settings-field { margin: 0; }
|
|
#digestModal .edit-modal { display: flex; flex-direction: column; max-height: 85vh; }
|
|
#digestModal .digest-modal-body { flex: 0 0 auto; }
|
|
#digestModal .card-foot { flex: 0 0 auto; margin-top: 10px; }
|
|
</style>
|
|
</head>
|
|
<body data-page="digest">
|
|
<div class="layout">
|
|
<div class="sidebar" id="sidebar"></div>
|
|
<div class="main">
|
|
<div class="page-head">
|
|
<h2>Дайджест</h2>
|
|
<p class="page-sub">Важные сообщения для команды</p>
|
|
<button type="button" class="btn-primary digest-new-btn" id="digestNewBtn"><i data-lucide="plus"></i> Новое сообщение</button>
|
|
</div>
|
|
<div id="digestList" class="digest-list"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-overlay" id="digestModal">
|
|
<div class="edit-modal" style="width:1000px">
|
|
<div class="bookmark-modal-head">
|
|
<h3 id="digestModalTitle">Новое сообщение</h3>
|
|
<button type="button" class="icon-btn" id="digestModalClose"><i data-lucide="x"></i></button>
|
|
</div>
|
|
<div class="digest-modal-body">
|
|
<div class="digest-modal-grid">
|
|
<div class="digest-modal-col">
|
|
<div class="settings-field">
|
|
<label>Заголовок <span style="color:#ef4444">*</span></label>
|
|
<input id="digestTitle" class="settings-input" maxlength="200" placeholder="Например: Мероприятия на этой неделе">
|
|
</div>
|
|
<div class="settings-field">
|
|
<label>Текст сообщения <span style="color:#ef4444">*</span></label>
|
|
<textarea id="digestBody" class="settings-input" rows="8" placeholder="Что нужно сообщить ученикам и тьюторам..."></textarea>
|
|
</div>
|
|
<div class="settings-field">
|
|
<label class="digest-check"><input type="checkbox" id="digestPinned"> Закрепить в начале списка (только администратор)</label>
|
|
</div>
|
|
<div class="settings-field">
|
|
<label>Дата публикации</label>
|
|
<input type="datetime-local" id="digestPostAt">
|
|
<span class="field-hint">Пусто — опубликовано сразу. Будущая дата — появится автоматически и придет уведомление всем.</span>
|
|
</div>
|
|
<div class="settings-field">
|
|
<label>Скрыть после</label>
|
|
<input type="datetime-local" id="digestHideAt">
|
|
<span class="field-hint">После этой даты дайджест перестанет показываться (кроме администратора).</span>
|
|
</div>
|
|
</div>
|
|
<div class="digest-modal-col">
|
|
<div class="settings-field">
|
|
<label>Превью / обложка сообщения</label>
|
|
<div id="digestPreviewWrap" style="position:relative;display:inline-block;margin-top:6px">
|
|
<img id="digestPreviewImg" class="digest-preview-img" src="" alt="превью">
|
|
</div>
|
|
<input type="file" id="digestPreviewFile" accept="image/*" style="margin-top:6px;display:block">
|
|
<button type="button" class="btn-link ghost danger" id="digestPreviewRemove" style="margin-top:4px;display:none">Убрать превью</button>
|
|
<span class="field-hint">Обложка сообщения. Загружается при сохранении.</span>
|
|
</div>
|
|
<div class="settings-field">
|
|
<label>Картинки в сообщение</label>
|
|
<div id="digestImagesWrap" class="digest-images"></div>
|
|
<div style="margin-top:6px">
|
|
<input type="file" id="digestImageFile" accept="image/*" multiple>
|
|
<button type="button" class="btn-link ghost" id="digestImageAdd" style="margin-left:8px">Добавить картинки</button>
|
|
</div>
|
|
<span class="field-hint">До 20 картинок. Удаление картинки стирает файл с диска. Вставка из буфера — Ctrl+V в поле текста.</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-foot">
|
|
<button type="button" class="btn-primary ghost" id="digestCancel">Отмена</button>
|
|
<button type="button" class="btn-primary" id="digestSave">Сохранить</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-overlay" id="imgModal"><img id="imgModalSrc" alt=""></div>
|
|
|
|
<div class="toast" id="toast"></div>
|
|
|
|
<script src="vendor/lucide.min.js"></script>
|
|
<script src="js/datetime.js"></script>
|
|
<script src="admin.js"></script>
|
|
<script src="js/digest.js"></script>
|
|
</body>
|
|
</html>
|