diff --git a/config.yaml b/config.yaml index 9344cc3..aad114f 100644 --- a/config.yaml +++ b/config.yaml @@ -40,6 +40,9 @@ views: update: files: - web/layouts/members/update.html + list: + files: + - web/layouts/members/membersList.html vehicles: search: files: @@ -92,6 +95,20 @@ views: files: - web/layouts/_partials/address_autocomplete.html - web/layouts/agenda/create-event.html + delete_subscriber: + files: + - web/layouts/agenda/delete-subscriber.html + history_event: + files: + - web/layouts/agenda/history-event.html + update: + files: + - web/layouts/agenda/_partials/address.html + - web/layouts/_partials/address_autocomplete.html + - web/layouts/agenda/updateEvent.html + delete: + files: + - web/layouts/agenda/delete-event.html directory: home: files: @@ -114,8 +131,12 @@ views: - web/layouts/_partials/address_autocomplete.html display: files: + - web/layouts/_partials/address_autocomplete.html - web/layouts/journeys/display_groups.html - web/layouts/journeys/_partials/map.html + update: + files: + - web/layouts/journeys/update_groups.html support: request: files: @@ -145,7 +166,15 @@ views: - web/layouts/administration/_partials/groups_admins.html - web/layouts/administration/_partials/group_members.html - web/layouts/administration/display_group.html - group: + beneficaires_list: + files: + - web/layouts/administration/beneficaires_stats.html + events_list: + files: + - web/layouts/administration/events_stats.html + vehicles_list: + files: + - web/layouts/administration/vehicles_stats.html settings: files: - web/layouts/administration/_partials/groups_admins.html @@ -246,4 +275,9 @@ emails: files: - emails/layout.html - emails/onboarding/support_emailing.html - + delete_subscriber: + request: + subject: PARCOURSMOB - Un bénéficiaire a été retiré d'un dispositif + files: + - emails/layout.html + - emails/onboarding/delete-subscriber.html \ No newline at end of file diff --git a/emails/onboarding/delete-subscriber.html b/emails/onboarding/delete-subscriber.html new file mode 100644 index 0000000..1fc64ce --- /dev/null +++ b/emails/onboarding/delete-subscriber.html @@ -0,0 +1,7 @@ +{{define "content"}} +

+

Un bénéficiaire a été retiré d'un événement sur PARCOURSMOB par {{.user}}

+

Pour le motif suivant : {{.motif}}

+

Pour voir le bénéficiaire, cliquez sur : {{.subscriber}}

+

Pour voir l'événement, cliquez sur : {{.link}}

+{{end}} \ No newline at end of file diff --git a/web/layouts/administration/_partials/groups_admins.html b/web/layouts/administration/_partials/groups_admins.html index 2debd04..469ae40 100644 --- a/web/layouts/administration/_partials/groups_admins.html +++ b/web/layouts/administration/_partials/groups_admins.html @@ -11,7 +11,7 @@
- +

{{.Data.first_name}} {{.Data.last_name}}

{{.Data.email}}

diff --git a/web/layouts/administration/beneficaires_stats.html b/web/layouts/administration/beneficaires_stats.html new file mode 100644 index 0000000..d4eaf9c --- /dev/null +++ b/web/layouts/administration/beneficaires_stats.html @@ -0,0 +1,156 @@ +{{define "content"}} +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + +
+ Nom + + Téléphone + + Adresse + + Labels + + Modifier +
+
+ + +
+
+
+ +
+
+
+{{end}} \ No newline at end of file diff --git a/web/layouts/administration/events_stats.html b/web/layouts/administration/events_stats.html new file mode 100644 index 0000000..53bd498 --- /dev/null +++ b/web/layouts/administration/events_stats.html @@ -0,0 +1,105 @@ +{{define "content"}} + +
+
+
+

La liste des événements

