mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 05:39:57 -05:00
Refactoring docs to match new url scheme like videos and archives.
This commit is contained in:
parent
66a891c759
commit
1c79c1c495
7 changed files with 28 additions and 49 deletions
|
|
@ -187,7 +187,7 @@ function DocPage() {
|
|||
|
||||
const handleDelete = async () => {
|
||||
if (doc && doc.id) {
|
||||
await deleteDocs([doc.id]);
|
||||
await deleteDocs([docFile.id]);
|
||||
toast({
|
||||
type: 'success',
|
||||
title: 'Document Deleted',
|
||||
|
|
@ -512,7 +512,7 @@ export function DocsRoute() {
|
|||
text: 'Docs',
|
||||
to: '/docs',
|
||||
end: true,
|
||||
isActive: () => path === '/docs' || /^\/docs\/view\/\d+$/.test(path)
|
||||
isActive: () => path === '/docs' || /^\/docs\/\d+$/.test(path)
|
||||
},
|
||||
{text: 'Subjects', to: '/docs/subjects', isActive: () => path.startsWith('/docs/subjects')},
|
||||
{text: 'Authors', to: '/docs/authors', isActive: () => path.startsWith('/docs/authors')},
|
||||
|
|
@ -523,7 +523,7 @@ export function DocsRoute() {
|
|||
<TabLinks links={links}/>
|
||||
<Routes>
|
||||
<Route path='/' element={<DocsPage/>}/>
|
||||
<Route path='view/:fileGroupId' element={<DocPage/>}/>
|
||||
<Route path=':fileGroupId' element={<DocPage/>}/>
|
||||
<Route path='subjects' element={<SubjectsPage/>}/>
|
||||
<Route path='authors' element={<AuthorsPage/>}/>
|
||||
<Route path='statistics' element={<DocsStatisticsPage/>}/>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ function EbookCard({file, sortField}) {
|
|||
const viewerUrl = isEpub ? `/epub/epub.html?url=${downloadUrl}` : null;
|
||||
|
||||
// Link to doc detail page if this is a modeled doc.
|
||||
const detailUrl = file.model === 'doc' ? `/docs/view/${file.id}` : null;
|
||||
const detailUrl = file.model === 'doc' ? `/docs/${file.id}` : null;
|
||||
|
||||
const color = mimetypeColor(file.mimetype, file.primary_path);
|
||||
const title = file.title || file.stem || file.name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue