feat: полный бэк и фронт (попытки, разбор, импорт, ИИ, назначения)
- Сервисы: testAttemptService, testAccess, document import/gen/extract, LLM, assignment, aiEditor - Конфиг: devAuthor, featureFlags; messages/ru; интеграция V.9 (skip без БД) - API/роуты: app, auth, server; Dockerfile и env example - Фронт: TestAttempt, TestAttemptReview, AttemptReviewBlock, стили, правки App/api/login/vite - compose и README; смоук-тесты расширены Закрывает отсутствие модулей в origin после клона. Made-with: Cursor
This commit is contained in:
+12
-2
@@ -1,15 +1,25 @@
|
||||
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
||||
import CabinetLayout from './components/CabinetLayout';
|
||||
import Login from './pages/Login';
|
||||
import TestsList from './pages/TestsList';
|
||||
import TestDetail from './pages/TestDetail';
|
||||
import TestAttempt from './pages/TestAttempt';
|
||||
import TestAttemptReview from './pages/TestAttemptReview';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="/tests" element={<TestsList />} />
|
||||
<Route path="/tests/:id" element={<TestDetail />} />
|
||||
<Route element={<CabinetLayout />}>
|
||||
<Route path="/tests" element={<TestsList />} />
|
||||
<Route path="/tests/:id/attempt/:attemptId" element={<TestAttempt />} />
|
||||
<Route
|
||||
path="/tests/:id/attempts/:attemptId/review"
|
||||
element={<TestAttemptReview />}
|
||||
/>
|
||||
<Route path="/tests/:id" element={<TestDetail />} />
|
||||
</Route>
|
||||
<Route path="/" element={<Navigate to="/tests" replace />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
|
||||
+8
-4
@@ -1,12 +1,16 @@
|
||||
const base = '';
|
||||
|
||||
export async function api(path, opts = {}) {
|
||||
const isFormData =
|
||||
typeof FormData !== 'undefined' && opts.body instanceof FormData;
|
||||
const r = await fetch(`${base}${path}`, {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(opts.headers || {}),
|
||||
},
|
||||
headers: isFormData
|
||||
? { ...(opts.headers || {}) }
|
||||
: {
|
||||
'Content-Type': 'application/json',
|
||||
...(opts.headers || {}),
|
||||
},
|
||||
...opts,
|
||||
});
|
||||
const text = await r.text();
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
/**
|
||||
* @param {{ review: {
|
||||
* testTitle?: string,
|
||||
* attempterName?: string,
|
||||
* attempterLogin?: string,
|
||||
* startedAt?: string,
|
||||
* completedAt?: string,
|
||||
* correctCount: number,
|
||||
* totalQuestions: number,
|
||||
* percent: number,
|
||||
* passed: boolean,
|
||||
* passingThreshold: number,
|
||||
* questions: Array<{
|
||||
* id: string,
|
||||
* text: string,
|
||||
* isUserCorrect: boolean,
|
||||
* options: Array<{ id: string, text: string, isCorrect: boolean, selected: boolean }>
|
||||
* }>
|
||||
* }, showAttempter?: boolean, backLink: { to: string, label: string } }} p
|
||||
*/
|
||||
export default function AttemptReviewBlock({ review, showAttempter, backLink }) {
|
||||
if (!review?.questions?.length) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div className="attempt-review" style={{ maxWidth: 640 }}>
|
||||
{showAttempter && (review.attempterName || review.attempterLogin) && (
|
||||
<p className="text-muted" style={{ marginTop: 0, fontSize: 14 }}>
|
||||
Участник: {review.attempterName || '—'}{' '}
|
||||
{review.attempterLogin && (
|
||||
<span className="code-inline" style={{ fontSize: 12 }}>
|
||||
{review.attempterLogin}
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
{review.completedAt && (
|
||||
<p className="text-muted" style={{ marginTop: 0, fontSize: 13 }}>
|
||||
Завершено: {new Date(review.completedAt).toLocaleString('ru-RU')}
|
||||
</p>
|
||||
)}
|
||||
<ol style={{ paddingLeft: '1.1rem', marginTop: '0.75rem' }}>
|
||||
{review.questions.map((q, i) => (
|
||||
<li
|
||||
key={q.id}
|
||||
style={{
|
||||
marginBottom: '1.1rem',
|
||||
borderLeft: '3px solid',
|
||||
borderColor: q.isUserCorrect
|
||||
? 'color-mix(in srgb, var(--primary) 50%, var(--outline-variant))'
|
||||
: 'color-mix(in srgb, var(--error, #c00) 45%, var(--outline-variant))',
|
||||
paddingLeft: 10,
|
||||
}}
|
||||
>
|
||||
<p style={{ marginTop: 0, marginBottom: 8, fontWeight: 600 }}>{i + 1}. {q.text}</p>
|
||||
<p
|
||||
className={q.isUserCorrect ? 'text-muted' : 'error-text'}
|
||||
style={{ margin: '0 0 6px', fontSize: 13 }}
|
||||
>
|
||||
{q.isUserCorrect ? 'Верно' : 'Ошибка'}
|
||||
</p>
|
||||
<ul style={{ listStyle: 'none', padding: 0, margin: 0, fontSize: 14 }}>
|
||||
{q.options.map((o) => {
|
||||
const mark =
|
||||
o.selected && o.isCorrect
|
||||
? '✓ верно'
|
||||
: o.selected && !o.isCorrect
|
||||
? '✗ выбрано'
|
||||
: !o.selected && o.isCorrect
|
||||
? '— правильный вариант'
|
||||
: '';
|
||||
return (
|
||||
<li
|
||||
key={o.id}
|
||||
style={{
|
||||
marginBottom: 4,
|
||||
opacity: o.selected || o.isCorrect ? 1 : 0.7,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={
|
||||
o.isCorrect
|
||||
? { fontWeight: 600, color: 'var(--primary, #007168)' }
|
||||
: o.selected
|
||||
? {}
|
||||
: { color: 'var(--secondary)' }
|
||||
}
|
||||
>
|
||||
{o.text}
|
||||
</span>
|
||||
{mark && (
|
||||
<span className="text-muted" style={{ marginLeft: 8, fontSize: 12 }}>
|
||||
{mark}
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
{backLink && (
|
||||
<p className="link-back" style={{ marginTop: '1rem' }}>
|
||||
<Link to={backLink.to}>{backLink.label}</Link>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App.jsx';
|
||||
import './styles/cabinet-theme.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
|
||||
@@ -23,41 +23,59 @@ export default function Login() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: 360, margin: '48px auto', fontFamily: 'system-ui' }}>
|
||||
<h1>Вход</h1>
|
||||
<p style={{ color: '#666', fontSize: 14 }}>
|
||||
Локальный пользователь из <code>clinic_tests</code> (если HR_AUTH не
|
||||
включён).
|
||||
</p>
|
||||
<form onSubmit={onSubmit}>
|
||||
<div style={{ marginBottom: 12 }}>
|
||||
<label>
|
||||
Логин
|
||||
<br />
|
||||
<input
|
||||
value={login}
|
||||
onChange={(e) => setLogin(e.target.value)}
|
||||
style={{ width: '100%', padding: 8 }}
|
||||
autoComplete="username"
|
||||
/>
|
||||
</label>
|
||||
<div className="login-page">
|
||||
<div className="login-shell">
|
||||
<div className="login-logo">
|
||||
<div className="login-logo__frame" aria-hidden>
|
||||
<span className="material-symbols-outlined">school</span>
|
||||
</div>
|
||||
<h1 className="font-headline">Система тестрования</h1>
|
||||
<p className="login-subtitle">Войдите в систему</p>
|
||||
</div>
|
||||
<div style={{ marginBottom: 12 }}>
|
||||
<label>
|
||||
Пароль
|
||||
<br />
|
||||
<input
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
style={{ width: '100%', padding: 8 }}
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
</label>
|
||||
|
||||
{err && (
|
||||
<div className="callout callout--error" style={{ marginBottom: '1rem' }}>
|
||||
{err}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="login-card">
|
||||
<form onSubmit={onSubmit} noValidate>
|
||||
<div className="form-field">
|
||||
<label className="form-label" htmlFor="login-username">
|
||||
Логин
|
||||
</label>
|
||||
<input
|
||||
id="login-username"
|
||||
className="form-input"
|
||||
value={login}
|
||||
onChange={(e) => setLogin(e.target.value)}
|
||||
autoComplete="username"
|
||||
/>
|
||||
</div>
|
||||
<div className="form-field">
|
||||
<label className="form-label" htmlFor="login-password">
|
||||
Пароль
|
||||
</label>
|
||||
<input
|
||||
id="login-password"
|
||||
className="form-input"
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
</div>
|
||||
<button type="submit" className="btn btn-primary">
|
||||
Войти
|
||||
</button>
|
||||
</form>
|
||||
<p className="text-muted" style={{ marginTop: '1.25rem', marginBottom: 0 }}>
|
||||
Локальный пользователь в <code className="code-inline">clinic_tests</code> (если
|
||||
отключён вход через персонал HR).
|
||||
</p>
|
||||
</div>
|
||||
{err && <p style={{ color: 'coral' }}>{err}</p>}
|
||||
<button type="submit">Войти</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Link, useNavigate, useParams } from 'react-router-dom';
|
||||
import AttemptReviewBlock from '../components/AttemptReviewBlock';
|
||||
import { api } from '../api';
|
||||
|
||||
export default function TestAttempt() {
|
||||
const { id: testId, attemptId } = useParams();
|
||||
const nav = useNavigate();
|
||||
const [play, setPlay] = useState(null);
|
||||
const [err, setErr] = useState(null);
|
||||
const [submitErr, setSubmitErr] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [sending, setSending] = useState(false);
|
||||
/** @type {Record<string, string[]>} */
|
||||
const [selections, setSelections] = useState({});
|
||||
const [result, setResult] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
(async () => {
|
||||
setErr(null);
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await api(`/api/tests/${testId}/attempts/${attemptId}/play`);
|
||||
if (!cancelled) {
|
||||
setPlay(data);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.status === 401) {
|
||||
nav('/login');
|
||||
return;
|
||||
}
|
||||
if (!cancelled) {
|
||||
setErr(e.message);
|
||||
}
|
||||
} finally {
|
||||
if (!cancelled) {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
})();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [testId, attemptId, nav]);
|
||||
|
||||
function toggleOption(questionId, optionId, hasMultiple) {
|
||||
setSelections((prev) => {
|
||||
const key = String(questionId);
|
||||
const cur = prev[key] || [];
|
||||
const id = String(optionId);
|
||||
if (hasMultiple) {
|
||||
if (cur.includes(id)) {
|
||||
return { ...prev, [key]: cur.filter((x) => x !== id) };
|
||||
}
|
||||
return { ...prev, [key]: [...cur, id] };
|
||||
}
|
||||
return { ...prev, [key]: [id] };
|
||||
});
|
||||
}
|
||||
|
||||
function isSelected(questionId, optionId) {
|
||||
const s = selections[String(questionId)] || [];
|
||||
return s.includes(String(optionId));
|
||||
}
|
||||
|
||||
async function onSubmit() {
|
||||
setSubmitErr(null);
|
||||
setSending(true);
|
||||
try {
|
||||
const out = await api(`/api/tests/${testId}/attempts/${attemptId}/submit`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ answers: selections }),
|
||||
});
|
||||
setResult(out);
|
||||
} catch (e) {
|
||||
setSubmitErr(e.message);
|
||||
} finally {
|
||||
setSending(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <p className="text-muted">Загрузка вопросов…</p>;
|
||||
}
|
||||
if (err) {
|
||||
return (
|
||||
<div>
|
||||
<p className="error-text">{err}</p>
|
||||
<p>
|
||||
<Link to={`/tests/${testId}`}>← к карточке теста</Link>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (result) {
|
||||
return (
|
||||
<div>
|
||||
<p className="link-back">
|
||||
<Link to={`/tests/${testId}`}>← к карточке теста</Link>
|
||||
</p>
|
||||
<h1 className="font-headline" style={{ fontSize: '1.35rem' }}>
|
||||
Результат
|
||||
</h1>
|
||||
<p>
|
||||
Правильно: <strong>{result.correctCount}</strong> из {result.totalQuestions} (
|
||||
{result.percent}%). Порог: {result.passingThreshold}%.
|
||||
</p>
|
||||
<p className={result.passed ? 'text-muted' : 'error-text'}>
|
||||
{result.passed
|
||||
? 'Тест пройден по порогу.'
|
||||
: 'Порог не достигнут — при необходимости начните новую попытку на карточке теста.'}
|
||||
</p>
|
||||
{result.review && (
|
||||
<>
|
||||
<h2
|
||||
className="font-headline"
|
||||
style={{ fontSize: '1.1rem', marginTop: '1.25rem', marginBottom: '0.5rem' }}
|
||||
>
|
||||
Разбор
|
||||
</h2>
|
||||
<AttemptReviewBlock review={result.review} showAttempter={false} />
|
||||
{result.attemptId && (
|
||||
<p className="text-muted" style={{ fontSize: 14, marginTop: '0.75rem' }}>
|
||||
<Link to={`/tests/${testId}/attempts/${result.attemptId}/review`}>
|
||||
Полная страница разбора
|
||||
</Link>
|
||||
</p>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<div className="inline-actions" style={{ marginTop: '1rem' }}>
|
||||
<Link to={`/tests/${testId}`} className="btn btn-ghost">
|
||||
К настройкам теста
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!play?.questions?.length) {
|
||||
return (
|
||||
<div>
|
||||
<p className="error-text">В этой версии нет вопросов. Добавьте вопросы в черновике.</p>
|
||||
<Link to={`/tests/${testId}`}>← к карточке</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p className="link-back">
|
||||
<Link to={`/tests/${testId}`}>← к карточке теста</Link>
|
||||
</p>
|
||||
<h1 className="font-headline" style={{ fontSize: '1.35rem', marginTop: 0 }}>
|
||||
{play.testTitle}
|
||||
</h1>
|
||||
<p className="text-muted" style={{ marginTop: 0 }}>
|
||||
Отметьте ответы и нажмите «Завершить». Порог для зачёта: {play.passingThreshold}%.
|
||||
</p>
|
||||
|
||||
<ol style={{ paddingLeft: '1.25rem', maxWidth: 640 }}>
|
||||
{play.questions.map((q) => (
|
||||
<li key={q.id} style={{ marginBottom: '1.5rem' }}>
|
||||
<p style={{ marginTop: 0, marginBottom: '0.5rem' }}>{q.text}</p>
|
||||
<ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>
|
||||
{q.options.map((o) => {
|
||||
const inputType = q.hasMultipleAnswers ? 'checkbox' : 'radio';
|
||||
const name = `q-${q.id}`;
|
||||
return (
|
||||
<li key={o.id} style={{ marginBottom: 6 }}>
|
||||
<label
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
gap: 8,
|
||||
cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type={inputType}
|
||||
name={q.hasMultipleAnswers ? undefined : name}
|
||||
checked={isSelected(q.id, o.id)}
|
||||
onChange={() => toggleOption(q.id, o.id, q.hasMultipleAnswers)}
|
||||
style={{ marginTop: 3 }}
|
||||
aria-label={o.text}
|
||||
/>
|
||||
<span>{o.text}</span>
|
||||
</label>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
{submitErr && (
|
||||
<p className="error-text" role="alert">
|
||||
{submitErr}
|
||||
</p>
|
||||
)}
|
||||
<div className="inline-actions" style={{ marginTop: '0.5rem' }}>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost"
|
||||
onClick={onSubmit}
|
||||
disabled={sending}
|
||||
>
|
||||
{sending ? 'Отправка…' : 'Завершить тест'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Link, useNavigate, useParams } from 'react-router-dom';
|
||||
import { api } from '../api';
|
||||
import AttemptReviewBlock from '../components/AttemptReviewBlock';
|
||||
|
||||
export default function TestAttemptReview() {
|
||||
const { id: testId, attemptId } = useParams();
|
||||
const nav = useNavigate();
|
||||
const [review, setReview] = useState(null);
|
||||
const [err, setErr] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
(async () => {
|
||||
setErr(null);
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await api(`/api/tests/${testId}/attempts/${attemptId}/review`);
|
||||
if (!cancelled) {
|
||||
setReview(data);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.status === 401) {
|
||||
nav('/login');
|
||||
return;
|
||||
}
|
||||
if (!cancelled) {
|
||||
setErr(e.message);
|
||||
}
|
||||
} finally {
|
||||
if (!cancelled) {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
})();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [testId, attemptId, nav]);
|
||||
|
||||
if (loading) {
|
||||
return <p className="text-muted">Загрузка разбора…</p>;
|
||||
}
|
||||
if (err) {
|
||||
return (
|
||||
<div>
|
||||
<p className="error-text">{err}</p>
|
||||
<p>
|
||||
<Link to={`/tests/${testId}`}>← к карточке теста</Link>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (!review) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p className="link-back">
|
||||
<Link to={`/tests/${testId}`}>← к карточке теста</Link>
|
||||
</p>
|
||||
<h1 className="font-headline" style={{ fontSize: '1.35rem' }}>
|
||||
Разбор попытки: {review.testTitle}
|
||||
</h1>
|
||||
<p>
|
||||
Правильно: <strong>{review.correctCount}</strong> из {review.totalQuestions} ({review.percent}
|
||||
%). Порог: {review.passingThreshold}%.{' '}
|
||||
{review.passed ? (
|
||||
<span className="text-muted">Зачёт.</span>
|
||||
) : (
|
||||
<span className="error-text">Незачёт.</span>
|
||||
)}
|
||||
</p>
|
||||
<AttemptReviewBlock review={review} showAttempter />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,785 @@
|
||||
/* Match: HR_TG_Bot/tgFlaskForm .../cabinet/tailwind_config.js + cabinet/login.html */
|
||||
:root {
|
||||
--surface: #ffffff;
|
||||
--surface-container-low: #f3f8f9;
|
||||
--surface-container: #eaf3f5;
|
||||
--surface-container-high: #dfeef1;
|
||||
--on-surface: #0d1b1d;
|
||||
--on-surface-variant: #3d5357;
|
||||
--primary: #007168;
|
||||
--on-primary: #ffffff;
|
||||
--primary-container: #56f1e0;
|
||||
--on-primary-container: #00574f;
|
||||
--secondary: #506965;
|
||||
--secondary-container: #cce8e3;
|
||||
--on-secondary-container: #3d5653;
|
||||
--error: #af3d3b;
|
||||
--outline-variant: #b9bc94;
|
||||
--outline: #80835f;
|
||||
--shadow-card: 0 8px 40px rgba(0, 0, 0, 0.08);
|
||||
--radius-card: 2rem;
|
||||
--max-content: 42rem; /* max-w-2xl */
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100dvh;
|
||||
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
background: var(--surface-container-low);
|
||||
color: var(--on-surface);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
#root {
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
.font-headline,
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Manrope', 'Inter', sans-serif;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.2;
|
||||
color: var(--on-surface);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.25rem;
|
||||
margin: 0 0 0.75rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.1rem;
|
||||
margin: 1.25rem 0 0.5rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--primary);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: color 0.15s ease;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--on-primary-container);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
code,
|
||||
.code-inline {
|
||||
display: inline-block;
|
||||
background: var(--secondary-container);
|
||||
color: var(--on-primary-container);
|
||||
padding: 1px 7px;
|
||||
border-radius: 5px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.text-muted,
|
||||
.text-secondary {
|
||||
color: var(--secondary);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.material-symbols-outlined {
|
||||
font-family: 'Material Symbols Outlined', sans-serif;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
line-height: 1;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
||||
direction: ltr;
|
||||
-webkit-font-feature-settings: 'liga';
|
||||
font-feature-settings: 'liga';
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* --- Login (cabinet/login.html) --- */
|
||||
.login-page {
|
||||
min-height: 100dvh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 1.5rem;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.login-shell {
|
||||
width: 100%;
|
||||
max-width: 24rem; /* max-w-sm */
|
||||
transition: max-width 0.2s ease-out;
|
||||
}
|
||||
|
||||
.login-logo {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.login-logo__frame {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
border-radius: 1.5rem;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto 1rem;
|
||||
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 25%, transparent);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.login-logo__frame .material-symbols-outlined {
|
||||
font-size: 2.25rem;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.login-page h1 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 800;
|
||||
color: var(--primary);
|
||||
margin: 0 0 0.25rem;
|
||||
}
|
||||
|
||||
.login-subtitle {
|
||||
color: var(--secondary);
|
||||
font-size: 0.875rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
background: #fff;
|
||||
border-radius: var(--radius-card);
|
||||
box-shadow: var(--shadow-card);
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
/* Form controls */
|
||||
.form-label {
|
||||
display: block;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
color: var(--on-surface);
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
width: 100%;
|
||||
padding: 11px 13px;
|
||||
border: 1.5px solid var(--outline-variant);
|
||||
border-radius: 0.75rem;
|
||||
font-size: 15px;
|
||||
font-family: inherit;
|
||||
outline: none;
|
||||
background: var(--surface-container-low);
|
||||
color: var(--on-surface);
|
||||
transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.form-input::placeholder {
|
||||
color: var(--on-surface-variant);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.form-input:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 3px rgba(0, 113, 104, 0.12);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.form-field {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
font-family: inherit;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
padding: 0.55rem 1.1rem;
|
||||
border-radius: 0.75rem;
|
||||
border: 1.5px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
width: 100%;
|
||||
padding-top: 0.65rem;
|
||||
padding-bottom: 0.65rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #00645b;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.btn-primary:active {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--primary);
|
||||
border-color: color-mix(in srgb, var(--outline-variant) 50%, transparent);
|
||||
}
|
||||
|
||||
.btn-ghost:hover {
|
||||
background: var(--surface-container);
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
.btn-ghost:disabled,
|
||||
.btn-primary:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn--sm {
|
||||
font-size: 0.8rem;
|
||||
padding: 0.35rem 0.6rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
/* --- App shell (cabinet/base) --- */
|
||||
.cabinet-app {
|
||||
min-height: 100dvh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.cabinet-page--center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100dvh;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.cabinet-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
background: color-mix(in srgb, var(--surface) 88%, transparent);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 35%, transparent);
|
||||
}
|
||||
|
||||
.cabinet-header__inner {
|
||||
max-width: var(--max-content);
|
||||
margin: 0 auto;
|
||||
padding: 0.75rem 1.25rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.cabinet-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.65rem;
|
||||
color: var(--on-surface);
|
||||
text-decoration: none;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cabinet-brand:hover {
|
||||
text-decoration: none;
|
||||
color: var(--on-surface);
|
||||
}
|
||||
|
||||
.cabinet-brand__icon {
|
||||
font-size: 1.75rem;
|
||||
color: var(--primary);
|
||||
background: var(--surface-container-low);
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.35rem;
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.cabinet-brand__title {
|
||||
font-family: 'Manrope', 'Inter', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1rem;
|
||||
line-height: 1.2;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.cabinet-brand__subtitle {
|
||||
font-size: 0.7rem;
|
||||
color: var(--secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.cabinet-header__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.cabinet-user {
|
||||
font-size: 0.8rem;
|
||||
color: var(--on-surface-variant);
|
||||
text-align: right;
|
||||
max-width: 12rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 480px) {
|
||||
.cabinet-user {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
.cabinet-user__role {
|
||||
color: var(--secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.cabinet-main {
|
||||
flex: 1;
|
||||
max-width: var(--max-content);
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 1.25rem 1.25rem 2.5rem;
|
||||
}
|
||||
|
||||
/* Cards & lists */
|
||||
.surface-card {
|
||||
background: var(--surface);
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
|
||||
border-radius: 1rem;
|
||||
padding: 1rem 1.1rem;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.list-stack {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.list-row {
|
||||
display: block;
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
|
||||
border-radius: 1rem;
|
||||
padding: 0.9rem 1rem;
|
||||
background: var(--surface);
|
||||
transition: border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
|
||||
.list-row:hover {
|
||||
border-color: color-mix(in srgb, var(--primary) 35%, var(--outline-variant));
|
||||
box-shadow: 0 2px 12px rgba(0, 113, 104, 0.08);
|
||||
}
|
||||
|
||||
.list-row a {
|
||||
text-decoration: none;
|
||||
color: var(--on-surface);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.list-row a:hover {
|
||||
color: var(--primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.list-row__meta {
|
||||
color: var(--secondary);
|
||||
font-size: 0.8rem;
|
||||
display: block;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
/* Вся плитка — одна ссылка */
|
||||
.list-row--action {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.list-row--action .list-row__link {
|
||||
display: block;
|
||||
padding: 0.9rem 1rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
outline-offset: 2px;
|
||||
border-radius: inherit;
|
||||
transition: background 0.12s ease;
|
||||
}
|
||||
|
||||
.list-row--action .list-row__link:hover {
|
||||
background: color-mix(in srgb, var(--primary) 6%, transparent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.list-row--action .list-row__title {
|
||||
display: block;
|
||||
color: var(--on-surface);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Список: слева ссылка на карточку, справа «Пройти» */
|
||||
.list-row--split {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.list-row--split .list-row__main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.list-row--split .list-row__link {
|
||||
display: block;
|
||||
padding: 0.9rem 1rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
outline-offset: 2px;
|
||||
border-radius: 0.85rem 0 0 0.85rem;
|
||||
transition: background 0.12s ease;
|
||||
}
|
||||
|
||||
.list-row--split .list-row__link:hover {
|
||||
background: color-mix(in srgb, var(--primary) 6%, transparent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.list-row--split .list-row__side {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.5rem 0.9rem 0.5rem 0;
|
||||
flex-shrink: 0;
|
||||
border-left: 1px solid color-mix(in srgb, var(--outline-variant) 35%, transparent);
|
||||
}
|
||||
|
||||
.list-row--split .list-row__title {
|
||||
display: block;
|
||||
color: var(--on-surface);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
.list-row--split {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.list-row--split .list-row__link {
|
||||
border-radius: 0.85rem 0.85rem 0 0;
|
||||
}
|
||||
|
||||
.list-row--split .list-row__side {
|
||||
width: 100%;
|
||||
justify-content: flex-end;
|
||||
border-left: none;
|
||||
border-top: 1px solid color-mix(in srgb, var(--outline-variant) 35%, transparent);
|
||||
padding: 0.5rem 0.9rem 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Карточка теста: визуальные блоки + сворачивание (удобно на узком экране) */
|
||||
.test-detail-page {
|
||||
max-width: var(--max-content, 42rem);
|
||||
margin: 0 auto;
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.cabinet-brick {
|
||||
margin-bottom: 1.1rem;
|
||||
}
|
||||
|
||||
.cabinet-brick--hero {
|
||||
padding: 0.1rem 0 0.2rem;
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 45%, transparent);
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.cabinet-disclosure {
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
|
||||
border-radius: 1rem;
|
||||
background: var(--surface);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.cabinet-disclosure__summary {
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
user-select: none;
|
||||
padding: 0.85rem 1rem 0.75rem;
|
||||
font-size: 1.05rem;
|
||||
border-radius: 1rem 1rem 0 0;
|
||||
min-height: 2.75rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cabinet-disclosure__summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cabinet-disclosure__summary::after {
|
||||
content: 'expand_more';
|
||||
font-family: 'Material Symbols Outlined', sans-serif;
|
||||
margin-left: auto;
|
||||
font-size: 1.25rem;
|
||||
opacity: 0.55;
|
||||
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.cabinet-disclosure[open] .cabinet-disclosure__summary::after {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.cabinet-disclosure__body {
|
||||
padding: 0 1rem 1.05rem;
|
||||
border-top: 1px solid color-mix(in srgb, var(--outline-variant) 35%, transparent);
|
||||
}
|
||||
|
||||
.cabinet-disclosure[open] .cabinet-disclosure__summary {
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 25%, transparent);
|
||||
}
|
||||
|
||||
/* Назначение: поиск + список */
|
||||
.assign-toolbar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.65rem;
|
||||
}
|
||||
|
||||
@media (min-width: 520px) {
|
||||
.assign-toolbar {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.assign-toolbar .form-input {
|
||||
flex: 1 1 160px;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.assign-toolbar__search {
|
||||
flex: 1 1 200px;
|
||||
}
|
||||
|
||||
.assign-list {
|
||||
max-height: min(50vh, 22rem);
|
||||
overflow: auto;
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
|
||||
border-radius: 0.75rem;
|
||||
background: var(--surface-container-low);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.assign-row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
padding: 0.65rem 0.75rem;
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
|
||||
cursor: pointer;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.assign-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.assign-row--selected,
|
||||
.assign-row:hover {
|
||||
background: color-mix(in srgb, var(--primary) 8%, transparent);
|
||||
}
|
||||
|
||||
.assign-row__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.2rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.assign-row__fio {
|
||||
font-weight: 600;
|
||||
color: var(--on-surface);
|
||||
font-size: 0.95rem;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.assign-row__login {
|
||||
font-size: 0.8rem;
|
||||
color: var(--secondary);
|
||||
font-family: ui-monospace, Menlo, monospace;
|
||||
}
|
||||
|
||||
.assign-row__meta {
|
||||
font-size: 0.8rem;
|
||||
color: var(--secondary);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.create-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
margin: 1.25rem 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.create-row .form-input {
|
||||
flex: 1 1 12rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.create-row .btn {
|
||||
width: auto;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.callout {
|
||||
border-radius: 1rem;
|
||||
padding: 0.75rem 1rem;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
.callout--warning {
|
||||
background: #fffbeb;
|
||||
border: 1px solid #fde68a;
|
||||
color: #92400e;
|
||||
}
|
||||
|
||||
.callout--error {
|
||||
background: #fff5f5;
|
||||
border: 1px solid #fecaca;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.callout--success {
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #a7f3d0;
|
||||
color: #047857;
|
||||
}
|
||||
|
||||
.error-text {
|
||||
color: var(--error);
|
||||
font-size: 0.9rem;
|
||||
margin: 0.5rem 0 0;
|
||||
}
|
||||
|
||||
.link-back {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
/* Table (detail) */
|
||||
.table-cabinet {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table-cabinet th,
|
||||
.table-cabinet td {
|
||||
padding: 0.5rem 0.6rem;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 40%, transparent);
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.table-cabinet th {
|
||||
color: var(--secondary);
|
||||
font-weight: 600;
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.table-cabinet tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.table-cabinet .mono {
|
||||
font-size: 0.75rem;
|
||||
word-break: break-all;
|
||||
color: var(--on-surface-variant);
|
||||
}
|
||||
|
||||
.draft-block {
|
||||
margin-top: 1.25rem;
|
||||
padding: 1rem;
|
||||
background: var(--surface-container);
|
||||
border-radius: 1rem;
|
||||
border: 1px solid color-mix(in srgb, var(--outline-variant) 35%, transparent);
|
||||
}
|
||||
|
||||
.draft-block .form-input {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--secondary);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.inline-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.inline-actions .btn {
|
||||
width: auto;
|
||||
}
|
||||
Reference in New Issue
Block a user