+
+ +
+
+
+
+
+
+
+ + + + + + + + + + + + + {{range .ViewState.events}} + + + + + + + + + + + + {{end}} + + +
+ Dispositif + + Structure + + Lieu + + Dates + + Places disponibles + + Bénéficiaires positionnés + + Actions +
+ +
{{.Name}}
+
{{.Type}}
+
+ +
+ {{range .Owners}} + {{if (index $.ViewState.groups .)}} + {{(index $.ViewState.groups .).Data.name}} + {{end}} + {{end}} +
+
+
{{if .Data.address}}{{.Data.address.properties.label}}{{end}}
+
+
+ {{if eq .Startdate .Enddate}} + Le {{(timeFrom .Startdate).Format "02/01/2006"}} + {{else}} + Du {{(timeFrom .Startdate).Format "02/01/2006"}}
Au {{(timeFrom .Enddate).Format "02/01/2006"}} + {{end}} +
+
+ {{if ne .RemainingSubscriptions 999}} +
{{.RemainingSubscriptions}}
+ {{end}} +
+
+ {{range .Subscriptions}} + + {{end}} +
+
+ Voir +
+
+
+
+
+
+{{end}} \ No newline at end of file diff --git a/web/layouts/administration/home.html b/web/layouts/administration/home.html index 8c47e1f..f314c63 100644 --- a/web/layouts/administration/home.html +++ b/web/layouts/administration/home.html @@ -14,7 +14,7 @@
- Bénéficiaires + Bénéficiaires

{{len .ViewState.beneficiaries }} bénéficiaires

