287 lines
15 KiB
HTML
287 lines
15 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>
|
|
.docs-wrap { display: grid; grid-template-columns: 306px minmax(0, 1fr); gap: 20px; align-items: start; }
|
|
.docs-side {
|
|
position: sticky;
|
|
top: 16px;
|
|
background: var(--card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 14px;
|
|
padding: 10px;
|
|
max-height: calc(100dvh - 120px);
|
|
overflow: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
.docs-search { width: 100%; }
|
|
.docs-side-foot { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 8px; margin-top: auto; }
|
|
.docs-side-foot .btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: .8rem; }
|
|
.docs-side-foot .btn-primary svg { width: 14px; height: 14px; }
|
|
|
|
.docs-tree { display: flex; flex-direction: column; gap: 1px; }
|
|
.docs-node { display: flex; flex-direction: column; }
|
|
.docs-section-row {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
padding: 6px 28px 6px 8px;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
font-size: .86rem;
|
|
font-weight: 600;
|
|
min-width: 0;
|
|
user-select: none;
|
|
}
|
|
.docs-section-row:hover { background: rgba(127,127,127,.1); }
|
|
.docs-section-row svg { width: 15px; height: 15px; flex: none; }
|
|
.docs-chev { border: none; background: none; color: var(--muted); padding: 0; display: inline-flex; cursor: pointer; }
|
|
.docs-chev svg { width: 14px; height: 14px; transition: transform .15s; }
|
|
.docs-chev.closed svg { transform: rotate(-90deg); }
|
|
.docs-section-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
|
.docs-row-acts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); align-items: center; gap: 2px; opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
|
|
.docs-section-row:hover .docs-row-acts, .docs-article-row:hover .docs-row-acts { opacity: 1; visibility: visible; }
|
|
.docs-row-acts button {
|
|
border: none;
|
|
background: none;
|
|
color: var(--muted);
|
|
padding: 2px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
display: inline-flex;
|
|
}
|
|
.docs-row-acts button:hover { color: var(--text); background: rgba(127,127,127,.18); }
|
|
.docs-row-acts svg { width: 13px; height: 13px; }
|
|
.docs-article-row { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
|
|
.docs-article-row:hover { background: rgba(127,127,127,.08); }
|
|
.docs-article-row a {
|
|
flex: 1;
|
|
min-width: 0;
|
|
padding: 6px 8px;
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
font-size: .84rem;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.docs-article-row a.active { background: rgba(37,99,235,.14); color: var(--accent); font-weight: 600; }
|
|
.docs-article-row .docs-dot { width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; flex: none; margin-left: 6px; }
|
|
.docs-empty { color: var(--muted); font-size: .85rem; padding: 14px 8px; text-align: center; }
|
|
.docs-search-results { display: flex; flex-direction: column; gap: 2px; }
|
|
.docs-search-item { padding: 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
|
|
.docs-search-item:hover { border-color: var(--border); background: rgba(127,127,127,.06); }
|
|
.docs-search-item b { display: block; font-size: .84rem; margin-bottom: 2px; }
|
|
.docs-search-item span { display: block; font-size: .75rem; color: var(--muted); line-height: 1.4; }
|
|
.docs-search-item em { display: block; font-style: normal; font-size: .7rem; color: var(--accent); margin-top: 3px; }
|
|
|
|
.docs-article { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px 30px; min-height: 320px; }
|
|
.docs-crumbs { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
|
|
.docs-article h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 10px; word-break: break-word; }
|
|
.docs-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-bottom: 14px; }
|
|
.docs-badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: .7rem; font-weight: 600; background: rgba(245,158,11,.15); color: #d97706; }
|
|
.docs-badge.public { background: rgba(34,197,94,.14); color: #16a34a; }
|
|
.docs-article-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
|
|
.docs-article-actions:empty { display: none; }
|
|
.docs-body { font-size: .95rem; line-height: 1.68; overflow-wrap: anywhere; }
|
|
.docs-body h1, .docs-body h2, .docs-body h3, .docs-body h4 { margin: 1.4em 0 .5em; line-height: 1.3; }
|
|
.docs-body h1 { font-size: 1.5rem; }
|
|
.docs-body h2 { font-size: 1.25rem; }
|
|
.docs-body h3 { font-size: 1.08rem; }
|
|
.docs-body h4 { font-size: 1rem; }
|
|
.docs-body p { margin: 0 0 .85em; }
|
|
.docs-body ul, .docs-body ol { margin: 0 0 .9em; padding-left: 1.5em; }
|
|
.docs-body li { margin: 0 0 .25em; }
|
|
.docs-body img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; margin: 6px 0; }
|
|
.docs-body a { color: var(--accent); }
|
|
.docs-body blockquote { margin: 0 0 1em; padding: 8px 14px; border-left: 3px solid var(--accent); background: rgba(127,127,127,.07); border-radius: 0 8px 8px 0; color: var(--muted); }
|
|
.docs-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: rgba(127,127,127,.14); padding: 1px 5px; border-radius: 5px; }
|
|
.docs-body pre { background: rgba(127,127,127,.12); border-radius: 10px; padding: 12px 14px; overflow: auto; margin: 0 0 1em; }
|
|
.docs-body pre code { background: none; padding: 0; }
|
|
.docs-body hr { border: none; border-top: 1px solid var(--border); margin: 1.4em 0; }
|
|
.docs-body .md-table-wrap { overflow: auto; margin: 0 0 1em; }
|
|
.docs-body table { border-collapse: collapse; min-width: 60%; }
|
|
.docs-body th, .docs-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; font-size: .88rem; }
|
|
.docs-body th { background: rgba(127,127,127,.09); }
|
|
|
|
.docs-editor { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
|
|
.docs-editor[hidden] { display: none; }
|
|
.docs-editor-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
|
.docs-title-input {
|
|
flex: 1;
|
|
min-width: 220px;
|
|
background: var(--bg);
|
|
border: 1px solid var(--border);
|
|
color: var(--text);
|
|
border-radius: 9px;
|
|
padding: 10px 12px;
|
|
font-size: 1.1rem;
|
|
font-weight: 600;
|
|
outline: none;
|
|
font-family: inherit;
|
|
}
|
|
.docs-title-input:focus { border-color: var(--accent); }
|
|
.docs-editor-actions { display: flex; gap: 8px; }
|
|
.docs-editor-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
|
|
.docs-editor-meta select { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 10px; font-size: .82rem; font-family: inherit; max-width: 260px; }
|
|
.docs-editor-meta label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
|
|
.docs-editor-meta label[hidden] { display: none; }
|
|
.docs-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px 10px 0 0; border-bottom: none; }
|
|
.docs-toolbar button {
|
|
min-width: 30px;
|
|
height: 28px;
|
|
padding: 0 7px;
|
|
border: 1px solid transparent;
|
|
background: none;
|
|
color: var(--text);
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: .8rem;
|
|
font-family: inherit;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.docs-toolbar button:hover { background: rgba(127,127,127,.16); border-color: var(--border); }
|
|
.docs-toolbar .sep { width: 1px; background: var(--border); margin: 3px 2px; }
|
|
.docs-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
.docs-edit-area { display: flex; flex-direction: column; min-width: 0; }
|
|
#docsEditBody {
|
|
flex: 1;
|
|
min-height: 540px;
|
|
background: var(--bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 0 0 10px 10px;
|
|
color: var(--text);
|
|
padding: 14px;
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
font-size: .86rem;
|
|
line-height: 1.6;
|
|
resize: vertical;
|
|
outline: none;
|
|
}
|
|
#docsEditBody:focus { border-color: var(--accent); }
|
|
.docs-preview { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow: auto; max-height: 640px; }
|
|
.docs-preview .docs-body { font-size: .9rem; }
|
|
.docs-preview-empty { color: var(--muted); font-size: .82rem; }
|
|
.docs-hint { font-size: .74rem; color: var(--muted); }
|
|
.docs-drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
|
|
.docs-file-input { display: none; }
|
|
.docs-modal-parent { width: 100%; }
|
|
.docs-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text); cursor: pointer; }
|
|
@media (max-width: 1100px) { .docs-edit-grid { grid-template-columns: 1fr; } }
|
|
@media (max-width: 960px) {
|
|
.docs-wrap { grid-template-columns: 1fr; }
|
|
.docs-side { position: static; max-height: none; }
|
|
.docs-article { padding: 20px 16px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body data-page="docs">
|
|
<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" id="docsNewArticleBtn"><i data-lucide="file-plus"></i> Новая статья</button>
|
|
</div>
|
|
|
|
<div class="docs-wrap">
|
|
<aside class="docs-side">
|
|
<input type="text" id="docsSearch" class="settings-input docs-search" placeholder="Поиск по документации..." autocomplete="off">
|
|
<div id="docsTree" class="docs-tree"></div>
|
|
<div class="docs-side-foot" id="docsSideFoot">
|
|
<button type="button" class="btn-primary ghost" id="docsNewSectionBtn"><i data-lucide="folder-plus"></i> Раздел</button>
|
|
</div>
|
|
</aside>
|
|
|
|
<section class="docs-content" id="docsContent"></section>
|
|
|
|
<section class="docs-editor" id="docsEditor" hidden>
|
|
<div class="docs-editor-head">
|
|
<input type="text" id="docsEditTitle" class="docs-title-input" maxlength="200" placeholder="Заголовок статьи">
|
|
<div class="docs-editor-actions">
|
|
<button type="button" class="btn-primary ghost" id="docsCancelBtn">Отмена</button>
|
|
<button type="button" class="btn-primary" id="docsSaveBtn">Сохранить</button>
|
|
</div>
|
|
</div>
|
|
<div class="docs-editor-meta">
|
|
<select id="docsEditSection"></select>
|
|
<label><input type="checkbox" id="docsEditPublished" checked> Опубликована</label>
|
|
<label id="docsEditPublicWrap"><input type="checkbox" id="docsEditPublic"> Публичная ссылка</label>
|
|
<span class="docs-hint" id="docsEditHint"></span>
|
|
</div>
|
|
<div class="docs-toolbar" id="docsToolbar">
|
|
<button type="button" data-md="h2" title="Заголовок">H2</button>
|
|
<button type="button" data-md="h3" title="Подзаголовок">H3</button>
|
|
<span class="sep"></span>
|
|
<button type="button" data-md="bold" title="Жирный"><b>B</b></button>
|
|
<button type="button" data-md="italic" title="Курсив"><i>I</i></button>
|
|
<button type="button" data-md="strike" title="Зачёркнутый"><s>S</s></button>
|
|
<button type="button" data-md="code" title="Код"></></button>
|
|
<span class="sep"></span>
|
|
<button type="button" data-md="ul" title="Маркированный список">• Список</button>
|
|
<button type="button" data-md="ol" title="Нумерованный список">1. Список</button>
|
|
<button type="button" data-md="quote" title="Цитата">❝</button>
|
|
<button type="button" data-md="table" title="Таблица">Таблица</button>
|
|
<button type="button" data-md="hr" title="Разделитель">—</button>
|
|
<span class="sep"></span>
|
|
<button type="button" data-md="link" title="Ссылка">Ссылка</button>
|
|
<button type="button" data-md="image" title="Картинка">Картинка</button>
|
|
</div>
|
|
<div class="docs-edit-grid">
|
|
<div class="docs-edit-area">
|
|
<textarea id="docsEditBody" spellcheck="true" placeholder="Текст статьи в Markdown. Картинку можно вставить из буфера обмена (Ctrl+V) или перетащить сюда."></textarea>
|
|
</div>
|
|
<div class="docs-preview"><div class="docs-body" id="docsPreview"></div></div>
|
|
</div>
|
|
<input type="file" id="docsImageFile" class="docs-file-input" accept="image/*">
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-overlay" id="docsSectionModal">
|
|
<div class="edit-modal" style="max-width:520px">
|
|
<h3 id="docsSectionModalTitle">Новый раздел</h3>
|
|
<div class="settings-field">
|
|
<label>Название <span style="color:#ef4444">*</span></label>
|
|
<input id="docsSectionTitle" class="settings-input" maxlength="200" placeholder="Например, Журнал">
|
|
</div>
|
|
<div class="settings-field">
|
|
<label>Родительский раздел</label>
|
|
<select id="docsSectionParent" class="settings-input docs-modal-parent"></select>
|
|
</div>
|
|
<label class="docs-check"><input type="checkbox" id="docsSectionTutor"> Тьюторы могут писать статьи в этом разделе</label>
|
|
<label class="docs-check"><input type="checkbox" id="docsSectionPublic"> Показывать раздел в публичной версии</label>
|
|
<div class="card-foot">
|
|
<button type="button" class="btn-primary ghost" id="docsSectionDeleteBtn" style="display:none;color:#ef4444;border-color:rgba(239,68,68,.35)">Удалить</button>
|
|
<button type="button" class="btn-primary ghost" id="docsSectionCancel">Отмена</button>
|
|
<button type="button" class="btn-primary" id="docsSectionSave">Сохранить</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/md.js"></script>
|
|
<script src="js/docs.js"></script>
|
|
</body>
|
|
</html>
|