Tools → Video clips (migration 036, admins and up). Paste a YouTube or Facebook link and the server downloads it with yt-dlp; then cut clips: start and end set while watching, a shape (as filmed, 16:9, square or 9:16 at the sizes the platforms ask for, cropped around a chosen point shown over the video), and MP4 video or MP3 audio. Jobs queue and run one at a time with progress. Only YouTube and Facebook links are accepted, and both tools run with argument lists, never a shell. A clip's file is deleted once it has been downloaded in full, unless it's saved to the media library first, which now holds video and audio (image fields still pick images only). Everything is swept a day after it's made. Setup is in docs/video-clips.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
99 lines
4.1 KiB
TypeScript
99 lines
4.1 KiB
TypeScript
import { BrowserRouter, Routes, Route, Outlet, Navigate } from "react-router-dom";
|
|
import { lazy, Suspense } from "react";
|
|
/*Components*/
|
|
import Layout from "./components/Layout.tsx";
|
|
|
|
/*Libraries*/
|
|
import { AuthProvider, RequireAuth } from "./lib/auth.tsx";
|
|
import RequireRole from "./pages/admin/RequireRole.tsx";
|
|
|
|
/*Primary Pages*/
|
|
import Home from "./pages/Home.tsx";
|
|
import Retreats from "./pages/Retreats.tsx";
|
|
import Community from "./pages/Community.tsx";
|
|
import Leadership from "./pages/Leadership.tsx";
|
|
import Resources from "./pages/Resources.tsx";
|
|
import History from "./pages/History.tsx";
|
|
|
|
/*Secondary Pages*/
|
|
import Feedback from "./pages/Feedback.tsx";
|
|
import Giving from "./pages/Giving.tsx";
|
|
|
|
/*Entity Pages*/
|
|
import EventDetail from './pages/EventDetail.tsx'
|
|
import OrganizationDetail from './pages/OrganizationDetail.tsx'
|
|
import TeamDetail from './pages/TeamDetail.tsx'
|
|
import AwardDetail from './pages/AwardDetail.tsx'
|
|
import PersonDetail from './pages/PersonDetail.tsx'
|
|
import BlogPost from './pages/BlogPost.tsx'
|
|
|
|
/*Admin Pages*/
|
|
import AdminLayout from "./pages/admin/AdminLayout.tsx";
|
|
import AdminLogin from "./pages/admin/AdminLogin.tsx";
|
|
import AdminPanel from "./pages/admin/AdminPanel.tsx";
|
|
import AdminHome from "./pages/admin/AdminHome.tsx";
|
|
import AdminFeedback from "./pages/admin/AdminFeedback.tsx";
|
|
import AdminMedia from "./pages/admin/AdminMedia.tsx";
|
|
import AdminClips from "./pages/admin/AdminClips.tsx";
|
|
import EntityList from "./pages/admin/EntityList.tsx";
|
|
import EntityEdit from "./pages/admin/EntityEdit.tsx";
|
|
|
|
/*Ternary Pages*/
|
|
import Privacy from "./pages/Privacy.tsx";
|
|
import Terms from "./pages/Terms.tsx";
|
|
import NotFound from "./pages/NotFound.tsx";
|
|
|
|
// Loaded on demand: it brings the QR encoder, which no other page needs.
|
|
const QrCodes = lazy(() => import("./pages/QrCodes.tsx"));
|
|
|
|
export default function App() {
|
|
return (
|
|
<BrowserRouter>
|
|
<Routes>
|
|
{/* Layout renders the nav once and swaps page content into <Outlet /> */}
|
|
<Route element={<Layout />}>
|
|
<Route index element={<Home />} />
|
|
<Route path="retreats" element={<Retreats />} />
|
|
<Route path="/events/:id" element={<EventDetail />} />
|
|
<Route path="community" element={<Community />} />
|
|
<Route path="/regions/:id" element={<OrganizationDetail />} />
|
|
<Route path="/chapters/:id" element={<OrganizationDetail />} />
|
|
<Route path="/partners/:id" element={<OrganizationDetail />} />
|
|
<Route path="/organizations/:id" element={<OrganizationDetail />} />
|
|
<Route path="/teams/:id" element={<TeamDetail />} />
|
|
<Route path="/awards/:id" element={<AwardDetail />} />
|
|
<Route path="/people/:id" element={<PersonDetail />} />
|
|
<Route path="/blog/:id" element={<BlogPost />} />
|
|
<Route path="leadership" element={<Leadership />} />
|
|
<Route path="resources" element={<Resources />} />
|
|
<Route path="history" element={<History />} />
|
|
<Route path="feedback" element={<Feedback />} />
|
|
<Route path="qr" element={<Suspense fallback={null}><QrCodes /></Suspense>} />
|
|
<Route path="give" element={<Giving />} />
|
|
<Route path="privacy" element={<Privacy />} />
|
|
<Route path="terms" element={<Terms />} />
|
|
<Route path="*" element={<NotFound />} />
|
|
</Route>
|
|
<Route element={<AuthProvider><Outlet /></AuthProvider>}>
|
|
<Route path="/admin/login" element={<AdminLogin />} />
|
|
<Route element={<RequireAuth />}>
|
|
<Route path="/admin" element={<AdminLayout />}>
|
|
<Route index element={<Navigate to="/admin/home" replace />} />
|
|
<Route path="home" element={<AdminHome />} />
|
|
<Route element={<RequireRole role="superadmin" />}>
|
|
<Route path="panel" element={<AdminPanel />} />
|
|
</Route>
|
|
<Route path="feedback" element={<AdminFeedback />} />
|
|
<Route path="media" element={<AdminMedia />} />
|
|
<Route element={<RequireRole role="admin" />}>
|
|
<Route path="clips" element={<AdminClips />} />
|
|
</Route>
|
|
<Route path=":entity" element={<EntityList />} />
|
|
<Route path=":entity/:id" element={<EntityEdit />} />
|
|
</Route>
|
|
</Route>
|
|
</Route>
|
|
</Routes>
|
|
</BrowserRouter>
|
|
);
|
|
}
|