Skip to content

Commit

Permalink
Sort elections by date (#628)
Browse files Browse the repository at this point in the history
* Sort elections by date

* Fix translations on election page
  • Loading branch information
fgren authored Dec 8, 2024
1 parent 51738b8 commit 8130cb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/routes/(app)/elections/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import type { PageServerLoad } from "./$types";
export const load: PageServerLoad = async ({ locals }) => {
const { prisma } = locals;
const openElections = await prisma.election.findMany({
orderBy: [
{
expiresAt: "asc",
},
],
where: {
expiresAt: {
gte: new Date(),
Expand Down
4 changes: 2 additions & 2 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@
"events_cancellingAlert": "You are cancelling the event.",
"booking_boardRoomWarning": "Please note that during weekdays between 11:30-13:30, the Board always has access to the Board Room (RåsenbaD) for Board work. This means that all board members may enter and/or work in the boardroom even if the room is booked. It may be beneficial to book another time or place for conversations that may be sensitive.",
"openElections": "Open elections",
"elections_description": "Here are the application forms for all posts that are currently open for applications. The kravprofil and the post description are location on the application form page.",
"elections_close": "The elections closes at",
"elections_description": "Here are the application forms for all committees that currently have positions open for application. The requirement profiles and post descriptions are located in the application forms.",
"elections_close": "The elections close at",
"elections_apply": "Apply"
}
2 changes: 1 addition & 1 deletion src/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@
"events_cancellingAlert": "Du är på väg att ställa in eventet.",
"booking_boardRoomWarning": "Tänk på att under vardagar mellan 11:30-13:30 har styrelsen alltid tillgång till styrelserummet (RåsenbaD) för styrelsearbete. Detta betyder alltså att alla styrelsemedlemmar får gå in och/eller arbeta i styrelserummet även om rummet är bokat. Det kan vara fördelaktigt att boka en annan tid eller plats för samtal som kan vara känsliga.",
"openElections": "Öppna val",
"elections_description": "Här finns ansökningslänkar till de poster som just nu har ett öppet val. Postbeskrivningar och kravprofiler finns i Sök-formuläret.",
"elections_description": "Här finns ansökningslänkar till de utskott som just nu har öppna val. Postbeskrivningar och kravprofiler finns i ansökningsformuläret.",
"elections_close": "Valet stänger",
"elections_apply": "Ansök"
}

0 comments on commit 8130cb7

Please sign in to comment.