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

Tunnel gaspillage alimentaire : Synthèse : afficher la date & le bouton modifier #4672

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from
Open
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
36 changes: 17 additions & 19 deletions 2024-frontend/src/components/EdibleChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,23 @@ const displayOption = ref("chart")
<div class="fr-col-md-7 fr-mb-2w">
<h3 class="fr-h6 fr-my-0">Part de comestible</h3>
</div>
<div class="fr-col fr-mb-2w">
<div class="fr-grid-row">
<DsfrSegmentedSet
name="Part de comestible"
label="Choix d'affichage"
:options="[
{
label: 'Charte',
value: 'chart',
},
{
label: 'Texte',
value: 'text',
},
]"
v-model="displayOption"
small
/>
</div>
<div class="fr-col fr-mb-2w" style="text-align: right;">
<DsfrSegmentedSet
name="Part de comestible"
label="Choix d'affichage"
:options="[
{
label: 'Charte',
value: 'chart',
},
{
label: 'Texte',
value: 'text',
},
]"
v-model="displayOption"
small
/>
</div>
</div>
<div v-if="displayOption === 'chart'" class="fr-py-2w fr-pr-8w">
Expand Down
36 changes: 17 additions & 19 deletions 2024-frontend/src/components/SourceChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,23 @@ const displayOption = ref("chart")
<div class="fr-col-md-7 fr-mb-2w">
<h3 class="fr-h6 fr-my-0">Origine du gaspillage</h3>
</div>
<div class="fr-col fr-mb-2w">
<div class="fr-grid-row">
<DsfrSegmentedSet
name="Origine du gaspillage"
label="Choix d'affichage"
:options="[
{
label: 'Charte',
value: 'chart',
},
{
label: 'Texte',
value: 'text',
},
]"
v-model="displayOption"
small
/>
</div>
<div class="fr-col fr-mb-2w" style="text-align: right;">
<DsfrSegmentedSet
name="Origine du gaspillage"
label="Choix d'affichage"
:options="[
{
label: 'Charte',
value: 'chart',
},
{
label: 'Texte',
value: 'text',
},
]"
v-model="displayOption"
small
/>
</div>
</div>
<div v-if="displayOption === 'chart'" class="fr-py-2w fr-pr-8w">
Expand Down
57 changes: 28 additions & 29 deletions 2024-frontend/src/components/WasteMeasurementSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,36 @@ const activeAccordion = ref("")

<template>
<div>
<div v-if="displayMeasurement" class="fr-grid-row">
<div v-if="displayMeasurement" class="fr-grid-row fr-grid-row--gutters">
<div class="fr-col fr-mb-4w">
<div v-if="editable" class="fr-grid-row fr-grid-row--bottom fr-mb-4w">
<div class="fr-col-12 fr-pr-4w">
<DsfrSelect v-model="chosenMeasurementIdx" label="Date de l'évaluation" :options="measurementChoices" />
</div>
</div>
<div v-else class="grey-text">
<p class="fr-mb-1w">Date de l'évaluation</p>
<p>
<b>
{{
formatDate(displayMeasurement.periodStartDate, {
month: "short",
day: "numeric",
})
}}
- {{ formatDate(displayMeasurement.periodEndDate) }}
</b>
</p>
</div>
<EmphasiseText :emphasisText="`${formatNumber(wastePerMeal)} g`" contextText="par repas" class="brown" />
<router-link v-if="editable" :to="newMeasurementRoute" class="fr-btn fr-btn--secondary fr-mt-sm-2w">
Saisir une nouvelle évaluation
</router-link>
<p v-if="editable">
<router-link :to="measurementTunnel" class="fr-btn fr-btn--secondary fr-btn--sm fr-mr-1w fr-mb-1w">
Modifier les données
</router-link>
<router-link :to="newMeasurementRoute" class="fr-btn fr-btn--primary fr-btn--sm">
Saisir une nouvelle évaluation
</router-link>
</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je propose que ce serait plus joli de les mettre sur une ligne, et faire un distinction visuel entre les deux options, selon l'hierarchie de la fréquence de les selectionner. Genre utiliser fr-btn--tertiary ou même fr-btn--tertiary-no-outline pour Modifier les données. Ou utiliser le style primaire pour saisir une nouvelle évaluation
Si ils sont trop grands, tu pourrais utiliser fr-btn--sm
Genre :

<div v-if="editable" class="fr-grid-row">
<p>...Saisir une nouvelle...</p>
<p>.<router-link... class="fr-btn fr-btn--tertiary">..Modifier les données...</p>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d'acc ! je vais déjà rebaser avec les dernières modifs sur staging, pour voir ce que ca donne avec le 2e graphique. et ensuite voir pour les mettre cote à cote 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai fait quelques ajustements, ils n'apparaissent jamais cote à cote du fait de la largeur contrainte de la col.

image

</div>
<div class="fr-col-12 fr-col-sm-4 fr-mb-4w">
<div v-if="displayMeasurement.isSortedBySource">
Expand All @@ -75,31 +99,6 @@ const activeAccordion = ref("")
</div>
<DsfrAccordionsGroup v-model="activeAccordion">
<DsfrAccordion id="waste-measurement-detail" title="Données détaillées" class="fr-my-2w">
<div v-if="editable" class="fr-grid-row fr-grid-row--bottom fr-mb-4w">
<div class="fr-col-12 fr-col-sm-6 fr-col-md-4 fr-pr-4w">
<DsfrSelect v-model="chosenMeasurementIdx" label="Date de l'évaluation" :options="measurementChoices" />
</div>
<div v-if="editable" class="fr-col-12 fr-col-sm-4">
<router-link class="fr-btn fr-btn--tertiary" :to="measurementTunnel">
<span class="fr-icon-pencil-line fr-icon--sm fr-mr-1w"></span>
Modifier les données
</router-link>
</div>
</div>
<div v-else class="grey-text">
<p class="fr-mb-1w">Date de l'évaluation</p>
<p>
<b>
{{
formatDate(displayMeasurement.periodStartDate, {
month: "short",
day: "numeric",
})
}}
- {{ formatDate(displayMeasurement.periodEndDate) }}
</b>
</p>
</div>
<MeasurementDetail :measurement="displayMeasurement" />
<router-link v-if="editable" class="fr-btn fr-btn--tertiary fr-btn--sm" :to="measurementTunnel">
<span class="fr-icon-pencil-line fr-icon--sm fr-mr-1w"></span>
Expand Down
Loading