From e5382917cdd7e2f245385038a319ff7e71864341 Mon Sep 17 00:00:00 2001 From: soukainna Date: Tue, 17 Jan 2023 15:09:41 +0100 Subject: [PATCH] modify some style and add the update file to delete passenger --- config.yaml | 3 + web/layouts/journeys/_partials/map.html | 47 ++++-- web/layouts/journeys/create_groups.html | 58 +++---- web/layouts/journeys/display_groups.html | 172 ++++++++------------- web/layouts/journeys/group_management.html | 12 +- web/layouts/journeys/update_groups.html | 32 ++++ 6 files changed, 152 insertions(+), 172 deletions(-) create mode 100644 web/layouts/journeys/update_groups.html diff --git a/config.yaml b/config.yaml index 4fb3c52..8f107ed 100644 --- a/config.yaml +++ b/config.yaml @@ -115,6 +115,9 @@ views: - 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: 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 a9ce09c..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

@@ -124,12 +125,15 @@
+

Ajouter un passager

+
+ {{if gt .ViewState.group.Data.number .ViewState.number}}
Ajouter - + {{else}} +

Vous avez atteint le nombre maximum de passagers

+ {{end}}
+
+
- - -
+ +
@@ -237,7 +226,6 @@
-
@@ -253,107 +241,83 @@ Nom du bénéficiaire - Téléphone + Départ - Email + Déstination + + + - - - - - -
- - + {{end}} + + {{end}} + +
+
- -
-
+
+
+
-
- +
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