change: layout and make responsive
This commit is contained in:
@@ -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>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -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"}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -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">→</span>
|
Administration <span aria-hidden="true">→</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -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">←</span> Zurück
|
<span aria-hidden="true">←</span> Zurück
|
||||||
</Link>
|
</Link>
|
||||||
@@ -78,14 +78,55 @@ 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">
|
||||||
|
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 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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 } },
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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"),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user