@@ -23,13 +23,13 @@
  • - {{.IconSet.Icon "hero:outline/office-building" "h-6 w-6"}} + {{.IconSet.Icon "hero:outline/calendar" "h-6 w-6"}}
    - Organisations -

    {{len .ViewState.groups}} organisations

    + Évenements +

    {{len .ViewState.events}} évenements

  • @@ -42,7 +42,7 @@
    - Référents + Référents

    {{len .ViewState.accounts}} membres

    @@ -65,8 +65,11 @@
    -

    Gestion des organisations

    - + +
    +

    Gestion des organisations

    +

    ( {{len .ViewState.groups}} organisations )

    +

    diff --git a/web/layouts/administration/vehicles_stats.html b/web/layouts/administration/vehicles_stats.html new file mode 100644 index 0000000..06432c4 --- /dev/null +++ b/web/layouts/administration/vehicles_stats.html @@ -0,0 +1,151 @@ +{{define "content"}} +
    +
    +
    +

    La liste des voitures

    +
    + +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + {{range .ViewState.vehicles}} + + + + + + + + + + + + {{end}} + +
    + Statut Réservation + + Organisation + + Numéro (Immat / Bicycode) + + Type + + Modèle + + Lieu + + Actions +
    +
    + {{if not .Bookings}} + + Disponible + + {{else if len .Bookings | eq 1}} + {{range .Bookings}} + {{if .Data.administrator_unavailability}} + + Retiré + + {{else if eq .Status -1 }} + + Disponible + + {{else if eq .Status 1 }} + + A venir + + {{else if eq .Status 0 }} + + En cours + + {{end}} + {{end}} + {{else if gt (len .Bookings) 1}} + {{range .Bookings}} + {{if .Data.administrator_unavailability}} + + Retiré + + {{else}} + {{if eq .Status 1 }} + + A venir + + {{else if eq .Status 0 }} + + En cours + + {{end}} + {{end}} + {{end}} + {{$allAvailable := true}} + {{range .Bookings}} + {{if ne .Status -1}} + {{ $allAvailable = false }} + {{break}} + {{end}} + {{end}} + {{if $allAvailable}} + + Disponible + + {{end}} + {{end}} +
    +
    +
    {{(index $.ViewState.admingroups (index .Administrators 0)).Data.name}}
    +
    +
    {{.Data.licence_plate}}
    +
    +
    + {{.Type}} + {{if eq .Type "Voiture"}} + {{ if .Data.automatic}} (boite auto){{ end }} + {{end}} +
    +
    +
    {{.Data.name}}
    +
    +
    {{if .Data.address}}{{.Data.address.properties.label}}{{end}}
    +
    + Voir +
    +
    +
    +
    +
    +
    + + +{{end}} diff --git a/web/layouts/agenda/_partials/address.html b/web/layouts/agenda/_partials/address.html new file mode 100644 index 0000000..06fc040 --- /dev/null +++ b/web/layouts/agenda/_partials/address.html @@ -0,0 +1,67 @@ +{{ define "address" }} + + +
    + + + + +
      + +
    +
    +{{ end }} \ No newline at end of file diff --git a/web/layouts/agenda/_partials/subscribers-table.html b/web/layouts/agenda/_partials/subscribers-table.html index 9eb12ed..5bd17af 100644 --- a/web/layouts/agenda/_partials/subscribers-table.html +++ b/web/layouts/agenda/_partials/subscribers-table.html @@ -17,8 +17,10 @@ + {{$evid := .ViewState.event.ID}} {{range .ViewState.event.Subscriptions}} + @@ -26,7 +28,8 @@ -
     {{.Data.subscribed_by.user.display_name}}
    + +  {{.Data.subscribed_by.user.display_name}} {{.Data.subscribed_by.group.name}} @@ -36,6 +39,13 @@ + + + + + + {{end}} diff --git a/web/layouts/agenda/delete-event.html b/web/layouts/agenda/delete-event.html new file mode 100644 index 0000000..57952bf --- /dev/null +++ b/web/layouts/agenda/delete-event.html @@ -0,0 +1,58 @@ +{{define "content"}} +{{ if eq (index .ViewState.event.Owners 0) .Group.ID }} + +
    +
    + +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +

    Vous etes sur de retirer cet événement

    +
    +
    +
    +
    + Annuler + +
    +
    +
    +
    +
    + +
    + {{else}} +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +
    +
    + + Annuler + +
    +
    +
    +
    + {{end}} +{{end}} diff --git a/web/layouts/agenda/delete-subscriber.html b/web/layouts/agenda/delete-subscriber.html new file mode 100644 index 0000000..c1e850a --- /dev/null +++ b/web/layouts/agenda/delete-subscriber.html @@ -0,0 +1,39 @@ +{{define "content"}} +
    +
    + +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +

    Voulez-vous vraiment retirer ce bénéficiaire ?

    +
    +
    + +
    + +
    +
    +
    +
    +
    + Annuler + +
    +
    +
    +
    +
    + +
    +{{end}} \ No newline at end of file diff --git a/web/layouts/agenda/display-event.html b/web/layouts/agenda/display-event.html index 787d596..9b99cc2 100644 --- a/web/layouts/agenda/display-event.html +++ b/web/layouts/agenda/display-event.html @@ -12,7 +12,26 @@ {{end}}

    + {{$gr := .Group.ID}} + {{$event := .ViewState.event.ID}}
    + {{range .ViewState.event.Owners}} + {{$id := .}} + {{if eq $gr $id}} +
    + + + + + + +
    + {{end}} + {{end}} +
    @@ -68,8 +87,13 @@ {{ if eq (index .ViewState.event.Owners 0) .Group.ID }}
    -
    + {{template "subscribers_table" .}}
    @@ -145,11 +169,22 @@

    Bénéficiaires {{.Group.Data.name}} inscrits

    diff --git a/web/layouts/agenda/history-event.html b/web/layouts/agenda/history-event.html new file mode 100644 index 0000000..823413f --- /dev/null +++ b/web/layouts/agenda/history-event.html @@ -0,0 +1,102 @@ +{{define "content"}} +{{ if eq (index .ViewState.event.Owners 0) .Group.ID }} +
    +
    +
    +
    +

    Bénéficiaires désinscrits de l'évènement {{.ViewState.event.Name}}

    +

    + {{if eq .ViewState.event.Startdate .ViewState.event.Enddate}} + Le {{(timeFrom .ViewState.event.Startdate).Format "02/01/2006"}} + {{else}} + Du {{(timeFrom .ViewState.event.Startdate).Format "02/01/2006"}} au {{(timeFrom + .ViewState.event.Enddate).Format "02/01/2006"}} + {{end}} +

    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + {{range .ViewState.event.DeletedSubscription}} + + + + + + + + {{end}} + +
    + Bénéficiaire + + Prescripteur + + Désinscrit par + + Date de suppression + + Motif +
    + +  + {{ (index $.ViewState.subscribers .Subscriber).Data.first_name }} {{ (index + $.ViewState.subscribers .Subscriber).Data.last_name }} + + +
     + {{.Data.subscribed_by.user.display_name}}
    + {{.Data.subscribed_by.group.name}} +
    +
     + {{.Data.unsubscribed_by.user.display_name}}
    + {{.Data.unsubscribed_by.group.name}} +
    + {{(timeFormat .CreatedAt "02/01/2006")}} + +
    {{.Data.motif}}
    +
    +
    +{{else}} +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +
    +
    + Annuler +
    +
    +
    +
    +{{end}} +{{end}} \ No newline at end of file diff --git a/web/layouts/agenda/home.html b/web/layouts/agenda/home.html index 9a5882a..06769e1 100644 --- a/web/layouts/agenda/home.html +++ b/web/layouts/agenda/home.html @@ -50,6 +50,7 @@ {{range .ViewState.events}} + {{if eq .Deleted false}} @@ -99,6 +100,7 @@ {{end}} + {{end}} diff --git a/web/layouts/agenda/updateEvent.html b/web/layouts/agenda/updateEvent.html new file mode 100644 index 0000000..976a58e --- /dev/null +++ b/web/layouts/agenda/updateEvent.html @@ -0,0 +1,255 @@ +{{ define "content" }} +{{ if eq (index .ViewState.event.Owners 0) .Group.ID }} + +
    +

    Modifier votre agenda

    +
    +{{$sdate := (timeFrom .ViewState.event.Startdate).Format ("2006-01-02")}} +{{$edate := (timeFrom .ViewState.event.Enddate).Format ("2006-01-02")}} +
    +
    +
    +
    +
    +

    Informations sur le dispositif

    +

    Informations générales sur le dispositif d'accompagnement à ajouter à l'agenda

    +
    +
    +
    +
    + + +
    +
    + + + + +
    +
    + +
    + + + +
    +
    + + {{ $fieldName := "address" }} + {{if .ViewState.event.Data.address}} + {{$default := .ViewState.event.Data.address}} + {{ template "address" dict "FieldName" $fieldName "Default" $default}} + {{else}} + {{ template "address_autocomplete" dict "FieldName" $fieldName}} + + + {{end}} +
    +
    +
    +
    + +
    +
    +
    +

    Planification

    +

    Dates et horaires de l'événement

    +
    +
    +
    + +
    + + Toute la journée + + +
    + +
    +
    +
    + + + +
    +
    + + +
    + + +
    +
    + +
    +
    +
    + + +
    +
    + + +
    + + +
    +
    + + +
    + +
    +
    +
    + +
    +
    +
    +

    Paramètres

    +

    Paramètres du dispositift (nombre de places disponibles, etc...)

    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + +
    +

    Certains champs de sont pas valides.

    + + + + +
    +
    +
    +{{else}} +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +
    +
    + + Annuler + +
    +
    +
    +
    +{{end}} +{{end}} \ No newline at end of file diff --git a/web/layouts/journeys/_partials/map.html b/web/layouts/journeys/_partials/map.html index 61c0f49..3b8e1ae 100644 --- a/web/layouts/journeys/_partials/map.html +++ b/web/layouts/journeys/_partials/map.html @@ -25,6 +25,11 @@ + {{range .ViewState.beneficiaries}} + {{if (index $.ViewState.groups .ID) }} + + {{end}} + {{end}}
    @@ -100,7 +105,7 @@ function errorRoute() { var br = (wwr[0]) destCoord = [r, br] map.setZoom(9); - //console.log("Ici : " [depCoord[0],depCoord[1]],[destCoord[0],destCoord[1]]) + map.fitBounds([[depCoord[0],depCoord[1]],[destCoord[0],destCoord[1]]],{padding: 40}); } @@ -115,10 +120,8 @@ function errorRoute() { if (rideDuration != null && rideDistance != null) { document.getElementById("polyline-info-content").innerHTML = "Durée : " + (Math.round(((rideDuration / 60) + Number.EPSILON) * 100) / 100) + " min
    Distance : " + rideDistance + " km"; } - // $("#polyline-str").val(polylineString); - // $("#ride-duration").val(rideDuration); - // $("#ride-distance").val(rideDistance); - console.log("rideDuration :", rideDuration, ", rideDistance ",rideDistance) + + // console.log("rideDuration :", rideDuration, ", rideDistance ",rideDistance) if(polylineCoord != null && polylineCoord.length > 0 ){ drawPolylineOnMap(polylineCoord) @@ -130,10 +133,9 @@ function createPolyline() { destination = [r, br] - console.log("origin : ", origin) if(origin != null && destination != null && origin != "" && destination != ""){ - console.log("Get polyline infos") + var hash_locs = []; hash_locs.push({ 'lat' : (origin[1]), @@ -156,17 +158,15 @@ function createPolyline() { success : retrievePolylineInfo, error: routeNotOptimized(body), }); - console.log("JSON.stringify(body)",JSON.stringify(body)) + } } var depCoord = [] var destCoord = [] + var other = [] var a, b depCoord = [a, b] - console.log("yeeesss: ", a) - ////////////////////////////// - - //mapboxgl.accessToken = 'pk.eyJ1Ijoic291a2FpbmFsYWZkaWxpIiwiYSI6ImNsYjB1djUxNjAwaWQzdm82dnJ5OXJrZzcifQ.0i8xkskwRps3W1PFwApL_Q'; + const map = new maplibregl.Map({ container: 'map', style: 'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL', @@ -175,9 +175,24 @@ function createPolyline() { }); map.addControl(new maplibregl.NavigationControl(), 'bottom-right'); var markers = [] + var pass = [] + //////////////////Code to add position in the map/////////////// + var ii = document.querySelectorAll("#passager") + for (var i = 0; i < ii.length; i++){ + var v = ii[i].value + var val = ii[i].value.split(' ') + const wl = val[0].split('[') + const wwl = val[1].split(']') + al = (wl[1]); + bl = (wwl[0]) + other = [al, bl] + {var marker = new maplibregl.Marker() + .setLngLat([al, bl])//position of passager + .addTo(map); + pass.push(marker)} + } - //destination var i = document.getElementById('de').value var words = i.split(' '); const w = words[0].split('[') @@ -185,8 +200,6 @@ function createPolyline() { a = (w[1]); b = (ww[0]) depCoord = [a, b] - console.log("yeeesss: ", depCoord[0]) - console.log(b) //arrive var ar = document.getElementById('ar').value var wordsr = ar.split(' '); @@ -195,7 +208,7 @@ function createPolyline() { var r = (wr[1]); var br = (wwr[0]) destCoord = [r, br] - console.log(br) + ///// {var marker = new maplibregl.Marker(); marker.setLngLat([a, b])//starting position @@ -205,7 +218,7 @@ function createPolyline() { center: [a, b] }); - console.log("again: ", a , b) + markers.push(marker) createPolyline() } diff --git a/web/layouts/journeys/create_groups.html b/web/layouts/journeys/create_groups.html index 433ead7..c8eb5b8 100644 --- a/web/layouts/journeys/create_groups.html +++ b/web/layouts/journeys/create_groups.html @@ -63,7 +63,7 @@
    - @@ -157,53 +157,31 @@

    Informations liés a la planification de groupe, veuillez cocher la solution qui vous convient

    -
    - - +
      Recurrent      Ponctuelle - + + - - - +
    +
    +
    + +
    + +
    - - -
    -
    -
    - -
    -
    - -
    -
    - -
    - +
    + +
    + +
    -
    diff --git a/web/layouts/journeys/display_groups.html b/web/layouts/journeys/display_groups.html index 90c2641..1a786df 100644 --- a/web/layouts/journeys/display_groups.html +++ b/web/layouts/journeys/display_groups.html @@ -1,5 +1,6 @@ {{define "content"}} -
    +
    +

    Gestion du groupe

    @@ -122,33 +123,102 @@
    + +
    + +
    +
    + +
    +

    Ajouter un passager

    + +
    + {{if gt .ViewState.group.Data.number .ViewState.number}} +
    +
    + + +
    + + + + +
      + + + + +
    +
    +
    + + {{ $departureField := "departure" }} + {{ $departureLabel := "Départ" }} + {{ $departure := .ViewState.departure }} + {{ template "address_autocomplete" dict "FieldName" $departureField "FieldLabel" $departureLabel "Address" $departure }} + + {{ $destinationField := "destination" }} + {{ $destinationLabel := "Destination" }} + {{ $destination := .ViewState.destination }} + {{ template "address_autocomplete" dict "FieldName" $destinationField "FieldLabel" $destinationLabel "Address" $destination }} + + +
    +
    + + + {{else}} +

    Vous avez atteint le nombre maximum de passagers

    + {{end}} +
    +
    + +
    + +
    +
    - - -
    + +
    @@ -156,7 +226,6 @@
    -
    @@ -172,172 +241,83 @@ Nom du bénéficiaire - Téléphone + Départ - Email + Déstination + + + - - - - - -
    - - + {{end}} + + {{end}} + +
    +
    - -
    -
    +
    +
    +
    -
    -
    -
    - -
    -

    Ajouter un passager

    -
    -
    -
    - - -
    - - - - -
      - - - - -
    -
    -
    - - - -
    -
    -
    -
    -
    diff --git a/web/layouts/journeys/group_management.html b/web/layouts/journeys/group_management.html index b316645..205a158 100644 --- a/web/layouts/journeys/group_management.html +++ b/web/layouts/journeys/group_management.html @@ -62,16 +62,7 @@
    - - - +

    @@ -99,7 +90,6 @@ -
    diff --git a/web/layouts/journeys/update_groups.html b/web/layouts/journeys/update_groups.html new file mode 100644 index 0000000..53c96d7 --- /dev/null +++ b/web/layouts/journeys/update_groups.html @@ -0,0 +1,32 @@ +{{define "content"}} +
    +
    + +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +

    Vous etes sur de retirer ce passager

    +
    +
    +
    +
    + Annuler + +
    +
    +
    +
    +
    + +
    +{{end}} \ No newline at end of file diff --git a/web/layouts/members/display.html b/web/layouts/members/display.html index 2d8d487..8e4a2e9 100644 --- a/web/layouts/members/display.html +++ b/web/layouts/members/display.html @@ -16,8 +16,6 @@
    - {{if eq .UserID .ViewState.admins.ID}} @@ -60,6 +58,13 @@
    {{.ViewState.admins.Data.last_name}}
    +
    +
    Organisations
    + {{range .ViewState.groups}} +
    {{.}} +
    + {{end}} +
    diff --git a/web/layouts/members/membersList.html b/web/layouts/members/membersList.html new file mode 100644 index 0000000..884a889 --- /dev/null +++ b/web/layouts/members/membersList.html @@ -0,0 +1,154 @@ +{{define "content"}} +
    +
    +
    +

    La listes des référents

    +
    + +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    + Nom + + Téléphone + + Email + + Organisations + + +
    +
    + + +
    +
    +
    +
    +
    +
    + +{{end}} \ No newline at end of file diff --git a/web/layouts/members/update.html b/web/layouts/members/update.html index b7b28b0..13074f2 100644 --- a/web/layouts/members/update.html +++ b/web/layouts/members/update.html @@ -1,4 +1,5 @@ {{define "content"}} +{{if eq .UserID .ViewState.ID}}

    Modifier vos informations

    @@ -17,8 +18,9 @@ first_name: ['required'], last_name: ['required'], email: ['required', 'email'], - phone_number: ['required', 'regexMatch:^((\\+)33|0)[1-9](\\d{2}){4}$'], + phone_number: ['regexMatch:^((\\+)33|0)[1-9](\\d{2}){4}$'], }, + formValidation: { valid: false, fields: { @@ -128,4 +130,26 @@
    +{{else}} +
    + +
    +
    + +
    +
    +
    + {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}} +
    +
    + +
    +
    +
    + Annuler +
    +
    +
    +
    +{{end}} {{end}} \ No newline at end of file diff --git a/web/layouts/vehicles/bookings-list.html b/web/layouts/vehicles/bookings-list.html index 4cb90c2..4f2ace9 100644 --- a/web/layouts/vehicles/bookings-list.html +++ b/web/layouts/vehicles/bookings-list.html @@ -1,6 +1,18 @@ {{define "content"}}
    -

    Réservations

    +
    +
    +

    Réservations

    +
    + +
    @@ -64,6 +76,11 @@ {{end}} {{end}} + {{if not .bookings}} + + Disponible + + {{end}}
    {{(index $.ViewState.vehicles_map .Vehicleid).Type}}
    diff --git a/web/layouts/vehicles_management/_partials/bookings-list.html b/web/layouts/vehicles_management/_partials/bookings-list.html index d2a4f98..122f9a0 100644 --- a/web/layouts/vehicles_management/_partials/bookings-list.html +++ b/web/layouts/vehicles_management/_partials/bookings-list.html @@ -34,7 +34,7 @@ {{range .ViewState.bookings}} - + {{if .Data.administrator_unavailability}} Retiré diff --git a/web/layouts/vehicles_management/_partials/vehicles-list.html b/web/layouts/vehicles_management/_partials/vehicles-list.html index f831521..c6b9759 100644 --- a/web/layouts/vehicles_management/_partials/vehicles-list.html +++ b/web/layouts/vehicles_management/_partials/vehicles-list.html @@ -7,6 +7,10 @@ + {{range .ViewState.vehicles}} +
    + Statut Réservation + Numéro (Immat / Bicycode) @@ -28,6 +32,65 @@
    +
    + {{if not .Bookings}} + + Disponible + + {{else if len .Bookings | eq 1}} + {{range .Bookings}} + {{if .Data.administrator_unavailability}} + + Retiré + + {{else if eq .Status -1 }} + + Disponible + + {{else if eq .Status 1 }} + + A venir + + {{else if eq .Status 0 }} + + En cours + + {{end}} + {{end}} + {{else if gt (len .Bookings) 1}} + {{range .Bookings}} + {{if .Data.administrator_unavailability}} + + Retiré + + {{else}} + {{if eq .Status 1 }} + + A venir + + {{else if eq .Status 0 }} + + En cours + + {{end}} + {{end}} + {{end}} + {{$allAvailable := true}} + {{range .Bookings}} + {{if ne .Status -1}} + {{ $allAvailable = false }} + {{break}} + {{end}} + {{end}} + {{if $allAvailable}} + + Disponible + + {{end}} + {{end}} +
    +
    {{.Data.licence_plate}}