Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for EU parties #665

Merged
merged 3 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,54 @@
"name": "Österreichische Volkspartei",
"shortName": "ÖVP",
"sortName": "ÖVP",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Volkspartei",
"group": "Fraktion der Europäischen Volkspartei"
},
{
"id": "21e722ff-1943-46a3-8ce8-37702dea7d21",
"name": "Sozialdemokratische Partei Österreichs",
"shortName": "SPÖ",
"sortName": "SPÖ",
"type": "candidate-list"
"type": "candidate-list",
"party": "Sozialdemokratische Partei Europas",
"group": "Progressive Allianz der Sozialdemokraten"
},
{
"id": "0dfe30b6-ea75-4947-9f4e-9ce02e254329",
"name": "Freiheitliche Partei Österreichs",
"shortName": "FPÖ",
"sortName": "FPÖ",
"type": "candidate-list"
"type": "candidate-list",
"party": "Identität und Demokratie Partei",
"group": "Identität und Demokratie"
},
{
"id": "767c85bc-e9d8-41b5-ab3e-4187bbfe5e32",
"name": "Die Grünen – Grüne Alternative",
"shortName": "GRÜNE",
"sortName": "GRÜNE",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Grüne Partei",
"group": "Die Grünen/Europäische Freie Allianz"
},
{
"id": "d2b8ecd7-61bd-4b5e-902c-898109678582",
"name": "NEOS – Das Neue Österreich und Liberales Forum",
"shortName": "NEOS",
"sortName": "NEOS",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Allianz der Liberalen und Demokraten für Europa",
"group": "Renew Europe"
},
{
"id": "04d64b65-f34c-4b0d-9935-dd43d202091e",
"name": "Kommunistische Partei Österreichs",
"shortName": "KPÖ",
"sortName": "KPÖ",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Linke",
"group": "Die Linke im Europäischen Parlament"
},
{
"id": "2c4a8ad9-27ac-43a9-a81d-3078ebaf6037",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,54 @@
"name": "Österreichische Volkspartei",
"shortName": "ÖVP",
"sortName": "ÖVP",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Volkspartei",
"group": "Fraktion der Europäischen Volkspartei"
},
{
"id": "21e722ff-1943-46a3-8ce8-37702dea7d21",
"name": "Sozialdemokratische Partei Österreichs",
"shortName": "SPÖ",
"sortName": "SPÖ",
"type": "candidate-list"
"type": "candidate-list",
"party": "Sozialdemokratische Partei Europas",
"group": "Progressive Allianz der Sozialdemokraten"
},
{
"id": "0dfe30b6-ea75-4947-9f4e-9ce02e254329",
"name": "Freiheitliche Partei Österreichs",
"shortName": "FPÖ",
"sortName": "FPÖ",
"type": "candidate-list"
"type": "candidate-list",
"party": "Identität und Demokratie Partei",
"group": "Identität und Demokratie"
},
{
"id": "767c85bc-e9d8-41b5-ab3e-4187bbfe5e32",
"name": "Die Grünen – Grüne Alternative",
"shortName": "GRÜNE",
"sortName": "GRÜNE",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Grüne Partei",
"group": "Die Grünen/Europäische Freie Allianz"
},
{
"id": "d2b8ecd7-61bd-4b5e-902c-898109678582",
"name": "NEOS – Das Neue Österreich und Liberales Forum",
"shortName": "NEOS",
"sortName": "NEOS",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Allianz der Liberalen und Demokraten für Europa",
"group": "Renew Europe"
},
{
"id": "04d64b65-f34c-4b0d-9935-dd43d202091e",
"name": "Kommunistische Partei Österreichs",
"shortName": "KPÖ",
"sortName": "KPÖ",
"type": "candidate-list"
"type": "candidate-list",
"party": "Europäische Linke",
"group": "Die Linke im Europäischen Parlament"
},
{
"id": "2c4a8ad9-27ac-43a9-a81d-3078ebaf6037",
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/common/dataFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
deprecatedCalculator.district_code = calculator.variant.key;
deprecatedCalculator.show_district_code = false;
deprecatedCalculator.name = 'Europawahl 2024';
deprecatedCalculator.description =

Check warning on line 26 in frontend/src/common/dataFetch.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

Delete `⏎···`
'Die Europawahl in Österreich 2024';
deprecatedCalculator.intro = calculator.intro;
deprecatedCalculator.election = {
id: '3c13c7f4-8df7-4fa0-80c4-53895942fbc0',
key: 'europawahl-2024',
name: 'Europawahl 2024',
description:

Check warning on line 33 in frontend/src/common/dataFetch.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

Delete `⏎·····`
'Die Europawahl in Österreich 2024',
};

Expand Down Expand Up @@ -114,6 +114,9 @@
transformedCandidate.type = organization.type || 'party';
transformedCandidate.short_name = organization.shortName;
transformedCandidate.motto = candidate.motto;
transformedCandidate.party = organization.party;
transformedCandidate.group = organization.group;

if (candidate.images) {
transformedCandidate.img_url = `/data/instance/wahlrechner.at/${key}/images/candidates/${candidate.id}.webp`;
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@
"result": {
"ResultCandidateCard": {
"display-details": "Details anzeigen",
"what-candidate-say": "Was sagen die Kandidaten über sich selbst?"
"what-candidate-say": "Was sagen die Kandidaten über sich selbst?",
"eu-party": "Europäische Partei",
"eu-group": "Europäische Gruppe"
},
"ResultCardContacts": {
"contacts": "Kontakte"
Expand Down
21 changes: 19 additions & 2 deletions frontend/src/routes/result/ResultCandidateCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const toggleClick = () => {
>
{{ result }} %
</TitleText>
<div v-if="candidate?.motto" class="toggle">
<div v-if="candidate?.motto || candidate?.party || candidate?.group" class="toggle">
<IconButton @click="toggleClick">
<IconComponent
:icon="isExpanded ? mdiChevronUp : mdiChevronDown"
Expand All @@ -194,7 +194,7 @@ const toggleClick = () => {
</IconButton>
</div>
<div
v-if="candidate?.motto || candidate?.contact"
v-if="candidate?.motto || candidate?.contact || candidate?.party || candidate?.group"
v-show="isExpanded"
class="expansion"
>
Expand All @@ -210,6 +210,23 @@ const toggleClick = () => {
<DividerComponent class="divider"></DividerComponent>
<ResultCardContacts :contact="candidate?.contact"></ResultCardContacts>
</div>
<div v-if="candidate?.party">
<BodyText class="motto-title" size="small"
><strong>{{
$t('routes.result.ResultCandidateCard.eu-party')
}}</strong></BodyText
>
<BodyText size="small">{{ candidate?.party }}</BodyText>
</div>
<DividerComponent v-if="candidate?.party && candidate?.group" class="divider" />
<div v-if="candidate?.group">
<BodyText class="motto-title" size="small"
><strong>{{
$t('routes.result.ResultCandidateCard.eu-group')
}}</strong></BodyText
>
<BodyText size="small">{{ candidate?.group }}</BodyText>
</div>
</div>
</CardComponent>
</template>
Expand Down
Loading