diff --git a/config.yaml b/config.yaml index 016f92b..c1b9959 100644 --- a/config.yaml +++ b/config.yaml @@ -229,6 +229,7 @@ views: - web/layouts/journeys/_partials/journeys-public-transit-transitous.html - web/layouts/journeys/_partials/journeys-solidarity-transport.html - web/layouts/journeys/_partials/journeys-organized-carpools.html + - web/layouts/journeys/_partials/saved-searches.html - web/layouts/journeys/search.html list: files: @@ -345,7 +346,7 @@ views: files: - web/layouts/_partials/address_autocomplete.html - web/layouts/organized_carpool/_partials/driver_availabilities.html - - web/layouts/solidarity_transport/_partials/driver_documents.html + - web/layouts/organized_carpool/_partials/driver_documents.html - web/layouts/organized_carpool/driver_display.html journey: files: diff --git a/web/layouts/beneficiaries/display.html b/web/layouts/beneficiaries/display.html index 066eb66..e46a17f 100644 --- a/web/layouts/beneficiaries/display.html +++ b/web/layouts/beneficiaries/display.html @@ -125,7 +125,7 @@
{{range .}} - {{if or (eq .Data.Deleted nil) (eq .Data.Deleted false)}} + {{if not .Deleted}}
  • diff --git a/web/layouts/journeys/_partials/journeys-organized-carpools.html b/web/layouts/journeys/_partials/journeys-organized-carpools.html index ce1a795..06b484b 100644 --- a/web/layouts/journeys/_partials/journeys-organized-carpools.html +++ b/web/layouts/journeys/_partials/journeys-organized-carpools.html @@ -24,6 +24,10 @@ class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"> Distance du covoiturage + + Profil validé +   @@ -38,8 +42,15 @@ {{ .DriverDepartureAddress }} {{ .DriverArrivalAddress }} {{ .Distance }} km + + {{if carpoolDriverValidatedProfile $driver (carpoolDocuments $driver.ID) }} + Oui + {{else}} + Non + {{end}} + - Organiser diff --git a/web/layouts/journeys/_partials/saved-searches.html b/web/layouts/journeys/_partials/saved-searches.html new file mode 100644 index 0000000..b0ec117 --- /dev/null +++ b/web/layouts/journeys/_partials/saved-searches.html @@ -0,0 +1,110 @@ +{{define "saved_searches"}} +
    +

    Recherches sauvegardées

    +
    + + {{if .ViewState.saved_searches}} +
    + + + + + + + + + + + + {{range .ViewState.saved_searches}} + + + + + + + + {{end}} + +
    + Bénéficiaire + + Départ + + Destination + + Date/Heure + + Actions +
    + {{if and .Data .Data.passenger_id}} + {{$beneficiary := index $.ViewState.beneficiaries .Data.passenger_id}} + {{if $beneficiary}} + + {{$beneficiary.Data.first_name}} {{$beneficiary.Data.last_name}} + + {{else}} + - + {{end}} + {{else}} + - + {{end}} + + {{if .Departure}} + {{if .Departure.Properties}} + {{if .Departure.Properties.city}} + {{.Departure.Properties.city}} + {{else}} + {{.Departure.Properties.label}} + {{end}} + {{else}} + - + {{end}} + {{else}} + - + {{end}} + + {{if .Destination}} + {{if .Destination.Properties}} + {{if .Destination.Properties.city}} + {{.Destination.Properties.city}} + {{else}} + {{.Destination.Properties.label}} + {{end}} + {{else}} + - + {{end}} + {{else}} + - + {{end}} + + {{if .DateTime}} + {{timeFormat .DateTime "02/01/2006 15:04"}} + {{else}} + - + {{end}} + + + Rechercher + + + Supprimer + +
    +
    + {{else}} +
    +
    + + + +

    Aucune recherche sauvegardée

    +

    Effectuez une recherche et cliquez sur "Enregistrer pour plus tard" pour commencer.

    +
    +
    + {{end}} +
    +
    +{{end}} diff --git a/web/layouts/journeys/search.html b/web/layouts/journeys/search.html index 89ea4dd..69e73a0 100644 --- a/web/layouts/journeys/search.html +++ b/web/layouts/journeys/search.html @@ -21,7 +21,30 @@

    Chercher une solution

    -
    + + +
    + +
    + + +
      + +
    +
    +
    {{ $departureField := "departure" }} {{ $departureLabel := "Départ" }} @@ -33,9 +56,7 @@ {{ $destination := .ViewState.destination }} {{ template "address_autocomplete" dict "FieldName" $destinationField "FieldLabel" $destinationLabel "Address" $destination }} - {{if ne .ViewState.passengerid "" }} - - {{end}} +
    @@ -55,11 +76,100 @@
    - +
    + + {{if .ViewState.searched}} + + Enregistrer pour plus tard + + {{end}} +
    + +
    @@ -113,6 +223,8 @@
  • + {{else}} + {{template "saved_searches" .}} {{end}} diff --git a/web/layouts/organized_carpool/_partials/driver_documents.html b/web/layouts/organized_carpool/_partials/driver_documents.html new file mode 100644 index 0000000..40f1d3b --- /dev/null +++ b/web/layouts/organized_carpool/_partials/driver_documents.html @@ -0,0 +1,137 @@ +{{define "driver_files"}} +
    + {{if eq (len .ViewState.documents) 0}} +

    Aucun document

    + {{end}} + + + {{if gt (len .ViewState.documents) 0}} + +
    + + + + + + + + + + + {{range .ViewState.documents}} + + + + + + + {{end}} + + + + +
    Type + Actions +
    +
    + {{index $.ViewState.file_types_map .Metadata.Type}} +
    +
    {{.Metadata.Name}}{{.LastModified.Format "02/01/2006"}} + + + +
    +
    + + {{end}} + +

    Ajouter un document

    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + {{.IconSet.Icon "hero:outline/folder-plus" "mx-auto h-12 w-12 text-gray-400"}} +
    + + + + +
    +

    Jusqu'à 10MB

    + +
    +
    +
    +
    + +
    + +
    +{{end}} \ No newline at end of file diff --git a/web/layouts/organized_carpool/_partials/journey_preview.html b/web/layouts/organized_carpool/_partials/journey_preview.html index 19dcfdd..526dd6f 100644 --- a/web/layouts/organized_carpool/_partials/journey_preview.html +++ b/web/layouts/organized_carpool/_partials/journey_preview.html @@ -42,6 +42,14 @@
    Prix (passager)
    0 EUR
    +
    +
    Distance passager
    +
    {{ printf "%.2f" .journey.ExtraMembers.passenger_distance }} km
    +
    +
    +
    Distance conducteur
    +
    {{ printf "%.2f" .journey.ExtraMembers.driver_distance }} km
    +
    @@ -149,6 +157,16 @@
    {{.driver.Data.file_number}}
    {{end}} +
    +
    Profil validé
    +
    + {{if carpoolDriverValidatedProfile .driver (carpoolDocuments .driver.ID) }} + Oui + {{else}} + Non + {{end}} +
    +
    @@ -269,6 +287,16 @@
    {{.passenger.Data.file_number}}
    {{end}} +
    +
    Profil validé
    +
    + {{if carpoolDriverValidatedProfile .passenger (carpoolDocuments .passenger.ID) }} + Oui + {{else}} + Non + {{end}} +
    +
    Compte mobilié (solde)
    {{if .passenger.Data.wallet}}{{ .passenger.Data.wallet }}{{else}}0{{end}} EUR
    diff --git a/web/layouts/solidarity_transport/_partials/journey_preview.html b/web/layouts/solidarity_transport/_partials/journey_preview.html index fae5e3b..cd967be 100644 --- a/web/layouts/solidarity_transport/_partials/journey_preview.html +++ b/web/layouts/solidarity_transport/_partials/journey_preview.html @@ -50,8 +50,31 @@
    Prix (passager)
    -
    {{ .driver_journey.Price.Amount }} {{ .driver_journey.Price.Currency}}
    +
    + {{if .pricing_result}} + {{ printf "%.2f" .pricing_result.passenger.Amount }} {{.pricing_result.passenger.Currency}} + {{else if .booking}} + {{ printf "%.2f" .booking.Journey.Price.Amount }} {{.booking.Journey.Price.Currency}} + {{else}} + 0.00 EUR + {{end}} +
    + {{if and .pricing_result .pricing_result.driver (gt .pricing_result.driver.Amount 0.0)}} +
    +
    Indemnité conducteur
    +
    {{ printf "%.2f" .pricing_result.driver.Amount }} {{.pricing_result.driver.Currency}}
    +
    + {{else if .booking}} + {{if .booking.DriverCompensationAmount}} + {{if gt . 0.0}} +
    +
    Indemnité conducteur
    +
    {{ printf "%.2f" . }} {{.booking.DriverCompensationCurrency}}
    +
    + {{end}} + {{end}} + {{end}}
    diff --git a/web/layouts/solidarity_transport/booking_display.html b/web/layouts/solidarity_transport/booking_display.html index cb64024..b2ae86b 100644 --- a/web/layouts/solidarity_transport/booking_display.html +++ b/web/layouts/solidarity_transport/booking_display.html @@ -3,124 +3,209 @@

    Transport solidaire

    - {{if and .ViewState.booking.Data.motivation (or (or (eq .ViewState.booking.Data.motivation "Santé") (eq .ViewState.booking.Data.motivation "Insertion")) (eq .ViewState.booking.Data.motivation "Administratif"))}}
    Trajet garanti : {{.ViewState.booking.Data.motivation}}
    {{end}} - {{ if eq .ViewState.booking.Status "WAITING_CONFIRMATION"}} -
    Attente confirmation
    - {{ else if eq .ViewState.booking.Status "VALIDATED"}} -
    Validé
    - {{ else if eq .ViewState.booking.Status "CANCELLED"}} -
    Annulé : {{.ViewState.booking.Data.reason}}
    - {{ end }} -
    + {{if and .ViewState.booking.Data.motivation (or (or (eq .ViewState.booking.Data.motivation "Santé") (eq .ViewState.booking.Data.motivation "Insertion")) (eq .ViewState.booking.Data.motivation "Administratif"))}} +
    Trajet garanti : {{.ViewState.booking.Data.motivation}}
    + {{end}} - {{$dialog := "modif"}} -
    - -
    - - - {{if eq .ViewState.booking.Status "CANCELLED" }} - - {{end}} - {{if eq .ViewState.booking.Status "WAITING_CONFIRMATION" }} - - {{end}} - {{if ne .ViewState.booking.Status "WAITING_CONFIRMATION" }} - - {{end}} - {{if ne .ViewState.booking.Status "CANCELLED" }} - -{{$dialog := "cancel"}} -
    - - -
    - {{end}} -
    -
    - {{template "journey_preview" (dict "driver_journey" .ViewState.booking.Journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries "passenger_wallet_balance" .ViewState.passenger_wallet_balance)}} +
    + +
    +
    +

    Détails du transport solidaire

    +

    Informations sur le trajet

    +
    +
    +
    + + +
    +
    Départ conducteur
    +
    + {{ .ViewState.booking.Journey.DriverDeparture.Properties.label }} +
    +
    +
    +
    Prise en charge passager
    +
    + {{ .ViewState.booking.Journey.PassengerPickup.Properties.label }} +
    +
    +
    +
    Dépose passager
    +
    + {{ .ViewState.booking.Journey.PassengerDrop.Properties.label }} +
    +
    +
    +
    Arrivée conducteur
    +
    + {{ .ViewState.booking.Journey.DriverArrival.Properties.label }} +
    +
    +
    +
    Date et heure
    +
    + {{ timeFormat .ViewState.booking.Journey.PassengerPickupDate "02/01/2006 15:04" }} +
    +
    +
    +
    Type de trajet
    +
    + {{if .ViewState.booking.Journey.Noreturn}} + Aller simple (pas de retour) + {{else}} + Aller-retour ({{.ViewState.booking.ReturnWaitingDuration | shortDuration}} d'attente estimée sur place) + {{end}} +
    +
    +
    +
    Distance passager
    +
    + {{ .ViewState.booking.Journey.PassengerDistance }} km +
    +
    +
    +
    Distance conducteur
    +
    + {{ .ViewState.booking.Journey.DriverDistance }} km +
    +
    +
    +
    Prix (passager)
    +
    + {{ printf "%.2f" .ViewState.booking.Journey.Price.Amount }} {{ .ViewState.booking.Journey.Price.Currency }} +
    +
    + {{if .ViewState.booking.DriverCompensationAmount}} + {{if gt .ViewState.booking.DriverCompensationAmount 0.0}} +
    +
    Indemnité conducteur
    +
    + {{ printf "%.2f" .ViewState.booking.DriverCompensationAmount }} {{.ViewState.booking.DriverCompensationCurrency}} +
    +
    + {{end}} + {{end}} + {{if .ViewState.booking.Data.motivation}} +
    +
    Motif
    +
    + {{ .ViewState.booking.Data.motivation }} +
    +
    + {{end}} +
    +
    +
    + + +
    +
    +
    + {{ template "journey_map" (dict "driver_journey" .ViewState.booking.Journey) }} +
    +
    +
    +
    {{ end }} diff --git a/web/layouts/solidarity_transport/driver_journey.html b/web/layouts/solidarity_transport/driver_journey.html index 510f699..5a4c3b4 100644 --- a/web/layouts/solidarity_transport/driver_journey.html +++ b/web/layouts/solidarity_transport/driver_journey.html @@ -26,11 +26,11 @@
    - {{template "journey_preview" (dict "driver_journey" .ViewState.driver_journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries "passenger_wallet_balance" .ViewState.passenger_wallet_balance)}} + {{template "journey_preview" (dict "driver_journey" .ViewState.driver_journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries "passenger_wallet_balance" .ViewState.passenger_wallet_balance "pricing_result" .ViewState.pricing_result)}} {{if ne .ViewState.passenger.ID ""}}
    {{if .ViewState.passenger}} - {{if lt .ViewState.passenger_wallet_balance .ViewState.driver_journey.Price.Amount}} + {{if lt .ViewState.passenger_wallet_balance .ViewState.pricing_result.passenger.Amount}}

    Le solde du compte mobilité est insuffisant.

    {{end}}
    diff --git a/web/layouts/vehicles/bookings-list.html b/web/layouts/vehicles/bookings-list.html index d6f9538..8958287 100644 --- a/web/layouts/vehicles/bookings-list.html +++ b/web/layouts/vehicles/bookings-list.html @@ -55,7 +55,11 @@ {{range .ViewState.bookings}} - {{if .Data.administrator_unavailability}} + {{if .Deleted}} + + Supprimé + + {{else if .Data.administrator_unavailability}} Retiré diff --git a/web/layouts/vehicles_management/_partials/bookings-list.html b/web/layouts/vehicles_management/_partials/bookings-list.html index d294fb7..5a0e3f3 100644 --- a/web/layouts/vehicles_management/_partials/bookings-list.html +++ b/web/layouts/vehicles_management/_partials/bookings-list.html @@ -39,7 +39,7 @@ Retiré - {{else if or .Deleted .Data.Deleted}} + {{else if .Deleted}} Annulé diff --git a/web/layouts/vehicles_management/booking-display.html b/web/layouts/vehicles_management/booking-display.html index 6862c90..803fef9 100644 --- a/web/layouts/vehicles_management/booking-display.html +++ b/web/layouts/vehicles_management/booking-display.html @@ -17,7 +17,7 @@ return true } }"> - {{if and (ne .ViewState.booking.Status -1) (not (or .ViewState.booking.Deleted .ViewState.booking.Data.Deleted))}} + {{if and (ne .ViewState.booking.Status -1) (not .ViewState.booking.Deleted)}}