-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: affichage du bloc "durée de la prestation" sur la fiche servic…
…e, si et seulement si les champts "volume horaire hebdomadaire" et "nombre de semaine(s)" sont renseignés
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
front/src/lib/components/specialized/services/display/service-duration.svelte
This file contains 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,26 @@ | ||
<script lang="ts"> | ||
import type { Service } from "$lib/types"; | ||
export let service: Service; | ||
$: isValid = | ||
isFinite(service.durationWeeklyHours) && | ||
service.durationWeeklyHours > 0 && | ||
isFinite(service.durationWeeks) && | ||
service.durationWeeks > 0; | ||
$: totalHours = isValid | ||
? service.durationWeeklyHours * service.durationWeeks | ||
: 0; | ||
</script> | ||
|
||
<div> | ||
{#if !isValid} | ||
<p>Données non renseignées</p> | ||
{:else} | ||
<p> | ||
Volume horaire total de {service.durationWeeklyHours} heure(s) sur {service.durationWeeks} | ||
semaine(s), soit {totalHours} heure(s) au total. | ||
</p> | ||
{/if} | ||
</div> |
This file contains 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