Compare commits

...

2 Commits

2 changed files with 20 additions and 10 deletions

View File

@@ -17,4 +17,5 @@ services:
- NODE_ENV=production - NODE_ENV=production
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-your-secret-key-generate-a-strong-random-string-at-least-32-characters} - NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-your-secret-key-generate-a-strong-random-string-at-least-32-characters}
- NEXTAUTH_URL=${NEXTAUTH_URL:-https://panel2.wastpol.pl} - NEXTAUTH_URL=${NEXTAUTH_URL:-https://panel2.wastpol.pl}
- AUTH_TRUST_HOST=true
restart: unless-stopped restart: unless-stopped

View File

@@ -34,15 +34,24 @@ const statusColors = {
approved: "bg-green-100 text-green-800", approved: "bg-green-100 text-green-800",
pending: "bg-yellow-100 text-yellow-800", pending: "bg-yellow-100 text-yellow-800",
in_progress: "bg-orange-100 text-orange-800", in_progress: "bg-orange-100 text-orange-800",
in_progress_design: "bg-purple-100 text-purple-800",
in_progress_construction: "bg-indigo-100 text-indigo-800",
fulfilled: "bg-gray-100 text-gray-800", fulfilled: "bg-gray-100 text-gray-800",
cancelled: "bg-red-100 text-red-800",
}; };
const statusTranslations = { const getStatusTranslation = (status) => {
registered: "Zarejestrowany", const translations = {
approved: "Zatwierdzony", registered: "Zarejestrowany",
pending: "Oczekujący", approved: "Zatwierdzony",
in_progress: "W trakcie", pending: "Oczekujący",
fulfilled: "Zakończony", in_progress: "W trakcie",
in_progress_design: "W realizacji (projektowanie)",
in_progress_construction: "W realizacji (realizacja)",
fulfilled: "Zakończony",
cancelled: "Wycofany",
};
return translations[status] || status;
}; };
export default function ProjectCalendarPage() { export default function ProjectCalendarPage() {
@@ -232,8 +241,8 @@ export default function ProjectCalendarPage() {
}; };
const renderUpcomingView = () => { const renderUpcomingView = () => {
const upcomingProjects = getUpcomingProjects(); const upcomingProjects = getUpcomingProjects().filter(project => project.project_status !== 'cancelled');
const overdueProjects = getOverdueProjects(); const overdueProjects = getOverdueProjects().filter(project => project.project_status !== 'cancelled');
return ( return (
<div className="space-y-6"> <div className="space-y-6">
@@ -266,7 +275,7 @@ export default function ProjectCalendarPage() {
{formatDate(project.finish_date)} {formatDate(project.finish_date)}
</div> </div>
<Badge className={statusColors[project.project_status] || statusColors.registered}> <Badge className={statusColors[project.project_status] || statusColors.registered}>
{statusTranslations[project.project_status] || project.project_status} {getStatusTranslation(project.project_status) || project.project_status}
</Badge> </Badge>
</div> </div>
</div> </div>
@@ -311,7 +320,7 @@ export default function ProjectCalendarPage() {
za {daysUntilDeadline} dni za {daysUntilDeadline} dni
</div> </div>
<Badge className={statusColors[project.project_status] || statusColors.registered}> <Badge className={statusColors[project.project_status] || statusColors.registered}>
{statusTranslations[project.project_status] || project.project_status} {getStatusTranslation(project.project_status) || project.project_status}
</Badge> </Badge>
</div> </div>
</div> </div>