This commit is contained in:
2025-08-23 18:01:23 +09:00
parent d5ff17074f
commit e79688783e
28 changed files with 126 additions and 131 deletions
+4 -4
View File
@@ -98,7 +98,7 @@ export default () => {
<MainArea>
<Helmet>
<title>{`${ title } Wiki | ${ SITE_TITLE }`}</title>
{!(wikiPage?.body) && <meta name="robots" content="noindex" />}
{!(wikiPage?.body) && <meta name="robots" content="noindex"/>}
</Helmet>
{(wikiPage && version) && (
@@ -120,18 +120,18 @@ export default () => {
<TagLink tag={tag}
withWiki={false}
withCount={false}
{...(version && { to: `/wiki/${ encodeURIComponent (title) }` })} />
{...(version && { to: `/wiki/${ encodeURIComponent (title) }` })}/>
</PageTitle>
<div className="prose mx-auto p-4">
{wikiPage === undefined
? 'Loading...'
: <WikiBody title={title} body={wikiPage?.body} />}
: <WikiBody title={title} body={wikiPage?.body}/>}
</div>
{(!(version) && posts.length > 0) && (
<TabGroup>
<Tab name="広場">
<PostList posts={posts} />
<PostList posts={posts}/>
</Tab>
</TabGroup>)}
</MainArea>)
+1 -1
View File
@@ -42,7 +42,7 @@ export default () => {
diff.diff.map (d => (
<span className={cn (d.type === 'added' && 'bg-green-200 dark:bg-green-800',
d.type === 'removed' && 'bg-red-200 dark:bg-red-800')}>
{d.content == '\n' ? <br /> : d.content}
{d.content == '\n' ? <br/> : d.content}
</span>)))
: 'Loading...'}
</div>
+3 -3
View File
@@ -21,7 +21,7 @@ type Props = { user: User | null }
export default ({ user }: Props) => {
if (!(['admin', 'member'].some (r => user?.role === r)))
return <Forbidden />
return <Forbidden/>
const { id } = useParams ()
@@ -73,7 +73,7 @@ export default ({ user }: Props) => {
<input type="text"
value={title}
onChange={e => setTitle (e.target.value)}
className="w-full border p-2 rounded" />
className="w-full border p-2 rounded"/>
</div>
{/* 本文 */}
@@ -82,7 +82,7 @@ export default ({ user }: Props) => {
<MdEditor value={body}
style={{ height: '500px' }}
renderHTML={text => mdParser.render (text)}
onChange={({ text }) => setBody (text)} />
onChange={({ text }) => setBody (text)}/>
</div>
{/* 送信 */}
+49 -49
View File
@@ -27,54 +27,54 @@ export default () => {
return (
<MainArea>
<Helmet>
<title>{`Wiki 変更履歴 | ${ SITE_TITLE }`}</title>
</Helmet>
<table className="table-auto w-full border-collapse">
<thead>
<tr>
<th></th>
<th className="p-2 text-left"></th>
<th className="p-2 text-left"></th>
<th className="p-2 text-left"></th>
</tr>
</thead>
<tbody>
{changes.map (change => (
<tr key={change.sha}>
<td>
{change.changeType === 'update' && (
<Link to={`/wiki/${ change.wikiPage.id }/diff?from=${ change.pred }&to=${ change.sha }`}>
</Link>)}
</td>
<td className="p-2">
<Link to={`/wiki/${ encodeURIComponent (change.wikiPage.title) }?version=${ change.sha }`}>
{change.wikiPage.title}
</Link>
</td>
<td className="p-2">
{(() => {
switch (change.changeType)
{
case 'create':
return '新規'
case 'update':
return '更新'
case 'delete':
return '削除'
}
}) ()}
</td>
<td className="p-2">
<Link to={`/users/${ change.user.id }`}>
{change.user.name}
</Link>
<br />
{change.timestamp}
</td>
</tr>))}
</tbody>
</table>
<Helmet>
<title>{`Wiki 変更履歴 | ${ SITE_TITLE }`}</title>
</Helmet>
<table className="table-auto w-full border-collapse">
<thead>
<tr>
<th></th>
<th className="p-2 text-left"></th>
<th className="p-2 text-left"></th>
<th className="p-2 text-left"></th>
</tr>
</thead>
<tbody>
{changes.map (change => (
<tr key={change.sha}>
<td>
{change.changeType === 'update' && (
<Link to={`/wiki/${ change.wikiPage.id }/diff?from=${ change.pred }&to=${ change.sha }`}>
</Link>)}
</td>
<td className="p-2">
<Link to={`/wiki/${ encodeURIComponent (change.wikiPage.title) }?version=${ change.sha }`}>
{change.wikiPage.title}
</Link>
</td>
<td className="p-2">
{(() => {
switch (change.changeType)
{
case 'create':
return '新規'
case 'update':
return '更新'
case 'delete':
return '削除'
}
}) ()}
</td>
<td className="p-2">
<Link to={`/users/${ change.user.id }`}>
{change.user.name}
</Link>
<br/>
{change.timestamp}
</td>
</tr>))}
</tbody>
</table>
</MainArea>)
}
+3 -3
View File
@@ -21,7 +21,7 @@ type Props = { user: User | null }
export default ({ user }: Props) => {
if (!(['admin', 'member'].some (r => user?.role === r)))
return <Forbidden />
return <Forbidden/>
const location = useLocation ()
const navigate = useNavigate ()
@@ -67,7 +67,7 @@ export default ({ user }: Props) => {
<input type="text"
value={title}
onChange={e => setTitle (e.target.value)}
className="w-full border p-2 rounded" />
className="w-full border p-2 rounded"/>
</div>
{/* 本文 */}
@@ -76,7 +76,7 @@ export default ({ user }: Props) => {
<MdEditor value={body}
style={{ height: '500px' }}
renderHTML={text => mdParser.render (text)}
onChange={({ text }) => setBody (text)} />
onChange={({ text }) => setBody (text)}/>
</div>
{/* 送信 */}