-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add elections page #873
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
82c7296
feat: add elections page
ThibaudDauce 25afae6
small tweaks
ThibaudDauce bda9079
Update components/Elections/ElectionCard.vue
ThibaudDauce 2172256
add links
ThibaudDauce 991cda6
add noindex nofollow for now
ThibaudDauce bc8b697
Merge branch 'main' into add_elections_page
ThibaudDauce 0e6ee5f
add missing import
ThibaudDauce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <template> | ||
| <NuxtLink | ||
| :to="to" | ||
| class="flex flex-col md:flex-row gap-2.5 p-4 rounded-sm border border-gray-silver hover:border-gray-medium transition-colors bg-white bg-none" | ||
| > | ||
| <img | ||
| :src="image" | ||
| alt="" | ||
| class="w-full md:w-[225px] md:h-[130px] object-cover object-left-bottom flex-shrink-0 border border-gray-default rounded-lg" | ||
| > | ||
| <div class="flex-1"> | ||
| <h3 class="font-bold text-base leading-normal mb-2"> | ||
| {{ title }} | ||
| </h3> | ||
| <p class="font-normal text-sm leading-normal"> | ||
| {{ description }} | ||
| </p> | ||
| </div> | ||
| </NuxtLink> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| defineProps<{ | ||
| title: string | ||
| description: string | ||
| to: string | ||
| image: string | ||
| }>() | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| <template> | ||
| <div> | ||
| <OnboardingHero | ||
| color="primary" | ||
| image="/nuxt_images/elections.svg" | ||
| :image-alt="$t('Illustration élections')" | ||
| > | ||
| <template #title> | ||
| {{ $t('Les données relatives aux élections') }} | ||
| </template> | ||
| <template #subtitle> | ||
| {{ $t('Cette rubrique rassemble les principaux jeux de données par type de scrutin : municipales, législatives, présidentielles, etc.') }} | ||
| </template> | ||
| </OnboardingHero> | ||
|
|
||
| <OnboardingSection> | ||
| <div class="max-w-4xl mb-8"> | ||
| <p class="text-sm font-light leading-normal mb-4"> | ||
| {{ $t('Retrouvez l\'ensemble des données électorales publiées par l\'État et les organisations compétentes, pour vous permettre de :') }} | ||
| </p> | ||
| <ul class="list-disc pl-5 space-y-2 mb-8 text-sm font-light leading-normal"> | ||
| <li> | ||
| <strong class="font-bold">{{ $t('Analyser les tendances par type d\'élection') }}</strong>{{ $t(', pour vos projets, articles ou recherches') }} | ||
| </li> | ||
| <li> | ||
| <strong class="font-bold">{{ $t('Croiser les données électorales') }}</strong>{{ $t(' avec d\'autres jeux de données territoriales') }} | ||
| </li> | ||
| <li> | ||
| <strong class="font-bold">{{ $t('Suggérer l\'ouverture de données') }}</strong>{{ $t(' associées à des thématiques') }} | ||
| </li> | ||
| </ul> | ||
|
|
||
| <p class="text-sm font-light leading-normal"> | ||
| {{ $t('Sélectionnez un scrutin pour accéder aux jeux de données disponibles.') }} | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="space-y-4"> | ||
| <ElectionCard | ||
| v-for="election in elections" | ||
| :key="election.slug" | ||
| :title="election.title" | ||
| :description="election.description" | ||
| :to="election.to" | ||
| :image="election.image" | ||
| /> | ||
| </div> | ||
| </OnboardingSection> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import ElectionCard from '~/components/Elections/ElectionCard.vue' | ||
|
|
||
| const config = useRuntimeConfig() | ||
| const { t } = useTranslation() | ||
|
|
||
| useSeoMeta({ | ||
| title: t('Données élections - {site}', { site: config.public.title }), | ||
| robots: 'noindex, nofollow', | ||
| }) | ||
|
|
||
| const elections = [ | ||
| { | ||
| slug: 'municipales', | ||
| title: t('Données des élections municipales'), | ||
| description: t('Cette page rassemble toutes les données relatives aux élections municipales : résultats par bureau de vote, informations sur les élus et toutes les données utiles permettant de comprendre les enjeux propres aux communes.'), | ||
| to: '/posts/jeux-de-donnees-liees-aux-elections-municipales', | ||
| image: '/nuxt_images/municipales.png', | ||
| }, | ||
| { | ||
| slug: 'legislatives', | ||
| title: t('Données des élections législatives'), | ||
| description: t('Cette page rassemble l\'ensemble des données relatives aux élections législatives : résultats par circonscription, nuances politiques et toutes les données permettant de saisir les enjeux propres à la représentation des territoires à l\'Assemblée nationale.'), | ||
| to: '/posts/donnees-liees-aux-elections-legislatives', | ||
| image: '/nuxt_images/legislative.png', | ||
| }, | ||
| { | ||
| slug: 'presidentielles', | ||
| title: t('Données des élections présidentielles'), | ||
| description: t('Cette page permet d\'accéder aux différentes données des élections présidentielles : résultats par tour, séries historiques, etc., ainsi que les données pertinentes pour analyser les dynamiques politiques à l\'échelle nationale.'), | ||
| to: '/posts/donnees-liees-aux-elections-presidentielles', | ||
| image: '/nuxt_images/presidentielles.png', | ||
| }, | ||
| { | ||
| slug: 'autres', | ||
| title: t('Autres données des élections'), | ||
| description: t('Cette page rassemble les résultats des autres scrutins (élections sénatoriales, élections européennes...).'), | ||
| to: '/posts/autres-donnees-relatives-aux-elections', | ||
| image: '/nuxt_images/autres.png', | ||
| }, | ||
| ] | ||
| </script> | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.