Skip to content

Commit

Permalink
✏️ fix elections prompt (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildmodeOne authored Jun 10, 2024
1 parent 3316732 commit 4fc25b7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 21 deletions.
3 changes: 2 additions & 1 deletion rogue-thi-app/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ NEXT_PUBLIC_GIT_URL=https://github.com/neuland-ingolstadt/THI-App
NEXT_PUBLIC_FEEDBACK_URL=mailto:[email protected]
NEXT_PUBLIC_WEBSITE_URL=https://neuland-ingolstadt.de
NEXT_PUBLIC_CTF_URL=https://neuland-ingolstadt.de/ctf-training/
NEXT_PUBLIC_DEEPL_ENDPOINT=https://api-free.deepl.com/v2/translate
NEXT_PUBLIC_DEEPL_ENDPOINT=https://api-free.deepl.com/v2/translate
NEXT_PUBLIC_ELECTION_URL=https://studverthi.de/jetzt-waehlen
6 changes: 3 additions & 3 deletions rogue-thi-app/components/allCards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import TimetableCard from './cards/TimetableCard'
import { GraduationCap, Library, Map, Scroll, User } from 'lucide-react'

import { USER_EMPLOYEE, USER_GUEST, USER_STUDENT } from '../lib/hooks/user-kind'
import EventPrompt from "./cards/EventPrompt";
import ElectionPrompt from './cards/ElectionPrompt'

export const PLATFORM_DESKTOP = 'desktop'
export const PLATFORM_MOBILE = 'mobile'
Expand All @@ -28,11 +28,11 @@ export const ALL_DASHBOARD_CARDS = [
),
},
{
key: 'votepromt2024',
key: 'election',
label: 'Jetzt wählen!',
removable: true,
default: [PLATFORM_MOBILE, USER_STUDENT, USER_EMPLOYEE, USER_GUEST],
card: () => <EventPrompt key="votepromt2024" />
card: () => <ElectionPrompt key="votepromt2024" />,
},
{
key: 'exams',
Expand Down
11 changes: 8 additions & 3 deletions rogue-thi-app/components/cards/ElectionPrompt.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Card from 'react-bootstrap/Card'

import { Vote, X } from 'lucide-react'

import { Trans, useTranslation } from 'next-i18next'
import styles from '../../styles/Home.module.css'
import { useTranslation } from 'next-i18next'

const electionUrl = process.env.NEXT_PUBLIC_ELECTION_URL

Expand All @@ -31,10 +31,15 @@ export default function ElectionPrompt({ onHide }) {
</Button>
</Card.Title>
<Card.Text>
<p>{t('election.text')}</p>
<p>
<Trans
i18nKey="election.text"
ns="dashboard"
components={{ strong: <strong />, br: <br /> }}
/>
</p>
<a
href={electionUrl}
ping="/api/election-vote-ping"
target="_blank"
rel="noreferrer"
>
Expand Down
7 changes: 4 additions & 3 deletions rogue-thi-app/components/cards/EventPrompt.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export default function EventPrompt({ onHide }) {
</Card.Title>
<Card.Text>
<p>
Stell dir vor es sind Wahlen, aber keiner geht hin? So macht Demokratie doch keinen Sinn!{' '}
<strong>Di. 11.06 bis Do. 13.06</strong> unter:{' '}
<a href='https://studverthi.de/jetzt-waehlen'>studverthi.de/jetzt-waehlen</a>
Interessierst du dich für Informatik? Die Infoveranstaltung von
Neuland Ingolstadt e.V. findet am{' '}
<strong>Di, 10.10. um 18:00 in Raum J102</strong> statt. Komm
vorbei!
</p>
</Card.Text>
</Card.Body>
Expand Down
18 changes: 11 additions & 7 deletions rogue-thi-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion rogue-thi-app/public/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"grades": "Noten & Fächer",
"personal": "Profil",
"lecturers": "Dozenten",
"exams": "Prüfungen"
"exams": "Prüfungen",
"election": "Hochschulwahlen"
},
"prompts": {
"close": "Schließen"
Expand Down
2 changes: 1 addition & 1 deletion rogue-thi-app/public/locales/de/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"election": {
"title": "Hochschulwahlen",
"text": "Aktuell finden die Hochschulwahlen statt. Deine Teilnahme ist wichtig, um die demokratischen Strukturen an unserer Hochschule zu stärken.",
"text": "Stell dir vor es sind Wahlen, aber keiner geht hin? So macht Demokratie doch keinen Sinn!<br/>Am <strong>Di. 11.06 bis Do. 13.06</strong> wählen:",
"button": "Stimme online abgeben",
"icon.close": "Schließen"
},
Expand Down
3 changes: 2 additions & 1 deletion rogue-thi-app/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"grades": "Grades & Subjects",
"personal": "Profile",
"lecturers": "Lecturers",
"exams": "Exams"
"exams": "Exams",
"election": "University Elections"
},
"prompts": {
"close": "Close"
Expand Down
2 changes: 1 addition & 1 deletion rogue-thi-app/public/locales/en/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"election": {
"title": "University Elections",
"text": "The university elections are currently taking place. Your participation is important to strengthen the democratic structures at our university.",
"text": "Imagine there are elections, but nobody goes? Democracy makes no sense like that!<br/>Vote on <strong>Tue. 11.06 to Thu. 13.06</strong>:",
"button": "Vote Online",
"icon.close": "Close"
},
Expand Down

0 comments on commit 4fc25b7

Please sign in to comment.