chore: Some minor website modification changes
All checks were successful
Remote Deploy / deploy (push) Successful in 1m5s
All checks were successful
Remote Deploy / deploy (push) Successful in 1m5s
This commit is contained in:
@@ -7,6 +7,15 @@ import { LocalData, SubstitutionData, ChangeEntry, Hour } from '@/lib/types';
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { capitalizeFirstLetter } from '@/lib/utils';
|
||||
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
interface ScheduleViewerProps {
|
||||
localData: LocalData;
|
||||
substitutionData: SubstitutionData | null;
|
||||
@@ -133,11 +142,58 @@ export default function ScheduleViewer({ localData, substitutionData, hideSubsti
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function LessonDialog({ lesson, children }: { lesson: Hour, children: React.ReactNode }) {
|
||||
return (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild className="cursor-pointer hover:bg-accent hover:text-accent-foreground transition-colors">
|
||||
{children}
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[425px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{lesson.title || lesson.subject}</DialogTitle>
|
||||
<DialogDescription>
|
||||
Detailní informace o hodině
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="grid gap-4 py-4">
|
||||
<div className="grid grid-cols-4 items-center gap-4">
|
||||
<span className="font-bold text-right col-span-1">Předmět:</span>
|
||||
<span className="col-span-3">{lesson.title} ({lesson.subject})</span>
|
||||
</div>
|
||||
<div className="grid grid-cols-4 items-center gap-4">
|
||||
<span className="font-bold text-right col-span-1">Učitel:</span>
|
||||
<a
|
||||
href={`https://spsejecna.cz/ucitel/${lesson.teacher.code}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="col-span-3 text-primary underline-offset-4 hover:underline"
|
||||
>
|
||||
{lesson.teacher.name}
|
||||
</a>
|
||||
</div>
|
||||
<div className="grid grid-cols-4 items-center gap-4">
|
||||
<span className="font-bold text-right col-span-1">Místnost:</span>
|
||||
<a
|
||||
href={`https://spsejecna.cz/ucebna/${lesson.room}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="col-span-3 text-primary underline-offset-4 hover:underline"
|
||||
>
|
||||
{lesson.room}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
|
||||
function CellContent({ staticLessons, change }: { staticLessons: Hour[], change: ChangeEntry | null | undefined }) {
|
||||
if (change) {
|
||||
return (
|
||||
<div
|
||||
className="w-full h-full p-2 text-xs flex items-center justify-center text-center font-medium shadow-sm"
|
||||
className="w-full h-full p-2 text-xs flex items-center justify-center text-center font-medium"
|
||||
style={{
|
||||
backgroundColor: change.backgroundColor || '#f0f0f0',
|
||||
color: change.foregroundColor ? "#" + change.foregroundColor.substring(3, 6) : '#000',
|
||||
@@ -156,16 +212,18 @@ function CellContent({ staticLessons, change }: { staticLessons: Hour[], change:
|
||||
return (
|
||||
<div className="flex flex-col min-h-[80px] h-full">
|
||||
{staticLessons.map((lesson, idx) => (
|
||||
<div key={idx} className="flex-1 flex flex-col justify-between p-1 text-[10px] border-b min-h-[40px]">
|
||||
<div className='flex justify-between'>
|
||||
<div className="font-bold truncate">{lesson.subject}</div>
|
||||
<span className="truncate opacity-70">{capitalizeFirstLetter(lesson.teacher.code)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="truncate max-w-[40px]">{lesson.room}</span>
|
||||
<span className="truncate opacity-70">{lesson.group}</span>
|
||||
</div>
|
||||
</div>
|
||||
<LessonDialog key={idx} lesson={lesson}>
|
||||
<div role="button" tabIndex={0} className="flex-1 flex flex-col justify-between p-1 text-[10px] border-b min-h-[40px] text-left">
|
||||
<div className='flex justify-between'>
|
||||
<div className="font-bold truncate">{lesson.subject}</div>
|
||||
<span className="truncate opacity-70">{capitalizeFirstLetter(lesson.teacher.code)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="truncate max-w-[40px]">{lesson.room}</span>
|
||||
<span className="truncate opacity-70">{lesson.group}</span>
|
||||
</div>
|
||||
</div>
|
||||
</LessonDialog>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
@@ -173,12 +231,14 @@ function CellContent({ staticLessons, change }: { staticLessons: Hour[], change:
|
||||
|
||||
const lesson = staticLessons[0];
|
||||
return (
|
||||
<div className="w-full min-h-[80px] h-full p-2 border-b flex flex-col justify-between text-xs hover:shadow-md transition-shadow">
|
||||
<div className="font-bold text-lg text-primary">{lesson.subject}</div>
|
||||
<div className="flex justify-between items-end mt-1">
|
||||
<div className="font-mono font-medium">{lesson.room}</div>
|
||||
<div className="text-[10px] opacity-80" title={lesson.teacher.name}>{capitalizeFirstLetter(lesson.teacher.code)}</div>
|
||||
<LessonDialog lesson={lesson}>
|
||||
<div role="button" tabIndex={0} className="w-full min-h-[80px] h-full p-2 border-b flex flex-col justify-between text-xs text-left">
|
||||
<div className="font-bold text-lg text-primary">{lesson.subject}</div>
|
||||
<div className="flex justify-between items-end mt-1">
|
||||
<div className="font-mono font-medium">{lesson.room}</div>
|
||||
<div className="text-[10px] opacity-80" title={lesson.teacher.name}>{capitalizeFirstLetter(lesson.teacher.code)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LessonDialog>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user