Compare commits

...

8 Commits

Author SHA1 Message Date
Dominik Natter
f2e4d36d0f fix: deployment 2025-03-31 14:38:13 +02:00
Dominik Natter
e645b7eabb fix: deployment 2025-03-31 14:07:57 +02:00
Dominik Natter
dbd1e098c8 fix: deployment 2025-03-31 14:02:00 +02:00
Dominik Natter
7e3ed5b8b5 fix: deployment 2025-03-31 13:53:58 +02:00
Dominik Natter
9663317a4e fix: ignore build errors and trust hosts 2025-03-27 23:41:04 +01:00
Dominik Natter
385580f4ee add: prototype section 2025-03-27 23:19:47 +01:00
Dominik Natter
c8b4ad9c87 change: layout and make responsive 2025-03-27 23:14:48 +01:00
Dominik Natter
7efd0507bb change: user permissions 2025-03-27 22:03:46 +01:00
14 changed files with 217 additions and 93 deletions

View File

@@ -1,7 +1,7 @@
# To use this Dockerfile, you have to set `output: 'standalone'` in your next.config.mjs file. # Dockerfile
# From https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile # From https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:22.12.0-alpine AS base FROM node:18-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps
@@ -48,7 +48,6 @@ ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs
# Remove this line if you do not have this folder
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public
# Set the correct permission for prerender cache # Set the correct permission for prerender cache

View File

@@ -2,42 +2,9 @@ version: '3'
services: services:
payload: payload:
image: node:18-alpine image: payload
build:
context: .
dockerfile: Dockerfile
ports: ports:
- '3000:3000' - "3000:3000"
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app/
command: sh -c "corepack enable && corepack prepare pnpm@latest --activate && pnpm install && pnpm dev"
depends_on:
- mongo
# - postgres
env_file:
- .env
# Ensure your DATABASE_URI uses 'mongo' as the hostname ie. mongodb://mongo/my-db-name
mongo:
image: mongo:latest
ports:
- '27017:27017'
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
logging:
driver: none
# Uncomment the following to use postgres
# postgres:
# restart: always
# image: postgres:latest
# volumes:
# - pgdata:/var/lib/postgresql/data
# ports:
# - "5432:5432"
volumes:
data:
# pgdata:
node_modules:

View File

@@ -3,6 +3,10 @@ import { withPayload } from '@payloadcms/next/withPayload'
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
// Your Next.js config here // Your Next.js config here
typescript: {
ignoreBuildErrors: true,
},
output: 'standalone',
} }
export default withPayload(nextConfig, { devBundleServerPackages: false }) export default withPayload(nextConfig, { devBundleServerPackages: false })

View File

@@ -15,6 +15,7 @@
"start": "cross-env NODE_OPTIONS=--no-deprecation next start" "start": "cross-env NODE_OPTIONS=--no-deprecation next start"
}, },
"dependencies": { "dependencies": {
"@libsql/linux-arm64-musl": "^0.5.3",
"@payloadcms/db-sqlite": "latest", "@payloadcms/db-sqlite": "latest",
"@payloadcms/next": "latest", "@payloadcms/next": "latest",
"@payloadcms/payload-cloud": "latest", "@payloadcms/payload-cloud": "latest",
@@ -25,7 +26,9 @@
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"csv-parser": "^3.2.0",
"graphql": "^16.8.1", "graphql": "^16.8.1",
"libsql": "^0.5.3",
"lucide-react": "^0.484.0", "lucide-react": "^0.484.0",
"next": "15.2.3", "next": "15.2.3",
"next-auth": "5.0.0-beta.25", "next-auth": "5.0.0-beta.25",
@@ -50,12 +53,12 @@
"typescript": "5.7.3" "typescript": "5.7.3"
}, },
"engines": { "engines": {
"node": "^18.20.2 || >=20.9.0", "node": "^18.20.2 || >=20.9.0"
"pnpm": "^9"
}, },
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"sharp" "sharp"
] ]
} },
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
} }

88
pnpm-lock.yaml generated
View File

