feat: customer end only — remove admin screens, admin sign-in, roles and admin styles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1fccdc07c9
commit
6480f21b5e
|
|
@ -1,4 +1,6 @@
|
|||
# MakeUp Academy — e-learning platform
|
||||
# RezinaLMS — Customer End
|
||||
|
||||
The student-facing side of the MakeUp Academy e-learning platform. This repo has no admin screens.
|
||||
|
||||
Video courses for makeup artists in Amharic, Afaan Oromoo, Tigrinya and English. Students pay once per course (Telebirr / CBE Birr through ArifPay) and keep it for life.
|
||||
|
||||
|
|
@ -11,7 +13,7 @@ Video courses for makeup artists in Amharic, Afaan Oromoo, Tigrinya and English.
|
|||
| Path | What |
|
||||
|---|---|
|
||||
| `apps/demo` | Next.js 15 static export, inlined into one HTML file and published as the Claude artifact (SPEC §18) |
|
||||
| `packages/features` | All student and admin screens, plus `domain.ts` (payments, access, progress, dashboard rules) |
|
||||
| `packages/features` | All student screens, plus `domain.ts` (payments, access, progress, dashboard rules) |
|
||||
| `packages/data` | `DataSource` interface + `ClaudeDbDataSource`. Production adds `ApiDataSource` |
|
||||
| `packages/i18n` | Message catalogs. `om` and `ti` are drafts that need a translator |
|
||||
| `packages/db/seed` | Demo seed (fictional sample students are marked `isSample`) |
|
||||
|
|
@ -26,6 +28,6 @@ npx -y pnpm@9 test # domain rules (payments, entitlement, progress,
|
|||
npx -y pnpm@9 run i18n:check # every locale has every key
|
||||
```
|
||||
|
||||
**Vercel (standalone demo):** `vercel.json` builds the static export, then `tools/vercel-build.mjs` injects the runtime mock and the seed. Outside Claude, all data lives in memory in each visitor's browser and resets on reload, and every visitor gets admin access. Deploy with `npx vercel deploy --prod`.
|
||||
**Vercel (standalone demo):** `vercel.json` builds the static export, then `tools/vercel-build.mjs` injects the runtime mock and the seed. Outside Claude, all data lives in memory in each visitor's browser and resets on reload. Deploy with `npx vercel deploy --prod`.
|
||||
|
||||
Phases 1–3 (Fastify API, Postgres, ArifPay, R2 video) haven't started yet. They wait on decisions D1, D2 and D8 in SPEC §17.
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ put('courses', 'crs-test', order({ ...base, slug: 'payment-test', categoryId: 'c
|
|||
translations: { en: { title: 'Payment test (staff only)', description: 'Real-money payment check at the provider minimum. Hidden from students and stats (L7).' } },
|
||||
chapters: [ch('ch-t1', { en: 'Test' }, {}, [L('les-t1', 1, { en: { title: 'Test lesson' } })])] }));
|
||||
|
||||
// ---- fictional sample students so the admin dashboard has something to show
|
||||
// ---- fictional sample students so the demo has realistic data
|
||||
const people = [
|
||||
['Abebech G.', '+251911000101', '', 'ET', 'Addis Ababa', 'am', '2026-01-14'],
|
||||
['Tigist M.', '+251911000102', 'tigist@example.com', 'ET', 'Hawassa', 'am', '2026-02-03'],
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
|||
// Pure business rules shared by demo and production screens. No React, no I/O.
|
||||
import type { Assessment, AssessmentResult, Course, Currency, Lesson, LessonProgress, Locale, Order, OrderStatus, Student, Tr, AdminRole } from '@lms/data';
|
||||
import type { Assessment, AssessmentResult, Course, Currency, Lesson, LessonProgress, Locale, Order, OrderStatus, Student, Tr } from '@lms/data';
|
||||
|
||||
export const ORDER_TTL_MS = 30 * 60 * 1000;
|
||||
export const COMPLETE_AT = 0.9;
|
||||
|
|
@ -225,27 +225,6 @@ export function publishProblems(c: Course): string[] {
|
|||
|
||||
export const missingLocales = (t: Tr<unknown>): Locale[] => (['en', 'am', 'om', 'ti'] as Locale[]).filter((l) => !t[l]);
|
||||
|
||||
// ---------------------------------------------------------------- roles (§10.1)
|
||||
|
||||
export type Area = 'dashboard' | 'analytics' | 'courses' | 'categories' | 'students' | 'orders' | 'notifications' | 'issues' | 'settings' | 'admins' | 'audit';
|
||||
|
||||
export const ROLE_AREAS: Record<AdminRole, Area[]> = {
|
||||
SUPER_ADMIN: ['dashboard', 'analytics', 'courses', 'categories', 'students', 'orders', 'notifications', 'issues', 'settings', 'admins', 'audit'],
|
||||
CONTENT_MANAGER: ['dashboard', 'courses', 'categories', 'notifications', 'issues'],
|
||||
SUPPORT_AGENT: ['dashboard', 'courses', 'categories', 'students', 'orders', 'notifications', 'issues'],
|
||||
FINANCE: ['dashboard', 'analytics', 'courses', 'categories', 'students', 'orders', 'issues'],
|
||||
ANALYST: ['dashboard', 'analytics', 'courses', 'categories', 'orders'],
|
||||
};
|
||||
|
||||
export const can = {
|
||||
editContent: (r: AdminRole) => r === 'SUPER_ADMIN' || r === 'CONTENT_MANAGER',
|
||||
editPrices: (r: AdminRole) => r === 'SUPER_ADMIN' || r === 'FINANCE',
|
||||
manageStudents: (r: AdminRole) => r === 'SUPER_ADMIN' || r === 'SUPPORT_AGENT',
|
||||
refund: (r: AdminRole) => r === 'SUPER_ADMIN' || r === 'FINANCE',
|
||||
seeRevenue: (r: AdminRole) => r !== 'SUPPORT_AGENT' && r !== 'CONTENT_MANAGER',
|
||||
manageIssues: (r: AdminRole) => r === 'SUPER_ADMIN' || r === 'SUPPORT_AGENT',
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------- L5 location
|
||||
|
||||
export const ET_CITIES = ['Addis Ababa', 'Adama', 'Arba Minch', 'Bahir Dar', 'Bishoftu', 'Debre Birhan', 'Debre Markos', 'Dessie', 'Dire Dawa', 'Gambela', 'Gondar', 'Harar', 'Hawassa', 'Hosaena', 'Jijiga', 'Jimma', 'Kombolcha', 'Mekelle', 'Nekemte', 'Semera', 'Shashemene', 'Sodo', 'Woldia'];
|
||||
|
|
|
|||
|
|
@ -5,19 +5,17 @@ import type { DataSource } from '@lms/data';
|
|||
import { messages } from '@lms/i18n';
|
||||
import { AppProvider, useApp } from './store';
|
||||
import { StudentApp } from './student';
|
||||
import { AdminApp } from './admin';
|
||||
|
||||
export * from './domain';
|
||||
export { AppProvider, useApp } from './store';
|
||||
|
||||
function Router() {
|
||||
const { route, locale } = useApp();
|
||||
const msgs = route[0] === 'admin' ? messages.en : messages[locale];
|
||||
useEffect(() => { document.documentElement.lang = route[0] === 'admin' ? 'en' : locale; }, [route, locale]);
|
||||
const { locale } = useApp();
|
||||
useEffect(() => { document.documentElement.lang = locale; }, [locale]);
|
||||
return (
|
||||
<NextIntlClientProvider locale={route[0] === 'admin' ? 'en' : locale} messages={msgs} timeZone="Africa/Addis_Ababa"
|
||||
<NextIntlClientProvider locale={locale} messages={messages[locale]} timeZone="Africa/Addis_Ababa"
|
||||
onError={() => { /* missing keys fall back to the key; i18n:check catches them in CI */ }}>
|
||||
{route[0] === 'admin' ? <AdminApp /> : <StudentApp />}
|
||||
<StudentApp />
|
||||
</NextIntlClientProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
||||
import type { AdminRole, AuditEntry, Campaign, Category, Course, DataSource, InboxItem, Locale, Settings, Student, Viewer } from '@lms/data';
|
||||
import { createContext, useCallback, useContext, useEffect, useRef, useState, type ReactNode } from 'react';
|
||||
import type { Category, Course, DataSource, InboxItem, Locale, Settings, Student, Viewer } from '@lms/data';
|
||||
import { LOCALES, newId } from '@lms/data';
|
||||
import { messages } from '@lms/i18n';
|
||||
|
||||
|
|
@ -30,10 +30,6 @@ interface Ctx {
|
|||
/** Serialized writes: the db wants one write at a time per document. */
|
||||
write(fn: () => Promise<void>, okMsg?: string): Promise<boolean>;
|
||||
signIn(): void; signOut(): void;
|
||||
/** Demo login role: admin screens need canEdit AND an admin sign-in from the login page. */
|
||||
role: 'student' | 'admin'; setRole(r: 'student' | 'admin'): void;
|
||||
adminRole: AdminRole; setAdminRole(r: AdminRole): void;
|
||||
audit(action: string, entity: string, entityId: string, before?: unknown, after?: unknown): Promise<void>;
|
||||
notify(studentId: string, item: Omit<InboxItem, 'id' | 'createdAt'>): Promise<void>;
|
||||
msg(loc: Locale, key: string, vars?: Record<string, string | number>): string;
|
||||
}
|
||||
|
|
@ -62,8 +58,6 @@ export function AppProvider({ ds, children }: { ds: DataSource; children: ReactN
|
|||
const [locale, setLocaleState] = useState<Locale>('en');
|
||||
const [toastMsg, setToastMsg] = useState<string | null>(null);
|
||||
const [signedOut, setSignedOut] = useState(false);
|
||||
const [role, setRoleState] = useState<'student' | 'admin'>('student');
|
||||
const [adminRole, setAdminRoleState] = useState<AdminRole>('SUPER_ADMIN');
|
||||
const chain = useRef<Promise<unknown>>(Promise.resolve());
|
||||
const toastTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
|
|
@ -75,9 +69,6 @@ export function AppProvider({ ds, children }: { ds: DataSource; children: ReactN
|
|||
setLocaleState(loc);
|
||||
setRoute(r.length ? r : [loc]);
|
||||
setSignedOut(store.get('signedOut') === '1');
|
||||
if (store.get('role') === 'admin') setRoleState('admin');
|
||||
const role = store.get('viewAs') as AdminRole | null;
|
||||
if (role) setAdminRoleState(role);
|
||||
const onHash = () => setRoute(parseRoute(location.hash));
|
||||
addEventListener('hashchange', onHash); addEventListener('popstate', onHash);
|
||||
return () => { removeEventListener('hashchange', onHash); removeEventListener('popstate', onHash); };
|
||||
|
|
@ -137,11 +128,6 @@ export function AppProvider({ ds, children }: { ds: DataSource; children: ReactN
|
|||
if (me && me.locale !== l && !me.deletedAt) write(() => ds.patchStudent(me.id, { locale: l }));
|
||||
}, [me, ds, write]);
|
||||
|
||||
const audit = useCallback(async (action: string, entity: string, entityId: string, before?: unknown, after?: unknown) => {
|
||||
const entry: AuditEntry = { id: newId('a_'), adminId: uid ?? 'unknown', action, entity, entityId, before: before ?? null, after: after ?? null, createdAt: new Date().toISOString() };
|
||||
await ds.addAudit(entry);
|
||||
}, [ds, uid]);
|
||||
|
||||
const notify = useCallback(async (studentId: string, item: Omit<InboxItem, 'id' | 'createdAt'>) => {
|
||||
await ds.addInbox(studentId, { ...item, id: newId('n_'), createdAt: new Date().toISOString(), readAt: null });
|
||||
}, [ds]);
|
||||
|
|
@ -152,10 +138,7 @@ export function AppProvider({ ds, children }: { ds: DataSource; children: ReactN
|
|||
locale, setLocale, route, nav, toast, write,
|
||||
signIn: () => { store.set('signedOut', null); setSignedOut(false); },
|
||||
signOut: () => { store.set('signedOut', '1'); setSignedOut(true); },
|
||||
role, setRole: (r) => { setRoleState(r); store.set('role', r === 'admin' ? r : null); },
|
||||
adminRole: viewer?.isOwner ? adminRole : 'SUPER_ADMIN',
|
||||
setAdminRole: (r) => { setAdminRoleState(r); store.set('viewAs', r); },
|
||||
audit, notify, msg,
|
||||
notify, msg,
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -165,25 +148,3 @@ export function AppProvider({ ds, children }: { ds: DataSource; children: ReactN
|
|||
</AppCtx.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- admin data (subscribed only inside admin)
|
||||
|
||||
interface AdminData { students: Student[]; campaigns: Campaign[]; auditLog: AuditEntry[]; loaded: boolean }
|
||||
const AdminCtx = createContext<AdminData>({ students: [], campaigns: [], auditLog: [], loaded: false });
|
||||
export const useAdminData = () => useContext(AdminCtx);
|
||||
|
||||
export function AdminDataProvider({ children }: { children: ReactNode }) {
|
||||
const { ds } = useApp();
|
||||
const [students, setStudents] = useState<Student[]>([]);
|
||||
const [campaigns, setCampaigns] = useState<Campaign[]>([]);
|
||||
const [auditLog, setAudit] = useState<AuditEntry[]>([]);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
useEffect(() => {
|
||||
const u1 = ds.watchStudents((s) => { setStudents(s); setLoaded(true); });
|
||||
const u2 = ds.watchCampaigns(setCampaigns);
|
||||
const u3 = ds.watchAudit(setAudit);
|
||||
return () => { u1(); u2(); u3(); };
|
||||
}, [ds]);
|
||||
const value = useMemo(() => ({ students, campaigns, auditLog, loaded }), [students, campaigns, auditLog, loaded]);
|
||||
return <AdminCtx.Provider value={value}>{children}</AdminCtx.Provider>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@ function UserMenu() {
|
|||
<button onClick={() => go(`/${locale}/profile`)}><Icon name="user" size={16} />{t('nav.profile')}</button>
|
||||
<button onClick={() => go(`/${locale}/progress`)}><Icon name="chart" size={16} />{t('nav.progress')}</button>
|
||||
<button onClick={() => go(`/${locale}/help`)}><Icon name="help" size={16} />{t('nav.help')}</button>
|
||||
{viewer?.canEdit && <button onClick={() => go(`/${locale}/signin/admin`)}><Icon name="shield" size={16} />{t('nav.adminSignIn')}</button>}
|
||||
<button onClick={() => { signOut(); go(`/${locale}/signin`); }}><Icon name="logout" size={16} />{t('nav.signOut')}</button>
|
||||
</div>
|
||||
</details>
|
||||
|
|
@ -169,7 +168,6 @@ function Footer() {
|
|||
<div><h3>{t('footer.support')}</h3>
|
||||
<a href={settings.telegramLink} target="_blank" rel="noreferrer">{t('help.telegram')}</a>
|
||||
<span className="num">{settings.supportPhone}</span>
|
||||
{viewer?.canEdit && <button onClick={() => nav('/admin')}>{t('nav.admin')}</button>}
|
||||
</div>
|
||||
<div><h3>{t('common.language')}</h3>{LOCALES.map((l) => <button key={l} lang={l} aria-current={l === locale} onClick={() => setLocale(l)}>{LOCALE_NAMES[l]}</button>)}</div>
|
||||
</nav>
|
||||
|
|
@ -196,7 +194,7 @@ function StudentRoutes() {
|
|||
case 'notifications': return <SignInGate><Inbox /></SignInGate>;
|
||||
case 'help': return <Help />;
|
||||
case 'profile': return <SignInGate><Profile /></SignInGate>;
|
||||
case 'signin': return a === 'admin' || !signedIn ? <SignIn tab={a} /> : <Home />;
|
||||
case 'signin': return !signedIn ? <SignIn /> : <Home />;
|
||||
default: return <Landing />;
|
||||
}
|
||||
}
|
||||
|
|
@ -1014,16 +1012,13 @@ function Help() {
|
|||
|
||||
// ---------------------------------------------------------------- sign in (simulated OTP) + profile setup
|
||||
|
||||
function SignIn({ tab: tabParam }: { tab?: string }) {
|
||||
function SignIn() {
|
||||
const t = useTranslations();
|
||||
const { viewer, me, ready, signIn, nav, locale, setRole } = useApp();
|
||||
const tab = tabParam === 'admin' ? 'admin' : 'student';
|
||||
const { viewer, me, ready, signIn, nav, locale } = useApp();
|
||||
const [mode, setMode] = useState<'phone' | 'email'>('phone');
|
||||
const [phone, setPhone] = useState('');
|
||||
const [email, setEmail] = useState('');
|
||||
const [pw, setPw] = useState('');
|
||||
const [adminEmail, setAdminEmail] = useState('admin@makeup.academy');
|
||||
const [adminPw, setAdminPw] = useState('');
|
||||
const [step, setStep] = useState<'start' | 'code' | 'setup'>('start');
|
||||
const [code, setCode] = useState('');
|
||||
const [entered, setEntered] = useState('');
|
||||
|
|
@ -1046,15 +1041,6 @@ function SignIn({ tab: tabParam }: { tab?: string }) {
|
|||
if (entered !== code) { const left = tries - 1; setTries(left); setErr(left ? t('auth.wrongCode', { n: left }) : t('auth.locked')); return; }
|
||||
if (me && !me.deletedAt) { signIn(); nav(`/${locale}`); } else setStep('setup');
|
||||
};
|
||||
// Demo admin sign-in: the real gate is the viewer's edit access; the password is only checked for shape.
|
||||
const adminSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault(); setErr('');
|
||||
if (!viewer?.canEdit) { setErr(t('auth.adminNoAccess')); return; }
|
||||
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(adminEmail)) { setErr(t('auth.emailInvalid')); return; }
|
||||
if (!validPassword(adminPw)) { setErr(t('auth.passwordShort')); return; }
|
||||
setRole('admin'); nav('/admin');
|
||||
};
|
||||
const switchTab = (k: string) => { setErr(''); setStep('start'); nav(`/${locale}/signin${k === 'admin' ? '/admin' : ''}`); };
|
||||
if (step === 'setup') return <ProfileSetup phone={mode === 'phone' ? `+251${phone.replace(/\s/g, '')}` : undefined} email={mode === 'email' ? email : undefined} />;
|
||||
return (
|
||||
<section className="auth">
|
||||
|
|
@ -1065,17 +1051,7 @@ function SignIn({ tab: tabParam }: { tab?: string }) {
|
|||
<ul className="facts">{['fact1', 'fact2', 'fact3'].map((k) => <li key={k}><Icon name="check" size={16} />{t(`landing.${k}`)}</li>)}</ul>
|
||||
</div>
|
||||
<div className="auth-main">
|
||||
<div className="seg auth-tabs" role="group">
|
||||
<button aria-pressed={tab === 'student'} onClick={() => switchTab('student')}>{t('auth.student')}</button>
|
||||
<button aria-pressed={tab === 'admin'} onClick={() => switchTab('admin')}>{t('auth.admin')}</button>
|
||||
</div>
|
||||
{tab === 'admin' ? <form className="stack" onSubmit={adminSubmit}>
|
||||
<div className="stack-sm"><h1>{t('auth.adminTitle')}</h1><p className="muted">{t('auth.adminLead')}</p></div>
|
||||
<label className="field"><span>{t('auth.emailLabel')}</span><input id="aemail" className="input" type="email" autoComplete="username" value={adminEmail} onChange={(e) => setAdminEmail(e.target.value)} /></label>
|
||||
<label className="field"><span>{t('auth.passwordLabel')}</span><input id="apw" className="input" type="password" autoComplete="current-password" value={adminPw} onChange={(e) => setAdminPw(e.target.value)} /><span className="hint">{t('auth.adminHint')}</span></label>
|
||||
{err && <p className="err" role="alert">{err}</p>}
|
||||
<button className="btn btn-block btn-lg">{t('auth.adminButton')}</button>
|
||||
</form> : !viewer?.id ? <Empty>{t('auth.noIdentity')}</Empty> : step === 'start' ? <form className="stack" onSubmit={(e) => { e.preventDefault(); send(); }}>
|
||||
{!viewer?.id ? <Empty>{t('auth.noIdentity')}</Empty> : step === 'start' ? <form className="stack" onSubmit={(e) => { e.preventDefault(); send(); }}>
|
||||
<div className="stack-sm"><h1>{t('auth.welcome')}</h1><p className="muted">{t('auth.welcomeLead')}</p></div>
|
||||
{me && !me.deletedAt && <>
|
||||
<button type="button" className="btn btn-accent btn-block btn-lg" onClick={() => { signIn(); nav(`/${locale}`); }}>{t('auth.continueAs', { name: me.name.split(' ')[0] })}</button>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Layout: student = quiet single column with Ge'ez titles given room; admin = Logosmental-style sidebar shell, dense tables.
|
||||
/* Layout: student = quiet single column with Ge'ez titles given room.
|
||||
Tokens mirror design/tokens.json (§11.3). Components never use raw colors. */
|
||||
:root {
|
||||
--ink: #1D3557; --ink-2: #37627D; --ink-3: #4F7590;
|
||||
|
|
@ -228,41 +228,8 @@ textarea.input { min-height: 110px; resize: vertical; }
|
|||
.two-col { display: grid; gap: 24px; }
|
||||
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }
|
||||
|
||||
/* ---------- admin shell (Logosmental structure) ---------- */
|
||||
.a-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; background: var(--canvas); }
|
||||
@media (min-width: 1024px) { .a-shell { grid-template-columns: 264px 1fr; } }
|
||||
.a-side { background: var(--paper); border-right: 1px solid var(--line); padding: 16px 12px; display: none; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
|
||||
.a-side.open { display: flex; position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 35; box-shadow: var(--shadow-pop); }
|
||||
@media (min-width: 1024px) { .a-side { display: flex; } .a-side.open { position: sticky; width: auto; box-shadow: none; } .a-menu { display: none !important; } }
|
||||
.a-group { display: flex; flex-direction: column; gap: 2px; }
|
||||
.a-group-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px 4px; font-weight: 700; }
|
||||
.a-link { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: var(--r-md); background: none; border: 0; cursor: pointer; text-align: left; font-weight: 700; color: var(--ink-2); width: 100%; position: relative; }
|
||||
.a-link .tile { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--mist); color: var(--ink-2); flex: none; }
|
||||
.a-link:hover { background: var(--mist); }
|
||||
.a-link[aria-current="page"] { background: var(--mist); color: var(--ink); }
|
||||
.a-link[aria-current="page"] .tile { background: var(--ink); color: var(--on-ink); }
|
||||
.a-link[aria-current="page"]::after { content: ''; position: absolute; right: 6px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--ink); }
|
||||
.a-link .count { margin-left: auto; margin-right: 10px; background: var(--alert); color: #fff; font-size: 11px; border-radius: 9px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
|
||||
.a-me { margin-top: auto; padding: 12px; border-radius: var(--r-md); background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; gap: 8px; }
|
||||
.a-me select { background: rgba(255, 255, 255, .12); color: inherit; border: 0; border-radius: var(--r-sm); padding: 6px 8px; font-size: var(--fs-sm); }
|
||||
.a-me select option { color: #000; }
|
||||
.a-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; }
|
||||
.a-main { padding: 24px 16px 96px; display: flex; flex-direction: column; gap: 24px; min-width: 0; max-width: 1280px; width: 100%; margin: 0 auto; }
|
||||
@media (min-width: 720px) { .a-main { padding: 28px 28px 96px; } }
|
||||
.a-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
|
||||
.a-head .eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
|
||||
.a-head h1 { font-size: var(--fs-2xl); }
|
||||
.a-head p { color: var(--ink-2); }
|
||||
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
|
||||
@media (max-width: 600px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 14px 14px 10px; } .stat .val { font-size: var(--fs-xl); } .stat .note { font-size: 12px; } }
|
||||
.stat { background: var(--paper); border-radius: var(--r-lg); padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); }
|
||||
.stat .lbl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
|
||||
.stat .now { white-space: nowrap; }
|
||||
.stat .val { font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.stat .note { border-top: 1px solid var(--line); padding-top: 10px; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.stat .note.bad { color: var(--alert); } .stat .note.ok { color: var(--success); }
|
||||
.stat .now { font-size: 10px; background: var(--mist); color: var(--ink-2); padding: 2px 6px; border-radius: 6px; letter-spacing: .04em; }
|
||||
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
|
||||
.filters .field { flex: 1 1 160px; }
|
||||
.filters .field.search { flex: 2 1 240px; }
|
||||
.filters .input { min-height: 40px; padding: 8px 10px; background: var(--paper); }
|
||||
|
|
@ -273,29 +240,13 @@ table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
|||
.tbl tr.click { cursor: pointer; }
|
||||
.tbl tr.click:hover td { background: var(--mist); }
|
||||
.tbl .r { text-align: right; }
|
||||
.a-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
|
||||
.a-card h2 { font-size: var(--fs-lg); }
|
||||
.a-grid-2 { display: grid; gap: 16px; }
|
||||
@media (min-width: 1000px) { .a-grid-2 { grid-template-columns: 1.4fr 1fr; align-items: start; } .a-grid-2.even { grid-template-columns: 1fr 1fr; } }
|
||||
.chapter-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--canvas); }
|
||||
.lesson-edit { display: grid; gap: 10px; grid-template-columns: 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
|
||||
@media (min-width: 900px) { .lesson-edit { grid-template-columns: 1fr auto; align-items: center; } }
|
||||
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: var(--fs-sm); }
|
||||
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
|
||||
.timeline { display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; }
|
||||
.timeline li { list-style: none; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
|
||||
.timeline li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin-top: 6px; }
|
||||
.timeline li::after { content: ''; position: absolute; left: 4px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
|
||||
.timeline li:last-child::after { display: none; }
|
||||
.chart { width: 100%; height: auto; display: block; }
|
||||
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--f-latin); }
|
||||
.chart .grid { stroke: var(--line); }
|
||||
.chart .barfill { fill: var(--ink); }
|
||||
.chart .barfill.hl { fill: var(--accent); }
|
||||
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 3fr auto; gap: 10px; align-items: center; font-size: var(--fs-sm); }
|
||||
.hbar .track { height: 10px; background: var(--mist); border-radius: var(--r-pill); overflow: hidden; }
|
||||
.hbar .track i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
|
||||
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
|
||||
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
|
||||
.brand > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
|
||||
.s-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
|
||||
|
|
@ -310,13 +261,6 @@ table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
|||
.ccard .cover .pill { display: none; }
|
||||
.ccard h3 { font-size: var(--fs-base); }
|
||||
}
|
||||
/* curriculum editor: one compact row per lesson */
|
||||
.lesson-line { display: grid; gap: 8px 10px; grid-template-columns: 28px minmax(0, 1fr) 76px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
|
||||
.lesson-line .tools { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
|
||||
.lesson-line .notes { grid-column: 2 / -1; }
|
||||
@media (min-width: 1100px) { .lesson-line { grid-template-columns: 28px minmax(0, 1fr) 76px auto; } .lesson-line .tools { grid-column: auto; justify-content: flex-end; } }
|
||||
.lesson-line .input { min-height: 38px; padding: 6px 10px; }
|
||||
.lesson-line .check { font-size: var(--fs-sm); align-items: center; }
|
||||
/* audit fixes: no sideways scroll at 360–400px */
|
||||
@media (max-width: 600px) { .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .stat { min-width: 0; } .stat .lbl { flex-wrap: wrap; letter-spacing: .03em; } .stat .lbl span { overflow-wrap: anywhere; } }
|
||||
@media (max-width: 440px) { .brand > span:last-child { display: none; } .lang-select { max-width: 92px; } }
|
||||
|
|
@ -334,7 +278,7 @@ table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
|||
:root { --f-head: 'Plus Jakarta Sans', var(--f-latin); --shadow-soft: 0 1px 2px rgba(29, 53, 87, .04), 0 8px 24px rgba(29, 53, 87, .07); --hero-a: #F1FAEE; --hero-b: #DCF0F1; }
|
||||
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --hero-a: #0C1623; --hero-b: #163637; } }
|
||||
:root[data-theme="dark"] { --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --hero-a: #0C1623; --hero-b: #163637; }
|
||||
h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .a-shell h1, .a-shell h2, .brand { font-family: var(--f-head); letter-spacing: -.01em; }
|
||||
h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .brand { font-family: var(--f-head); letter-spacing: -.01em; }
|
||||
.btn-lg { min-height: 50px; padding: 0 24px; font-size: var(--fs-base); }
|
||||
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
|
||||
.card { box-shadow: var(--shadow-soft); border-color: transparent; }
|
||||
|
|
@ -489,15 +433,6 @@ h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .a
|
|||
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: var(--fs-sm); }
|
||||
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
|
||||
|
||||
/* admin */
|
||||
.stats-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
|
||||
@media (min-width: 1100px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
|
||||
.stat { box-shadow: var(--shadow-soft); border-color: transparent; }
|
||||
.a-tabs { gap: 18px; }
|
||||
.a-tabs .a-card { border: 0; padding: 0; box-shadow: none; }
|
||||
.a-tabs .a-card > .row-between h2 { display: none; }
|
||||
.a-tabs .stats .stat { box-shadow: none; border: 1px solid var(--line); }
|
||||
.a-out { background: rgba(255, 255, 255, .12); color: inherit; }
|
||||
@media (max-width: 899px) { .l-hero { padding-bottom: 32px; } .statbar { margin-top: -8px; } }
|
||||
|
||||
/* ================= v4: Summer Ocean Breeze palette (white base; navy text, red for calls to action, blues for UI state) ================= */
|
||||
|
|
@ -526,11 +461,8 @@ h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .a
|
|||
.cta-band > * { position: relative; z-index: 1; }
|
||||
.continue { background: linear-gradient(120deg, #1D3557, #29495E); color: #fff; }
|
||||
.continue .bar > i { background: #A8DADC; }
|
||||
.a-link[aria-current="page"]::after { background: var(--accent); }
|
||||
.a-me { background: linear-gradient(160deg, #1D3557, #29495E); color: #fff; }
|
||||
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
|
||||
.ccard:hover .ccard-cta { background: var(--accent); border-color: var(--accent); color: #fff; }
|
||||
.a-shell { background: var(--paper); }
|
||||
.pay-mark { width: 48px; height: 28px; flex: none; display: grid; place-items: center; }
|
||||
.pay-mark img { width: 48px; height: 28px; object-fit: contain; }
|
||||
.pay-logo { padding: 8px 14px 8px 10px; }
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@
|
|||
"notifications": "ማሳወቂያዎች",
|
||||
"signIn": "ግባ",
|
||||
"signOut": "ውጣ",
|
||||
"admin": "የአስተዳዳሪ ገጽ",
|
||||
"getStarted": "ይጀምሩ",
|
||||
"adminSignIn": "የአስተዳዳሪ መግቢያ",
|
||||
"account": "መለያ",
|
||||
"progress": "የእኔ እድገት"
|
||||
},
|
||||
|
|
@ -81,15 +79,8 @@
|
|||
"noIdentity": "የተማሪ መለያ ለመፍጠር ወደ Claude ገብተው ይህን ማሳያ ይክፈቱ።",
|
||||
"welcome": "እንኳን ደህና መጡ",
|
||||
"welcomeLead": "ኮርሶችዎን መመልከት ለመቀጠል ይግቡ።",
|
||||
"student": "ተማሪ",
|
||||
"admin": "አስተዳዳሪ",
|
||||
"continueAs": "እንደ {name} ይቀጥሉ",
|
||||
"or": "ወይም",
|
||||
"adminTitle": "የአስተዳዳሪ መግቢያ",
|
||||
"adminLead": "ኮርሶችን፣ ተማሪዎችንና ክፍያዎችን ያስተዳድሩ።",
|
||||
"adminButton": "ወደ አስተዳዳሪ ይግቡ",
|
||||
"adminNoAccess": "ይህ መለያ የአስተዳዳሪ ገጹን መክፈት አይችልም። ባለቤቱን የማስተካከል ፈቃድ ይጠይቁ።",
|
||||
"adminHint": "ማሳያ፦ 8 እና ከዚያ በላይ ፊደላት ያለው ማንኛውም የይለፍ ቃል ይሰራል።",
|
||||
"sideTitle": "ከባለሙያ አርቲስቶች ሜካፕ ይማሩ",
|
||||
"sideBody": "የቪዲዮ ትምህርቶች በአማርኛ፣ በአፋን ኦሮሞ፣ በትግርኛና በእንግሊዝኛ። አንድ ጊዜ ይክፈሉ፣ ኮርሱን ለዘላለም ያቆዩ።"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@
|
|||
"notifications": "Notifications",
|
||||
"signIn": "Sign in",
|
||||
"signOut": "Sign out",
|
||||
"admin": "Admin panel",
|
||||
"getStarted": "Get started",
|
||||
"adminSignIn": "Admin sign-in",
|
||||
"account": "Account",
|
||||
"progress": "My progress"
|
||||
},
|
||||
|
|
@ -81,15 +79,8 @@
|
|||
"noIdentity": "Open this demo while signed in to Claude to create a student account.",
|
||||
"welcome": "Welcome back",
|
||||
"welcomeLead": "Sign in to keep watching your courses.",
|
||||
"student": "Student",
|
||||
"admin": "Admin",
|
||||
"continueAs": "Continue as {name}",
|
||||
"or": "or",
|
||||
"adminTitle": "Admin sign-in",
|
||||
"adminLead": "Manage courses, students and payments.",
|
||||
"adminButton": "Sign in to admin",
|
||||
"adminNoAccess": "This account can’t open the admin panel. Ask the owner for edit access.",
|
||||
"adminHint": "Demo: any password with 8 or more characters works.",
|
||||
"sideTitle": "Learn makeup from working artists",
|
||||
"sideBody": "Video lessons in Amharic, Afaan Oromoo, Tigrinya and English. Pay once and keep the course for life."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@
|
|||
"notifications": "Beeksisota",
|
||||
"signIn": "Seeni",
|
||||
"signOut": "Ba'i",
|
||||
"admin": "Fuula bulchiinsaa",
|
||||
"getStarted": "Get started",
|
||||
"adminSignIn": "Admin sign-in",
|
||||
"account": "Account",
|
||||
"progress": "My progress"
|
||||
},
|
||||
|
|
@ -81,15 +79,8 @@
|
|||
"noIdentity": "Herrega barataa uumuuf Claude'tti seenii agarsiisa kana bani.",
|
||||
"welcome": "Welcome back",
|
||||
"welcomeLead": "Sign in to keep watching your courses.",
|
||||
"student": "Student",
|
||||
"admin": "Admin",
|
||||
"continueAs": "Continue as {name}",
|
||||
"or": "or",
|
||||
"adminTitle": "Admin sign-in",
|
||||
"adminLead": "Manage courses, students and payments.",
|
||||
"adminButton": "Sign in to admin",
|
||||
"adminNoAccess": "This account can’t open the admin panel. Ask the owner for edit access.",
|
||||
"adminHint": "Demo: any password with 8 or more characters works.",
|
||||
"sideTitle": "Learn makeup from working artists",
|
||||
"sideBody": "Video lessons in Amharic, Afaan Oromoo, Tigrinya and English. Pay once and keep the course for life."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@
|
|||
"notifications": "መፍለጢታት",
|
||||
"signIn": "እቶ",
|
||||
"signOut": "ውጻእ",
|
||||
"admin": "ገጽ ምምሕዳር",
|
||||
"getStarted": "Get started",
|
||||
"adminSignIn": "Admin sign-in",
|
||||
"account": "Account",
|
||||
"progress": "My progress"
|
||||
},
|
||||
|
|
@ -81,15 +79,8 @@
|
|||
"noIdentity": "ናይ ተማሃራይ ሕሳብ ንምፍጣር ናብ Claude ኣቲኻ እዚ መርኣያ ክፈቶ።",
|
||||
"welcome": "Welcome back",
|
||||
"welcomeLead": "Sign in to keep watching your courses.",
|
||||
"student": "Student",
|
||||
"admin": "Admin",
|
||||
"continueAs": "Continue as {name}",
|
||||
"or": "or",
|
||||
"adminTitle": "Admin sign-in",
|
||||
"adminLead": "Manage courses, students and payments.",
|
||||
"adminButton": "Sign in to admin",
|
||||
"adminNoAccess": "This account can’t open the admin panel. Ask the owner for edit access.",
|
||||
"adminHint": "Demo: any password with 8 or more characters works.",
|
||||
"sideTitle": "Learn makeup from working artists",
|
||||
"sideBody": "Video lessons in Amharic, Afaan Oromoo, Tigrinya and English. Pay once and keep the course for life."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const dom = new JSDOM(fs.readFileSync(file, 'utf8'), {
|
|||
});
|
||||
const w = dom.window;
|
||||
await new Promise((r) => setTimeout(r, 2000));
|
||||
for (const route of ['#/am', '#/am/courses', '#/admin']) { w.location.hash = route; await new Promise((r) => setTimeout(r, 300)); }
|
||||
for (const route of ['#/am', '#/am/courses', '#/en/help']) { w.location.hash = route; await new Promise((r) => setTimeout(r, 300)); }
|
||||
// React can re-insert hoisted <link>/<script> tags at hydration; jsdom doesn't fetch them, so scan the DOM too.
|
||||
for (const el of w.document.querySelectorAll('link[href],script[src]')) network.push(`${el.tagName.toLowerCase()} ${el.getAttribute('href') ?? el.getAttribute('src')}`);
|
||||
const allowed = (u) => /^link https:\/\/fonts\.(googleapis|gstatic)\.com/.test(u) || /cdnjs\.cloudflare\.com|cdn\.jsdelivr\.net\/npm|fonts\.googleapis\.com|fonts\.gstatic\.com/.test(u);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ const mock = fs.readFileSync(new URL('./runtime-mock.js', import.meta.url), 'utf
|
|||
const routes = [
|
||||
['', 1], ['#/am/signin', 1], ['#/am'], ['#/am/courses'], ['#/en/course/makeup-foundations'], ['#/am/course/bridal-makeup'], ['#/am/learn/makeup-foundations/les-f3'],
|
||||
['#/am/learn/bridal-makeup/les-b4'], ['#/am/checkout/bridal-makeup'], ['#/am/my'], ['#/am/progress'], ['#/am/notifications'], ['#/am/help'], ['#/am/profile'],
|
||||
['#/admin'], ['#/admin/analytics'], ['#/admin/courses'], ['#/admin/courses/crs-foundations/details'], ['#/admin/courses/crs-foundations/curriculum'], ['#/admin/courses/crs-business/details'],
|
||||
['#/admin/categories'], ['#/admin/students'], ['#/admin/students/sample-1'], ['#/admin/orders'], ['#/admin/notifications'], ['#/admin/issues'], ['#/admin/settings'], ['#/admin/admins'], ['#/admin/audit'],
|
||||
];
|
||||
const b = await puppeteer.launch({ executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', headless: true });
|
||||
const problems = []; let clicks = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user