diff --git a/.gitignore b/.gitignore index 8438aa6..158531f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,9 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts db.sqlite +bucket/85a36ce6-1d2a-4f3c-bbbb-2c6c336bf61e/FB_IMG_1716665756868.jpg +bucket/85a36ce6-1d2a-4f3c-bbbb-2c6c336bf61e/patchnotes.png +bucket/e2ffa828-0b1c-44ec-aaf7-b003f2ff57cb/FB_IMG_1716665756868.jpg +bucket/e2ffa828-0b1c-44ec-aaf7-b003f2ff57cb/patchnotes.png +.env +yarn.lock diff --git a/package.json b/package.json index f9ad7a4..1e928ff 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,8 @@ "react-bootstrap": "^2.7.4", "react-dom": "18.2.0", "react-hot-toast": "^2.4.1", + "remark": "^15.0.1", + "remark-mdx-to-plain-text": "^3.0.0", "sqlite": "^4.2.1", "swagger-jsdoc": "^6.2.8", "swagger-ui-react": "^5.17.2", diff --git a/src/components/client/admin/PostEditor.tsx b/src/components/client/admin/PostEditor.tsx index e1791ac..75ea623 100644 --- a/src/components/client/admin/PostEditor.tsx +++ b/src/components/client/admin/PostEditor.tsx @@ -61,7 +61,7 @@ export default function PostEditor(props:EditorProps){

Project

Attachments

@@ -74,18 +74,23 @@ export default function PostEditor(props:EditorProps){ let bucketMap:Map = new Map(props.post.buckets.map((b)=>[b.id as UUID,b])); let bucketList = [...props.post.buckets.map((b)=>b.id)]; return bucketList.map((e)=>{ - return {e}
    {bucketMap.get(e as UUID)?.attachments.map((attachment)=>
  • {attachment.filename}
  • )}
+ return <> + + + {e} + + +
    +
  • + { bucketMap.get(e as UUID)?.attachments.map((attachment)=>
  • {attachment.filename}
  • ) } +
+
+
+
}) })() } - - - - ... +
- - ... -
-
diff --git a/src/components/shared/news/article.module.css b/src/components/shared/news/article.module.css index 34c3c1f..146cc35 100644 --- a/src/components/shared/news/article.module.css +++ b/src/components/shared/news/article.module.css @@ -22,4 +22,14 @@ .summary{ /* flex-shrink: 1; */ padding:8px; -} \ No newline at end of file +} + +.article-content p:has(img){ + width: 100%; + background-color: var(--background-900); +} + +.article-content p img{ + margin:auto; + height: 100%; +} diff --git a/src/components/shared/news/article.tsx b/src/components/shared/news/article.tsx index a706c33..d05bf3f 100644 --- a/src/components/shared/news/article.tsx +++ b/src/components/shared/news/article.tsx @@ -15,7 +15,6 @@ export async function ExampleComponent(){ export default async function Article(params: { id: string|undefined, title: string|undefined, content: string|undefined, date?:string|undefined } ) { - const components = { ExampleComponent } return ( @@ -26,7 +25,7 @@ export default async function Article(params: { id: string|undefined, title: str
-
+
{params.date}

diff --git a/src/model/Models.ts b/src/model/Models.ts index e9f22eb..5d8a6f4 100644 --- a/src/model/Models.ts +++ b/src/model/Models.ts @@ -20,7 +20,7 @@ const sequelize = new Sequelize({ }); -const dbSync = (async ()=> await sequelize.sync({alter:true}))().then(()=>{ +const dbSync = (async ()=> await sequelize.sync())().then(()=>{ addUserScopes(); addUserPermsScopes(); }); diff --git a/src/model/Post.ts b/src/model/Post.ts index dd0b1e0..f1514e0 100644 --- a/src/model/Post.ts +++ b/src/model/Post.ts @@ -52,12 +52,12 @@ export class Post extends Model, InferCreationAttributes

; - @BelongsToMany(()=>Bucket,{through: {model:'PostBucket'}, throughAssociations: { + @BelongsToMany(()=>Bucket,{through: {model:'PostBucket'}, foreignKeyConstraints: false, throughAssociations: { fromSource: 'postBucketBuckets', toSource: 'post', fromTarget: 'postBucketPosts', toTarget: 'PostBucket', - }, inverse:{as: 'posts'}, foreignKey: 'postId', otherKey: 'bucketId'}) + }, inverse:{as: 'posts'}, foreignKey: {name: 'postId', unique: false}, otherKey: 'bucketId', }) declare buckets?:NonAttribute;