@@ -8,6 +8,9 @@ importers:
.: .:
dependencies: dependencies:
'@libsql/linux-arm64-musl':
specifier: ^0.5.3
version: 0.5.3
'@payloadcms/db-sqlite': '@payloadcms/db-sqlite':
specifier: latest specifier: latest
version: 3.31.0(@types/react@19.0.12)(payload@3.31.0(graphql@16.10.0)(typescript@5.7.3))(react@19.0.0) version: 3.31.0(@types/react@19.0.12)(payload@3.31.0(graphql@16.10.0)(typescript@5.7.3))(react@19.0.0)
@@ -38,9 +41,15 @@ importers:
cross-env: cross-env:
specifier: ^7.0.3 specifier: ^7.0.3
version: 7.0.3 version: 7.0.3
csv-parser:
specifier: ^3.2.0
version: 3.2.0
graphql: graphql:
specifier: ^16.8.1 specifier: ^16.8.1
version: 16.10.0 version: 16.10.0
libsql:
specifier: ^0.5.3
version: 0.5.3
lucide-react: lucide-react:
specifier: ^0.484.0 specifier: ^0.484.0
version: 0.484.0(react@19.0.0) version: 0.484.0(react@19.0.0)
@@ -1218,11 +1227,21 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@libsql/darwin-arm64@0.5.3':
resolution: {integrity: sha512-yAitxSuiaLT465uAvqXi1TzirXb+IOxa6sfC+uIuyCzAusLEhOFlEhutqenVx93lhPkJZJIiZkK1pIETIatnfg==}
cpu: [arm64]
os: [darwin]
'@libsql/darwin-x64@0.4.7': '@libsql/darwin-x64@0.4.7':
resolution: {integrity: sha512-ezc7V75+eoyyH07BO9tIyJdqXXcRfZMbKcLCeF8+qWK5nP8wWuMcfOVywecsXGRbT99zc5eNra4NEx6z5PkSsA==} resolution: {integrity: sha512-ezc7V75+eoyyH07BO9tIyJdqXXcRfZMbKcLCeF8+qWK5nP8wWuMcfOVywecsXGRbT99zc5eNra4NEx6z5PkSsA==}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@libsql/darwin-x64@0.5.3':
resolution: {integrity: sha512-ZBVinaZcCxVoTuCTdW7vY97XIc13RjCEFG16Ix+zemtJbGFCTos7EUhkGWuWIWG/1HXYpFbXu4d5d7p6p4TlQA==}
cpu: [x64]
os: [darwin]
'@libsql/hrana-client@0.7.0': '@libsql/hrana-client@0.7.0':
resolution: {integrity: sha512-OF8fFQSkbL7vJY9rfuegK1R7sPgQ6kFMkDamiEccNUvieQ+3urzfDFI616oPl8V7T9zRmnTkSjMOImYCAVRVuw==} resolution: {integrity: sha512-OF8fFQSkbL7vJY9rfuegK1R7sPgQ6kFMkDamiEccNUvieQ+3urzfDFI616oPl8V7T9zRmnTkSjMOImYCAVRVuw==}
@@ -1238,26 +1257,51 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@libsql/linux-arm64-gnu@0.5.3':
resolution: {integrity: sha512-20qUC4O16qhGl1GPIBABgroytzLoML5hhVYrM5jaYhRHg2kFN9PytKV+M75vlyLiJk7CJwkRUxD4Xwo4OODRVg==}
cpu: [arm64]
os: [linux]
'@libsql/linux-arm64-musl@0.4.7': '@libsql/linux-arm64-musl@0.4.7':
resolution: {integrity: sha512-6kK9xAArVRlTCpWeqnNMCoXW1pe7WITI378n4NpvU5EJ0Ok3aNTIC2nRPRjhro90QcnmLL1jPcrVwO4WD1U0xw==} resolution: {integrity: sha512-6kK9xAArVRlTCpWeqnNMCoXW1pe7WITI378n4NpvU5EJ0Ok3aNTIC2nRPRjhro90QcnmLL1jPcrVwO4WD1U0xw==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@libsql/linux-arm64-musl@0.5.3':
resolution: {integrity: sha512-sv19UXkNo+J6lGSfv4tKjViqciU5MHdtcmaiyJ5BcsEouwDLp5gDbyr1iJHoQw+nWpsiNp1OO4x8JoqC6sZHkA==}
cpu: [arm64]
os: [linux]
'@libsql/linux-x64-gnu@0.4.7': '@libsql/linux-x64-gnu@0.4.7':
resolution: {integrity: sha512-CMnNRCmlWQqqzlTw6NeaZXzLWI8bydaXDke63JTUCvu8R+fj/ENsLrVBtPDlxQ0wGsYdXGlrUCH8Qi9gJep0yQ==} resolution: {integrity: sha512-CMnNRCmlWQqqzlTw6NeaZXzLWI8bydaXDke63JTUCvu8R+fj/ENsLrVBtPDlxQ0wGsYdXGlrUCH8Qi9gJep0yQ==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@libsql/linux-x64-gnu@0.5.3':
resolution: {integrity: sha512-fE/tkqGneXfMzQ5TY7ptoQXk8bRVGu6fVSmPiegCqmCcF457uO/7yqpQZyMav4viXAgmIkI15nyEo01ekaeBCg==}
cpu: [x64]
os: [linux]
'@libsql/linux-x64-musl@0.4.7': '@libsql/linux-x64-musl@0.4.7':
resolution: {integrity: sha512-nI6tpS1t6WzGAt1Kx1n1HsvtBbZ+jHn0m7ogNNT6pQHZQj7AFFTIMeDQw/i/Nt5H38np1GVRNsFe99eSIMs9XA==} resolution: {integrity: sha512-nI6tpS1t6WzGAt1Kx1n1HsvtBbZ+jHn0m7ogNNT6pQHZQj7AFFTIMeDQw/i/Nt5H38np1GVRNsFe99eSIMs9XA==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@libsql/linux-x64-musl@0.5.3':
resolution: {integrity: sha512-g/JIAmLJcsmhubfDtw5K4ipVx89Kr7V1cuoTFc/jDtBQNpfLVDOtNii3TTxvLg/yH+HRipE5Cus8hJdtysJXcw==}
cpu: [x64]
os: [linux]
'@libsql/win32-x64-msvc@0.4.7': '@libsql/win32-x64-msvc@0.4.7':
resolution: {integrity: sha512-7pJzOWzPm6oJUxml+PCDRzYQ4A1hTMHAciTAHfFK4fkbDZX33nWPVG7Y3vqdKtslcwAzwmrNDc6sXy2nwWnbiw==} resolution: {integrity: sha512-7pJzOWzPm6oJUxml+PCDRzYQ4A1hTMHAciTAHfFK4fkbDZX33nWPVG7Y3vqdKtslcwAzwmrNDc6sXy2nwWnbiw==}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@libsql/win32-x64-msvc@0.5.3':
resolution: {integrity: sha512-X7apIBRZNSSRh446NvUfq7AthUdH2OSLAAkzhOW48wCQxYheXU791WyOiroNl7s5HuIvJGAJUCR9hFLICYgWRg==}
cpu: [x64]
os: [win32]
'@monaco-editor/loader@1.5.0': '@monaco-editor/loader@1.5.0':
resolution: {integrity: sha512-hKoGSM+7aAc7eRTRjpqAZucPmoNOC4UUbknb/VNoTkEIkCPhqV8LfbsgM1webRM7S/z21eHEx9Fkwx8Z/C/+Xw==} resolution: {integrity: sha512-hKoGSM+7aAc7eRTRjpqAZucPmoNOC4UUbknb/VNoTkEIkCPhqV8LfbsgM1webRM7S/z21eHEx9Fkwx8Z/C/+Xw==}
@@ -2279,6 +2323,11 @@ packages:
csstype@3.1.3: csstype@3.1.3:
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
csv-parser@3.2.0:
resolution: {integrity: sha512-fgKbp+AJbn1h2dcAHKIdKNSSjfp43BZZykXsCjzALjKy80VXQNHPFJ6T9Afwdzoj24aMkq8GwDS7KGcDPpejrA==}
engines: {node: '>= 10'}
hasBin: true
damerau-levenshtein@1.0.8: damerau-levenshtein@1.0.8:
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
@@ -3245,6 +3294,10 @@ packages:
resolution: {integrity: sha512-T9eIRCs6b0J1SHKYIvD8+KCJMcWZ900iZyxdnSCdqxN12Z1ijzT+jY5nrk72Jw4B0HGzms2NgpryArlJqvc3Lw==} resolution: {integrity: sha512-T9eIRCs6b0J1SHKYIvD8+KCJMcWZ900iZyxdnSCdqxN12Z1ijzT+jY5nrk72Jw4B0HGzms2NgpryArlJqvc3Lw==}
os: [darwin, linux, win32] os: [darwin, linux, win32]
libsql@0.5.3:
resolution: {integrity: sha512-S3WR8WNCJV1VXraBFUKjDA6+8LcNDJMLm+83qohm1O3YM1iVqV2+/XN3SXOxpxVjuL4g/rLrjO5kzygkPefCFQ==}
os: [darwin, linux, win32]
lightningcss-darwin-arm64@1.29.2: lightningcss-darwin-arm64@1.29.2:
resolution: {integrity: sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA==} resolution: {integrity: sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA==}
engines: {node: '>= 12.0.0'} engines: {node: '>= 12.0.0'}
@@ -5886,9 +5939,15 @@ snapshots:
'@libsql/darwin-arm64@0.4.7': '@libsql/darwin-arm64@0.4.7':
optional: true optional: true
'@libsql/darwin-arm64@0.5.3':
optional: true
'@libsql/darwin-x64@0.4.7': '@libsql/darwin-x64@0.4.7':
optional: true optional: true
'@libsql/darwin-x64@0.5.3':
optional: true
'@libsql/hrana-client@0.7.0': '@libsql/hrana-client@0.7.0':
dependencies: dependencies:
'@libsql/isomorphic-fetch': 0.3.1 '@libsql/isomorphic-fetch': 0.3.1
@@ -5912,18 +5971,32 @@ snapshots:
'@libsql/linux-arm64-gnu@0.4.7': '@libsql/linux-arm64-gnu@0.4.7':
optional: true optional: true
'@libsql/linux-arm64-gnu@0.5.3':
optional: true
'@libsql/linux-arm64-musl@0.4.7': '@libsql/linux-arm64-musl@0.4.7':
optional: true optional: true
'@libsql/linux-arm64-musl@0.5.3': {}
'@libsql/linux-x64-gnu@0.4.7': '@libsql/linux-x64-gnu@0.4.7':
optional: true optional: true
'@libsql/linux-x64-gnu@0.5.3':
optional: true
'@libsql/linux-x64-musl@0.4.7': '@libsql/linux-x64-musl@0.4.7':
optional: true optional: true
'@libsql/linux-x64-musl@0.5.3':
optional: true
'@libsql/win32-x64-msvc@0.4.7': '@libsql/win32-x64-msvc@0.4.7':
optional: true optional: true
'@libsql/win32-x64-msvc@0.5.3':
optional: true
'@monaco-editor/loader@1.5.0': '@monaco-editor/loader@1.5.0':
dependencies: dependencies:
state-local: 1.0.7 state-local: 1.0.7
@@ -7204,6 +7277,8 @@ snapshots:
csstype@3.1.3: {} csstype@3.1.3: {}
csv-parser@3.2.0: {}
damerau-levenshtein@1.0.8: {} damerau-levenshtein@1.0.8: {}
data-uri-to-buffer@4.0.1: {} data-uri-to-buffer@4.0.1: {}
@@ -8266,6 +8341,19 @@ snapshots:
'@libsql/linux-x64-musl': 0.4.7 '@libsql/linux-x64-musl': 0.4.7
'@libsql/win32-x64-msvc': 0.4.7 '@libsql/win32-x64-msvc': 0.4.7
libsql@0.5.3:
dependencies:
'@neon-rs/load': 0.0.4
detect-libc: 2.0.2
optionalDependencies:
'@libsql/darwin-arm64': 0.5.3
'@libsql/darwin-x64': 0.5.3
'@libsql/linux-arm64-gnu': 0.5.3
'@libsql/linux-arm64-musl': 0.5.3
'@libsql/linux-x64-gnu': 0.5.3
'@libsql/linux-x64-musl': 0.5.3
'@libsql/win32-x64-msvc': 0.5.3
lightningcss-darwin-arm64@1.29.2: lightningcss-darwin-arm64@1.29.2:
optional: true optional: true

View File

@@ -20,17 +20,17 @@ export default function DiplomarbeitSearch() {
return ( return (
<div className="w-full flex flex-col gap-16"> <div className="w-full flex flex-col gap-16">
<div className="w-1/3 flex flex-col items-center mx-auto"> <div className="w-3/4 md:w-1/3 flex flex-col items-center mx-auto">
<h2 className="text-5xl w-auto pb-2">Diplomarbeitensuche</h2> <h2 className="text-4xl md:text-5xl w-auto pb-2">Diplomarbeitensuche</h2>
<Input type="text" value={search} placeholder="Suche" onChange={(e) => setSearch(e.target.value)} className="w-full" /> <Input type="text" value={search} placeholder="Suche" onChange={(e) => setSearch(e.target.value)} className="w-full" />
</div> </div>
<div className="flex flex-col justify-center mx-auto w-2/3"> <div className="flex flex-col justify-center mx-auto w-4/5 lg:w-2/3">
{results.map((result, index) => ( {results.map((result, index) => (
<Link key={index} href={"/diplomarbeit/" + result.id}> <Link key={index} href={"/diplomarbeit/" + result.id}>
<div key={index}> <div key={index}>
<h2 className="text-3xl">{result.title}</h2> <h2 className="text-2xl md:text-3xl">{result.title}</h2>
<h3 className="text-xl">{result.year}</h3> <h3 className="text-lg md:text-xl">{result.year}</h3>
</div> </div>
</Link> </Link>
))} ))}

View File

@@ -10,10 +10,10 @@ export default function Footer() {
return ( return (
<footer className="w-full h-20 bg-htl-red flex flex-row items-center p-2 gap-4 shadow-lg justify-between"> <footer className="w-full h-20 bg-htl-red flex flex-row items-center p-2 gap-4 shadow-lg justify-between">
<div className="w-auto flex items-center flex-row gap-4"> <div className="w-auto flex items-center flex-row gap-4">
<p className="text-xl text-white">Made with {"<3"} by</p> <p className="text-sm md:text-xl text-white">Made with {"<3"} by</p>
<a href="https://natter.li" target="_blank"> <a href="https://natter.li" target="_blank">
<Image <Image
className="h-6 w-auto" className="h-4 md:h-6 w-auto"
src={natterLogoWhite} src={natterLogoWhite}
alt={"Natter Logo"} alt={"Natter Logo"}
/> />

View File

@@ -11,16 +11,16 @@ import { Button } from '@/components/ui/button'
export default async function Header(){ export default async function Header(){
const session = await getPayloadSession(); const session = await getPayloadSession();
return ( return (
<header className="w-full h-20 flex flex-row items-center shadow-md justify-between pr-2"> <header className="w-full h-20 flex flex-row items-center shadow-md justify-between">
<div className="w-auto flex h-full bg-htl-red items-center flex-row gap-4 px-2"> <div className="w-full lg:w-auto flex h-full bg-htl-red items-center flex-row gap-4 px-2">
<Image <Image
className="h-16 w-auto rounded" className="h-16 w-auto rounded"
src={HTLDLogo} src={HTLDLogo}
alt={"HTL Dornbirn Logo"} alt={"HTL Dornbirn Logo"}
/> />
<p className="text-6xl text-white">Diplom- und Abschlussarbeiten</p> <p className="text-2xl md:text-6xl text-white">Diplom- und Abschlussarbeiten</p>
</div> </div>
<div className="w-auto"> <div className="hidden lg:block w-auto pr-2">
<Link href="/admin" className="text-sm/6 font-semibold text-gray-900"> <Link href="/admin" className="text-sm/6 font-semibold text-gray-900">
Administration <span aria-hidden="true">&rarr;</span> Administration <span aria-hidden="true">&rarr;</span>
</Link> </Link>

View File

@@ -1,33 +1,33 @@
import { getPayload } from 'payload'; import { getPayload } from "payload";
import config from '@payload-config'; import config from "@payload-config";
import Link from "next/link" import Link from "next/link";
import React from 'react' import React from "react";
const team = [ const team = [
{ {
name: 'Emma Dorsey', name: "Emma Dorsey",
role: 'Senior Developer', role: "Senior Developer",
imageUrl: imageUrl:
'https://images.unsplash.com/photo-1505840717430-882ce147ef2d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=8&w=1024&h=1024&q=80', "https://images.unsplash.com/photo-1505840717430-882ce147ef2d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=8&w=1024&h=1024&q=80",
bio: 'Praesentium iure error aliquam voluptas ut libero. Commodi placeat sit iure nulla officiis. Ut ex sit repellat tempora. Qui est accusamus exercitationem natus ut voluptas. Officiis velit eos ducimus.', bio: "Praesentium iure error aliquam voluptas ut libero. Commodi placeat sit iure nulla officiis. Ut ex sit repellat tempora. Qui est accusamus exercitationem natus ut voluptas. Officiis velit eos ducimus.",
xUrl: '#', xUrl: "#",
linkedinUrl: '#', linkedinUrl: "#",
}, },
// More people... // More people...
] ];
function Team({ people }) { function Team({ people }) {
return ( return (
<div className="bg-white py-24 md:py-32 lg:py-40"> <div className="py-24 md:py-32 lg:py-40">
<div className="mx-auto grid grid-cols-1 gap-20 px-6 lg:px-8 xl:grid-cols-3"> <div className="mx-auto grid grid-cols-1 gap-5 xl:grid-cols-3">
<div className="mx-auto max-w-2xl lg:mx-0"> <div className="max-w-2xl">
<h2 className="text-4xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl"> <h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl">
Projektteam Projektteam
</h2> </h2>
</div> </div>
<ul <ul
role="list" role="list"
className="mx-auto grid max-w-2xl grid-cols-1 gap-x-6 gap-y-20 sm:grid-cols-2 lg:mx-0 lg:max-w-none lg:gap-x-8 xl:col-span-2" className="mx-auto grid max-w-2xl grid-cols-1 gap-x-6 gap-y-20 sm:grid-cols-3 lg:mx-0 lg:gap-x-8 xl:col-span-2"
> >
{people.map((person) => ( {people.map((person) => (
<li key={person.id}> <li key={person.id}>
@@ -70,7 +70,7 @@ export default async function Page({
}); });
return ( return (
<div className="w-2/3 mx-auto pt-4"> <div className="w-4/5 md:w-2/3 mx-auto pt-4 pb-16">
<Link href="/"> <Link href="/">
<span aria-hidden="true">&larr;</span> Zurück <span aria-hidden="true">&larr;</span> Zurück
</Link> </Link>
@@ -78,14 +78,71 @@ export default async function Page({
<h4 className="text-lg text-gray-600 pt-8"> <h4 className="text-lg text-gray-600 pt-8">
Diplom- und Abschlussarbeiten ({result.year}) Diplom- und Abschlussarbeiten ({result.year})
</h4> </h4>
<h1 className="text-4xl font-semibold">{result.title}</h1> <h1 className="text-2xl md:text-4xl font-semibold">{result.title}</h1>
<Team people={result.authors} /> <Team people={result.authors} />
<h2 className="text-3xl">Zielsetzung</h2>
<p className="text-lg">{result.goal}</p> <section className="py-4">
<h2 className="text-3xl">Problemstellung</h2> <h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
<p className="text-lg">{result.issue}</p> Zielsetzung
<h2 className="text-3xl">Ergebnisse</h2> </h2>
<p className="text-lg">{result.result}</p> <p className="text-lg text-justify">{result.goal}</p>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Problemstellung
</h2>
<p className="text-lg text-justify">{result.issue}</p>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Prototyp
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<img
alt={result.prototype.description}
src={result.prototype.image.url}
className="object-fill "
/>
<div className="col-span-2">
<p className="text-lg">{result.prototype.description}</p>
</div>
</div>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Ergebnisse
</h2>
<p className="text-lg text-justify">{result.result}</p>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Technologien
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
{result.technologies.map((technology) => (
<div
key={technology.id}
className="w-full rounded-lg border border-gray-200 shadow-sm p-4 flex flex-col lg:flex-row gap-4"
>
<img
alt={technology.name + " Logo"}
src={technology.technology.url}
className="object-fill h-16"
/>
<div className="flex flex-col">
<h3 className="text-2xl">{technology.technology.name}</h3>
<p>{technology.description}</p>
</div>
</div>
))}
</div>
</section>
</div> </div>
); );
} }

View File

@@ -15,13 +15,18 @@ export async function GET(req: NextRequest) {
const response = await payload.find({ const response = await payload.find({
collection: 'papers', collection: 'papers',
where: { where: {
or: [ and: [
{ title: { contains: search } }, { published: { equals: true } },
{ issue: { contains: search } }, {
{ goal: { contains: search } }, or: [
{ 'technologies.description': { contains: search } }, { title: { contains: search } },
{ 'prototype.description': { contains: search } }, { issue: { contains: search } },
{ 'authors.description': { contains: search } }, { goal: { contains: search } },
{ 'technologies.description': { contains: search } },
{ 'prototype.description': { contains: search } },
{ 'authors.description': { contains: search } },
],
},
], ],
}, },
}); });

View File

@@ -13,4 +13,5 @@ export const authConfig: NextAuthConfig = {
}), }),
github, github,
], ],
trustHost: true,
}; };

View File

@@ -18,6 +18,7 @@ export const Media: CollectionConfig = {
create: ({ req: { user } }) => Boolean(user), create: ({ req: { user } }) => Boolean(user),
update: ({ req: { user } }) => Boolean(user && user.role === 'admin'), update: ({ req: { user } }) => Boolean(user && user.role === 'admin'),
delete: ({ req: { user } }) => Boolean(user && user.role === 'admin'), delete: ({ req: { user } }) => Boolean(user && user.role === 'admin'),
read: () => true,
}, },
fields: [ fields: [
{ {

View File

@@ -11,9 +11,10 @@ export const Papers: CollectionConfig = {
delete: ({ req: { user } }) => Boolean(user?.type === "admin"), delete: ({ req: { user } }) => Boolean(user?.type === "admin"),
read: () => true, read: () => true,
update: async ({ req: { user, payload }, id }) => { update: async ({ req: { user, payload }, id }) => {
if (!user || !id) return false; // Explicitly handle missing ID
if (user?.type === "admin") return true; if (user?.type === "admin") return true;
if (!user || !id) return false; // Explicitly handle missing ID
const paper = await payload.findByID({ const paper = await payload.findByID({
collection: "papers", collection: "papers",
@@ -22,6 +23,7 @@ export const Papers: CollectionConfig = {
}); });
if (!paper) return false; if (!paper) return false;
if(paper.published) return false;
return paper.authors.some((author: any) => author.name === user.name); return paper.authors.some((author: any) => author.name === user.name);
}, },
@@ -34,7 +36,7 @@ export const Papers: CollectionConfig = {
name: "published", name: "published",
type: "checkbox", type: "checkbox",
defaultValue: false, defaultValue: false,
label: "Veröffentlicht", label: "Veröffentlicht (Auf der Website sichtbar)",
access: { access: {
update: ({ req: { user } }) => Boolean(user?.type === "admin"), update: ({ req: { user } }) => Boolean(user?.type === "admin"),
} }

View File

@@ -11,12 +11,9 @@ export const Users: CollectionConfig = {
useAsTitle: 'email', useAsTitle: 'email',
}, },
access: { access: {
read: ({ req: { user } }) => Boolean(user),
create: ({ req: { user } }) => Boolean(user && user.type === 'admin'), create: ({ req: { user } }) => Boolean(user && user.type === 'admin'),
update: ({ req: { user } }) => { update: ({ req: { user } }) => Boolean(user && user.type === 'admin'),
if (!user) return false;
if(user.type === 'admin') return true;
return false;
},
delete: ({ req: { user } }) => Boolean(user && user.type === 'admin'), delete: ({ req: { user } }) => Boolean(user && user.type === 'admin'),
}, },
fields: [ fields: [