Solidarity transport implementation
This commit is contained in:
		
							parent
							
								
									82773f090b
								
							
						
					
					
						commit
						0cc1c1451c
					
				
							
								
								
									
										51
									
								
								config.yaml
								
								
								
								
							
							
						
						
									
										51
									
								
								config.yaml
								
								
								
								
							| 
						 | 
				
			
			@ -1,5 +1,43 @@
 | 
			
		|||
name: PARCOURSMOB
 | 
			
		||||
 | 
			
		||||
menu_items:
 | 
			
		||||
  - name: dashboard
 | 
			
		||||
    title: Tableau de bord
 | 
			
		||||
    link: /app/
 | 
			
		||||
    icon: hero:outline/home
 | 
			
		||||
  - name: beneficiaries
 | 
			
		||||
    title: Bénéficiaires
 | 
			
		||||
    link: /app/beneficiaries/
 | 
			
		||||
    icon: hero:outline/user-group
 | 
			
		||||
  - name: journeys
 | 
			
		||||
    title: Déplacements
 | 
			
		||||
    link: /app/journeys/
 | 
			
		||||
    icon: hero:outline/map
 | 
			
		||||
  - name: solidarity_transport
 | 
			
		||||
    title: Transport solidaire
 | 
			
		||||
    link: /app/solidarity-transport/
 | 
			
		||||
    icon: tabler-icons:car
 | 
			
		||||
  - name: vehicles
 | 
			
		||||
    title: Véhicules partagés
 | 
			
		||||
    link: /app/vehicles/
 | 
			
		||||
    icon: tabler-icons:car
 | 
			
		||||
  - name: vehicles_management
 | 
			
		||||
    title: Gestion des véhicules
 | 
			
		||||
    link: /app/vehicles-management/
 | 
			
		||||
    icon: hero:outline/briefcase
 | 
			
		||||
  - name: agenda
 | 
			
		||||
    title: Agenda dispositifs
 | 
			
		||||
    link: /app/agenda/
 | 
			
		||||
    icon: hero:outline/calendar
 | 
			
		||||
  - name: directory
 | 
			
		||||
    title: Répertoire solutions
 | 
			
		||||
    link: /app/directory/
 | 
			
		||||
    icon: hero:outline/document-text
 | 
			
		||||
  - name: support
 | 
			
		||||
    title: Support
 | 
			
		||||
    link: /app/support/
 | 
			
		||||
    icon: hero:outline/support
 | 
			
		||||
 | 
			
		||||
views:
 | 
			
		||||
  generic:
 | 
			
		||||
    files:
 | 
			
		||||
| 
						 | 
				
			
			@ -30,6 +68,7 @@ views:
 | 
			
		|||
        - web/layouts/beneficiaries/_partials/beneficiary-files.html
 | 
			
		||||
        - web/layouts/beneficiaries/_partials/beneficiary-organizations.html
 | 
			
		||||
        - web/layouts/beneficiaries/_partials/beneficiary-diags.html
 | 
			
		||||
        - web/layouts/beneficiaries/_partials/beneficiary-wallet.html
 | 
			
		||||
        - web/layouts/beneficiaries/display.html
 | 
			
		||||
    create_diag:
 | 
			
		||||
      files:
 | 
			
		||||
| 
						 | 
				
			
			@ -147,7 +186,7 @@ views:
 | 
			
		|||
  journeys:
 | 
			
		||||
    search:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/_partials/address_autocomplete.html
 | 
			
		||||
        - web/layouts/_partials/orb_address_autocomplete.html
 | 
			
		||||
        - web/layouts/journeys/_partials/journeys-all.html
 | 
			
		||||
        - web/layouts/journeys/_partials/journeys-others.html
 | 
			
		||||
        - web/layouts/journeys/_partials/journeys-carpool.html
 | 
			
		||||
| 
						 | 
				
			
			@ -207,6 +246,7 @@ views:
 | 
			
		|||
    overview:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/solidarity_transport/_partials/drivers_list.html
 | 
			
		||||
        - web/layouts/solidarity_transport/_partials/bookings_list.html
 | 
			
		||||
        - web/layouts/solidarity_transport/overview.html
 | 
			
		||||
    driver_create:
 | 
			
		||||
      files:
 | 
			
		||||
| 
						 | 
				
			
			@ -214,9 +254,18 @@ views:
 | 
			
		|||
        - web/layouts/solidarity_transport/driver_create.html
 | 
			
		||||
    driver_display:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/_partials/address_autocomplete.html
 | 
			
		||||
        - web/layouts/solidarity_transport/_partials/driver_availabilities.html
 | 
			
		||||
        - web/layouts/solidarity_transport/_partials/driver_documents.html
 | 
			
		||||
        - web/layouts/solidarity_transport/driver_display.html
 | 
			
		||||
    driver_journey:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/solidarity_transport/_partials/journey_preview.html
 | 
			
		||||
        - web/layouts/solidarity_transport/driver_journey.html
 | 
			
		||||
    booking_display:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/solidarity_transport/_partials/journey_preview.html
 | 
			
		||||
        - web/layouts/solidarity_transport/booking_display.html
 | 
			
		||||
 | 
			
		||||
  administration:
 | 
			
		||||
    home:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,4 +25,7 @@
 | 
			
		|||
    html {
 | 
			
		||||
        font-family: Bitter, serif; 
 | 
			
		||||
    }
 | 
			
		||||
    input {
 | 
			
		||||
      padding: 2px;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,10 @@
 | 
			
		|||
import '@kingshott/iodine';
 | 
			
		||||
import Alpine from 'alpinejs'
 | 
			
		||||
import { Protocol } from "pmtiles";
 | 
			
		||||
 
 | 
			
		||||
window.Alpine = Alpine
 | 
			
		||||
 
 | 
			
		||||
Alpine.start()
 | 
			
		||||
Alpine.start()
 | 
			
		||||
 | 
			
		||||
let protocol = new Protocol();
 | 
			
		||||
maplibregl.addProtocol("pmtiles",protocol.tile);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,13 +1,12 @@
 | 
			
		|||
{{ define "address_autocomplete" }}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="col-span-6 relative" x-data="{
 | 
			
		||||
    input: {{if .Address}}'{{.Address.Properties.label}}'{{else}}null{{end}},
 | 
			
		||||
    address: {{if .Address}}JSON.stringify({{printf "%s" .Address.MarshalJSON}}){{else}}null{{end}},
 | 
			
		||||
    addressObject: {{if .Address}}{{printf "%s" .Address.MarshalJSON}}{{else}}null{{end}},
 | 
			
		||||
<div class="col-span-6 relative" x-data='{
 | 
			
		||||
    input: {{if .Address}}"{{.Address.properties.label}}"{{else}}null{{end}},
 | 
			
		||||
    address: {{if .Address}}JSON.stringify({{template "geojson" .Address}}){{else}}null{{end}},
 | 
			
		||||
    addressObject: {{if .Address}}{{template "geojson" .Address }}{{else}}null{{end}},
 | 
			
		||||
    responselength: 0,
 | 
			
		||||
    async autocomplete() {
 | 
			
		||||
        if(this.input == null || this.input == '') {
 | 
			
		||||
        if(this.input == null || this.input == "") {
 | 
			
		||||
            this.responselength = 0
 | 
			
		||||
            return []
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -15,22 +14,22 @@
 | 
			
		|||
            this.responselength = 0
 | 
			
		||||
            return []
 | 
			
		||||
        }
 | 
			
		||||
        result = await fetch('https://api.geocode.earth/v1/autocomplete/\?api_key=ge-4949288cd450ad31&text=' + this.input)
 | 
			
		||||
        result = await fetch("https://api.geocode.earth/v1/autocomplete/\?api_key=ge-4949288cd450ad31&text=" + this.input)
 | 
			
		||||
        json = await result.json()
 | 
			
		||||
 | 
			
		||||
        this.responselength = json['features'].length
 | 
			
		||||
        return json['features']
 | 
			
		||||
        this.responselength = json["features"].length
 | 
			
		||||
        return json["features"]
 | 
			
		||||
    },
 | 
			
		||||
    select(a) {
 | 
			
		||||
        this.address = JSON.stringify(a)
 | 
			
		||||
        this.addressObject = a
 | 
			
		||||
        this.input = a.properties.label
 | 
			
		||||
    }
 | 
			
		||||
}">
 | 
			
		||||
}'>
 | 
			
		||||
    <input type="hidden" name="{{ .FieldName }}" x-model="address">
 | 
			
		||||
    <label for="address" class="block text-sm font-medium text-gray-700">{{ if .FieldLabel }}{{.FieldLabel}}{{else}}Adresse{{end}}</label>
 | 
			
		||||
    <input type="text" 
 | 
			
		||||
        class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"
 | 
			
		||||
        class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"
 | 
			
		||||
        x-model="input">
 | 
			
		||||
 | 
			
		||||
    <ul x-show="responselength > 0"
 | 
			
		||||
| 
						 | 
				
			
			@ -46,3 +45,14 @@
 | 
			
		|||
    </ul>
 | 
			
		||||
</div>
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
{{define "geojson"}}{
 | 
			
		||||
  "type": "Feature",
 | 
			
		||||
  "geometry": {
 | 
			
		||||
    "type": "Point",
 | 
			
		||||
    "coordinates": [{{index .geometry.coordinates 0}}, {{index .geometry.coordinates 1}}],
 | 
			
		||||
  },
 | 
			
		||||
  "properties": {
 | 
			
		||||
    "label": "{{.properties.label}}"
 | 
			
		||||
  }
 | 
			
		||||
}{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,19 +1,20 @@
 | 
			
		|||
{{define "mainmenu"}}
 | 
			
		||||
 | 
			
		||||
{{range .LayoutState.MenuItems}}
 | 
			
		||||
{{range .LayoutState.Menu}}
 | 
			
		||||
{{if moduleAvailable .name }}
 | 
			
		||||
<nav class="px-2 space-y-1">
 | 
			
		||||
    <a href="{{.Link}}"
 | 
			
		||||
        {{ if .Active }}
 | 
			
		||||
    <a href="{{.link}}"
 | 
			
		||||
        {{ if eq .name $.LayoutState.ActiveMenu }}
 | 
			
		||||
        class="bg-white text-co-blue group flex items-center px-2 py-2 text-base font-medium rounded-2xl">
 | 
			
		||||
        {{ else}}
 | 
			
		||||
        class="text-white hover:bg-white hover:bg-opacity-5 hover:text-co-blue group flex items-center px-2 py-2 text-base font-medium rounded-2xl">
 | 
			
		||||
        {{end}}
 | 
			
		||||
 | 
			
		||||
        {{$.IconSet.Icon .Icon "mr-4 flex-shrink-0 h-6 w-6"}}
 | 
			
		||||
        {{$.IconSet.Icon .icon "mr-4 flex-shrink-0 h-6 w-6"}}
 | 
			
		||||
        
 | 
			
		||||
        {{.Title}}
 | 
			
		||||
        {{.title}}
 | 
			
		||||
    </a>
 | 
			
		||||
</nav>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,59 @@
 | 
			
		|||
 | 
			
		||||
{{ define "address_autocomplete" }}
 | 
			
		||||
 | 
			
		||||
<div class="col-span-6 relative" x-data='{
 | 
			
		||||
    input: {{if .Address}}"{{.Address.Properties.label}}"{{else}}null{{end}},
 | 
			
		||||
    address: {{if .Address}}JSON.stringify({{template "geojson" .Address}}){{else}}null{{end}},
 | 
			
		||||
    addressObject: {{if .Address}}{{template "geojson" .Address }}{{else}}null{{end}},
 | 
			
		||||
    responselength: 0,
 | 
			
		||||
    async autocomplete() {
 | 
			
		||||
        if(this.input == null || this.input == "") {
 | 
			
		||||
            this.responselength = 0
 | 
			
		||||
            return []
 | 
			
		||||
        }
 | 
			
		||||
        if(this.addressObject != null && this.input == this.addressObject.properties.label) {
 | 
			
		||||
            this.responselength = 0
 | 
			
		||||
            return []
 | 
			
		||||
        }
 | 
			
		||||
        result = await fetch("https://api.geocode.earth/v1/autocomplete/\?api_key=ge-4949288cd450ad31&text=" + this.input)
 | 
			
		||||
        json = await result.json()
 | 
			
		||||
 | 
			
		||||
        this.responselength = json["features"].length
 | 
			
		||||
        return json["features"]
 | 
			
		||||
    },
 | 
			
		||||
    select(a) {
 | 
			
		||||
        this.address = JSON.stringify(a)
 | 
			
		||||
        this.addressObject = a
 | 
			
		||||
        this.input = a.properties.label
 | 
			
		||||
    }
 | 
			
		||||
}'>
 | 
			
		||||
    <input type="hidden" name="{{ .FieldName }}" x-model="address">
 | 
			
		||||
    <label for="address" class="block text-sm font-medium text-gray-700">{{ if .FieldLabel }}{{.FieldLabel}}{{else}}Adresse{{end}}</label>
 | 
			
		||||
    <input type="text" 
 | 
			
		||||
        class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"
 | 
			
		||||
        x-model="input">
 | 
			
		||||
 | 
			
		||||
    <ul x-show="responselength > 0"
 | 
			
		||||
    class="absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-xl py-1 text-base overflow-auto focus:outline-none sm:text-sm" tabindex="-1" role="listbox" aria-labelledby="listbox-label" aria-activedescendant="listbox-option-3">
 | 
			
		||||
        <template x-for="item in autocomplete">
 | 
			
		||||
            <a href="#">
 | 
			
		||||
                <li class="text-gray-900 hover:bg-gray-200 cursor-default select-none relative py-2 pl-3 pr-9" 
 | 
			
		||||
                    @click="select(item)">
 | 
			
		||||
                    <span class="font-normal block truncate" x-text="item.properties.label" ></span>
 | 
			
		||||
                </li>
 | 
			
		||||
            </a>
 | 
			
		||||
        </template>
 | 
			
		||||
    </ul>
 | 
			
		||||
</div>
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
{{define "geojson"}}{
 | 
			
		||||
  "type": "Feature",
 | 
			
		||||
  "geometry": {
 | 
			
		||||
    "type": "Point",
 | 
			
		||||
    "coordinates": [{{index .Point 0}}, {{index .Point 1}}],
 | 
			
		||||
  },
 | 
			
		||||
  "properties": {
 | 
			
		||||
    "label": "{{.Properties.label}}"
 | 
			
		||||
  }
 | 
			
		||||
}{{end}}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,46 @@
 | 
			
		|||
{{define "beneficiary_wallet"}}
 | 
			
		||||
<div class="px-4 py-6 sm:px-6 text-center"
 | 
			
		||||
  x-data="{
 | 
			
		||||
    walletdialog: false
 | 
			
		||||
  }">
 | 
			
		||||
  <div class="px-4 py-5 sm:px-6">
 | 
			
		||||
    <p class="text-center text-lg">Solde : {{if .ViewState.beneficiary.Data.wallet}}{{ .ViewState.beneficiary.Data.wallet }}{{else}}0{{end}} €</p>
 | 
			
		||||
  <button  @click="walletdialog = !walletdialog" 
 | 
			
		||||
    class="rounded-2xl border border-transparent bg-co-blue px-4 py-2 my-4 mt-8 w-full text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
 | 
			
		||||
    Créditer le compte
 | 
			
		||||
  </button>
 | 
			
		||||
  <div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"
 | 
			
		||||
       x-show="walletdialog">
 | 
			
		||||
    <div class="fixed inset-0 bg-gray-900 opacity-30 transition-opacity"></div>
 | 
			
		||||
                                
 | 
			
		||||
    <div class="fixed inset-0 z-10 overflow-y-auto">
 | 
			
		||||
      <div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
 | 
			
		||||
        <div class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-sm sm:p-6">
 | 
			
		||||
          <div>
 | 
			
		||||
            <div class="mt-3 text-center sm:mt-5">
 | 
			
		||||
              <h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title">Créditer le compte</h3>
 | 
			
		||||
                <div class="mt-2">
 | 
			
		||||
                  <p class="text-sm text-gray-500">Créditer le compte mobilité de l'utilisateur</p>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          <form method="POST" action="/app/wallets/{{.ViewState.beneficiary.ID}}/credit" class="my-4">
 | 
			
		||||
              <div class="my-8">
 | 
			
		||||
                <input type="number" id="amount" name="amount" value="0"
 | 
			
		||||
                       class="w-full shadow-sm focus:ring-co-blue focus:border-co-blue px-2 p-1 sm:text-sm border-gray-300 rounded-2xl">
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="mt-5 sm:mt-6">
 | 
			
		||||
                <button type="submit" class="inline-flex w-full justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:text-sm">Ajouter</button>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="mt-5 sm:mt-6">
 | 
			
		||||
                <button @click="walletdialog=false" type="button" class="inline-flex w-full justify-center max-w-xs bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
 | 
			
		||||
              </div>
 | 
			
		||||
            </form>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			@ -133,6 +133,11 @@
 | 
			
		|||
                                        :class="tab == 'documents' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
 | 
			
		||||
                                        Documents </a>
 | 
			
		||||
 | 
			
		||||
                                        <a href="#" @click="tab = 'wallet'"
 | 
			
		||||
                                        class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
 | 
			
		||||
                                        :class="tab == 'wallet' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
 | 
			
		||||
                                        Compte mobilité </a>
 | 
			
		||||
 | 
			
		||||
                                        <a href="#" @click="tab = 'organizations'"
 | 
			
		||||
                                            class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
 | 
			
		||||
                                            :class="tab == 'organizations' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
 | 
			
		||||
| 
						 | 
				
			
			@ -149,6 +154,7 @@
 | 
			
		|||
 | 
			
		||||
                        <div x-show="tab == 'documents'">{{template "beneficiary_files" .}}</div>
 | 
			
		||||
                        <div x-show="tab == 'notes'">{{template "beneficiary_notes" .}}</div>
 | 
			
		||||
                        <div x-show="tab == 'wallet'">{{template "beneficiary_wallet" .}}</div>
 | 
			
		||||
                        <div x-show="tab == 'organizations'">{{template "beneficiary_organizations" .}}</div>
 | 
			
		||||
                        <!--<div x-show="tab == 'diags'">{{template "beneficiary_diags" .}}</div>-->
 | 
			
		||||
                    </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,9 +69,15 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
      {{template "beneficiaries_widget" .ViewState.beneficiaries}}
 | 
			
		||||
      {{template "agenda_widget" .ViewState.events}}
 | 
			
		||||
      {{template "bookings_widget" .ViewState.fleets}}
 | 
			
		||||
 | 
			
		||||
      {{if moduleAvailable "agenda"}}
 | 
			
		||||
        {{template "agenda_widget" .ViewState.events}}
 | 
			
		||||
      {{end}}
 | 
			
		||||
 | 
			
		||||
      {{if moduleAvailable "vehicles_management"}}
 | 
			
		||||
        {{template "bookings_widget" .ViewState.fleets}}
 | 
			
		||||
      {{end}}
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,7 +53,7 @@
 | 
			
		|||
 | 
			
		||||
    {{end}}
 | 
			
		||||
 | 
			
		||||
    {{ if gt (len .ViewState.journeys.Journeys) 0}}
 | 
			
		||||
    {{ if and .ViewState.journeys (gt (len .ViewState.journeys.Journeys) 0)}}
 | 
			
		||||
    <div class="px-4 pt-4 flex text-sm text-grey-900 font-bold border-t-2">
 | 
			
		||||
        <div class="flex-1">
 | 
			
		||||
            {{.IconSet.Icon "tabler-icons:bus" "h-6 w-6 inline-flex mr-4"}}
 | 
			
		||||
| 
						 | 
				
			
			@ -101,33 +101,10 @@
 | 
			
		|||
    <div class="p-4 text-center">
 | 
			
		||||
        <a href="/app/vehicles/"><button class="text-md px-4 py-1 bg-gray-200 text-co-blue rounded-xl">Réserver un véhicule</button></a>
 | 
			
		||||
    </div>-->
 | 
			
		||||
 | 
			
		||||
<h3 class="p-4 text-lg">Transport solidaire</h3>
 | 
			
		||||
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
 | 
			
		||||
  <thead class="bg-gray-50">
 | 
			
		||||
    <tr>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Conducteurs disponibles
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
           
 | 
			
		||||
      </th>
 | 
			
		||||
    </tr>
 | 
			
		||||
  </thead>
 | 
			
		||||
  <tbody class="divide-y divide-gray-200 bg-white">
 | 
			
		||||
    {{ range .ViewState.solidarity_drivers }}
 | 
			
		||||
    <tr>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.first_name }} {{ .Data.last_name }}</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <a class="text-co-blue hover:text-co-blue" 
 | 
			
		||||
          href="/app/solidarity-transport/drivers/{{.ID}}/match">
 | 
			
		||||
          Organiser le transport solidaire
 | 
			
		||||
        </a>
 | 
			
		||||
      </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    {{ end }}
 | 
			
		||||
  </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
  {{template "journeys_solidarity_transport" .}}
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
{{define "journeys_others"}}
 | 
			
		||||
 | 
			
		||||
<!--VEHICLES-->
 | 
			
		||||
{{if moduleAvailable "vehicles"}}
 | 
			
		||||
<div class="p-4 flex text-sm text-grey-900">
 | 
			
		||||
    <div class="flex-1">
 | 
			
		||||
        {{.IconSet.Icon "tabler-icons:car" "h-6 w-6 inline-flex mr-4"}}
 | 
			
		||||
| 
						 | 
				
			
			@ -34,5 +35,5 @@
 | 
			
		|||
<div class="p-4 text-center">
 | 
			
		||||
    <a href="/app/vehicles/"><button class="text-md px-4 py-1 bg-gray-200 text-co-blue rounded-xl">Réserver un véhicule</button></a>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,10 +1,11 @@
 | 
			
		|||
{{define "journeys_public_transit"}}
 | 
			
		||||
 | 
			
		||||
{{ if eq (len .ViewState.journeys.Journeys) 0}}
 | 
			
		||||
{{ if or (not .ViewState.journeys) (eq (len .ViewState.journeys.Journeys) 0)}}
 | 
			
		||||
<p class="p-12 text-gray-500 text-center text-md">Aucun transport en commun pour ce trajet.</p>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
{{$first := true}}
 | 
			
		||||
{{if .ViewState.journeys}}
 | 
			
		||||
{{range .ViewState.journeys.Journeys}}
 | 
			
		||||
{{if $first}}
 | 
			
		||||
{{$first = false}}
 | 
			
		||||
| 
						 | 
				
			
			@ -78,4 +79,5 @@
 | 
			
		|||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
 | 
			
		||||
{{define "journeys_solidarity_transport"}}
 | 
			
		||||
 | 
			
		||||
{{ if eq (len .ViewState.solidarity_drivers) 0}}
 | 
			
		||||
{{ if eq (len .ViewState.driver_journeys) 0}}
 | 
			
		||||
<p class="p-12 text-gray-500 text-center text-md">Aucun conducteur solidaire disponible pour ce trajet.</p>
 | 
			
		||||
{{else}}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -12,6 +12,14 @@
 | 
			
		|||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Conducteurs disponibles
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Distance conducteur
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Distance passager
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
           
 | 
			
		||||
| 
						 | 
				
			
			@ -19,13 +27,16 @@
 | 
			
		|||
    </tr>
 | 
			
		||||
  </thead>
 | 
			
		||||
  <tbody class="divide-y divide-gray-200 bg-white">
 | 
			
		||||
    {{ range .ViewState.solidarity_drivers }}
 | 
			
		||||
    {{ range .ViewState.driver_journeys }}
 | 
			
		||||
    {{ $driver := (index $.ViewState.solidarity_drivers .DriverId)}}
 | 
			
		||||
    <tr>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.first_name }} {{ .Data.last_name }}</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ $driver.Data.first_name }} {{ $driver.Data.last_name }}</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .DriverDistance }} km</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .PassengerDistance }} km</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <a class="text-co-blue hover:text-co-blue" 
 | 
			
		||||
          href="/app/solidarity-transport/drivers/{{.ID}}/match">
 | 
			
		||||
          Organiser le transport solidaire
 | 
			
		||||
          href="/app/solidarity-transport/drivers/{{$driver.ID}}/journeys/{{.Id}}">
 | 
			
		||||
          Organiser
 | 
			
		||||
        </a>
 | 
			
		||||
      </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,6 +10,10 @@
 | 
			
		|||
  <script src="https://cdn.jsdelivr.net/npm/@kingshott/iodine@8.1.0/dist/iodine.min.umd.js" defer></script>
 | 
			
		||||
  <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
 | 
			
		||||
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.js"></script>
 | 
			
		||||
  <script src="https://unpkg.com/maplibre-gl@^5.1.1/dist/maplibre-gl.js"></script>
 | 
			
		||||
  <script src="https://unpkg.com/pmtiles@^4.3.0/dist/pmtiles.js"></script>
 | 
			
		||||
  <link href="https://unpkg.com/maplibre-gl@^5.1.1/dist/maplibre-gl.css" rel="stylesheet" />
 | 
			
		||||
  <script src="https://unpkg.com/@protomaps/basemaps@5/dist/basemaps.js" crossorigin="anonymous"></script>
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body class="h-full" x-data="{ offCanvasMenu: false }">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,82 @@
 | 
			
		|||
 | 
			
		||||
{{ define "solidarity_bookings_list" }}
 | 
			
		||||
{{if eq (len .ViewState.bookings) 0}}
 | 
			
		||||
<div class="m-10 text-center text-gray-600">Aucun trajet déclaré</div>
 | 
			
		||||
{{else}}
 | 
			
		||||
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
 | 
			
		||||
  <thead class="bg-gray-50">
 | 
			
		||||
    <tr>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Conducteur
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Passager
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Départ
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Destination
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Date
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Statut
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
           
 | 
			
		||||
      </th>
 | 
			
		||||
    </tr>
 | 
			
		||||
  </thead>
 | 
			
		||||
  <tbody class="divide-y divide-gray-200 bg-white">
 | 
			
		||||
    {{range .ViewState.bookings}}
 | 
			
		||||
    <tr>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <a class="text-co-blue" href="/app/solidarity-transport/drivers/{{.DriverId}}">
 | 
			
		||||
        {{ (index $.ViewState.drivers_map .DriverId).Data.first_name }} 
 | 
			
		||||
        {{ (index $.ViewState.drivers_map .DriverId).Data.last_name }}
 | 
			
		||||
        </a>
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <a class="text-co-blue" href="/app/beneficiaries/{{.PassengerId}}">
 | 
			
		||||
        {{ (index $.ViewState.passengers_map .PassengerId).Data.first_name }} 
 | 
			
		||||
        {{ (index $.ViewState.passengers_map .PassengerId).Data.last_name }}
 | 
			
		||||
        </a>
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        {{ .Journey.PassengerPickup.Properties.label }} 
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        {{ .Journey.PassengerDrop.Properties.label }} 
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        {{ .Journey.PassengerPickupDate.Format "02/01/2006 15:04" }} 
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        {{ if eq .Status "WAITING_CONFIRMATION"}}
 | 
			
		||||
        <span class="p-1 text-xs bg-gray-300 rounded-xl">Attente confirmation</span>
 | 
			
		||||
        {{ else if eq .Status "VALIDATED"}}
 | 
			
		||||
        <span class="p-1 text-xs bg-co-green rounded-xl">Validé</span>
 | 
			
		||||
        {{ else if eq .Status "CANCELLED"}}
 | 
			
		||||
        <span class="p-1 text-xs bg-co-red text-white rounded-xl">Annulé</span>
 | 
			
		||||
        {{ end }}
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <a class="text-co-blue" href="/app/solidarity-transport/bookings/{{.Id}}">
 | 
			
		||||
          Voir
 | 
			
		||||
        </a>
 | 
			
		||||
      </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    {{ end }}
 | 
			
		||||
  </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			@ -9,21 +9,21 @@
 | 
			
		|||
  </div>
 | 
			
		||||
  <div class="border-t border-gray-200 px-4">
 | 
			
		||||
    <div class="py-4">
 | 
			
		||||
      {{ range .ViewState.driver.Data.solidarity_transport_availabilities }}
 | 
			
		||||
      {{ range .ViewState.availabilities }}
 | 
			
		||||
      <div class="flex flex-row">
 | 
			
		||||
        <div class="flex-none">
 | 
			
		||||
        {{ if eq .day 0.0}}Dimanche
 | 
			
		||||
        {{ else if eq .day 1.0}}Lundi
 | 
			
		||||
        {{ else if eq .day 2.0}}Mardi
 | 
			
		||||
        {{ else if eq .day 3.0}}Mercredi
 | 
			
		||||
        {{ else if eq .day 4.0}}Jeudi
 | 
			
		||||
        {{ else if eq .day 5.0}}Vendredi
 | 
			
		||||
        {{ else if eq .day 6.0}}Samedi
 | 
			
		||||
        {{ if eq .Day 0}}Dimanche
 | 
			
		||||
        {{ else if eq .Day 1}}Lundi
 | 
			
		||||
        {{ else if eq .Day 2}}Mardi
 | 
			
		||||
        {{ else if eq .Day 3}}Mercredi
 | 
			
		||||
        {{ else if eq .Day 4}}Jeudi
 | 
			
		||||
        {{ else if eq .Day 5}}Vendredi
 | 
			
		||||
        {{ else if eq .Day 6}}Samedi
 | 
			
		||||
        {{ end }}
 | 
			
		||||
        {{.start_time}} - {{ .end_time }}
 | 
			
		||||
        {{.StartTime}} - {{ .EndTime }}
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex-auto"> </div>
 | 
			
		||||
        <div class="flex-none text-sm"><a class="text-co-blue" href="/app/solidarity-transport/drivers/{{$.ViewState.driver.ID}}/availabilities/{{.id}}/delete">Supprimer</a></div>
 | 
			
		||||
        <div class="flex-none text-sm"><a class="text-co-blue" href="/app/solidarity-transport/drivers/{{$.ViewState.driver.ID}}/availabilities/{{.Id}}/delete">Supprimer</a></div>
 | 
			
		||||
      </div>
 | 
			
		||||
      {{ end }}
 | 
			
		||||
    </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -49,6 +49,12 @@
 | 
			
		|||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          <form method="POST" action="/app/solidarity-transport/drivers/{{.ViewState.driver.ID}}/availabilities" class="my-4">
 | 
			
		||||
              <div class="my-8">
 | 
			
		||||
                
 | 
			
		||||
                    {{ $fieldName := "address" }}
 | 
			
		||||
                    {{ template "address_autocomplete" (dict "FieldName" $fieldName "Address" .ViewState.driver.Data.address) }}
 | 
			
		||||
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="my-4">
 | 
			
		||||
                <input name="days.monday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Lundi   
 | 
			
		||||
                <input name="days.tuesday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Mardi   
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,15 @@
 | 
			
		|||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Disponibilités
 | 
			
		||||
          Adresse
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Téléphone
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
          Profil validé
 | 
			
		||||
      </th>
 | 
			
		||||
      <th scope="col"
 | 
			
		||||
          class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
| 
						 | 
				
			
			@ -41,7 +49,11 @@
 | 
			
		|||
    {{ range .ViewState.drivers }}
 | 
			
		||||
    <tr>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.first_name }} {{ .Data.last_name }}</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"></td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.phone_number }}</td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
 | 
			
		||||
      </td>
 | 
			
		||||
      <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
        <a class="text-co-blue hover:text-co-blue" 
 | 
			
		||||
          href="/app/solidarity-transport/drivers/{{.ID}}">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,268 @@
 | 
			
		|||
{{define "journey_preview"}}
 | 
			
		||||
<div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200 flex flex-col">
 | 
			
		||||
      <div class="px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
 | 
			
		||||
        <div class="ml-4 mt-2 grid-cols-2">
 | 
			
		||||
          <h3 class="text-lg leading-6 font-medium text-gray-900">Le trajet</h3>
 | 
			
		||||
          <h2 class="text-sm leading-6 font-medium text-gray-600">Informations sur le trajet</h2>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
 | 
			
		||||
                    <div class="p-4 py-5 sm:px-6">
 | 
			
		||||
                        <dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Départ passager</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{.driver_journey.PassengerPickup.Properties.label}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Destination passager</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{.driver_journey.PassengerDrop.Properties.label}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Départ conducteur</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{.driver_journey.DriverDeparture.Properties.label}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Destination conducteur</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{.driver_journey.DriverArrival.Properties.label}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Kilomètres passager</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.driver_journey.PassengerDistance}} km</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Kilomètres conducteur</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.driver_journey.DriverDistance}} km</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Horaire départ conducteur</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{ .driver_journey.DriverDepartureDate.Format "02/01/2006 15:04"}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Horaire rendez vous passager</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{ .driver_journey.PassengerPickupDate.Format "02/01/2006 15:04"}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Temps de trajet (passager)</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{ printf "%.0f" .driver_journey.Duration.Minutes }} min</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Prix (passager)</dt>
 | 
			
		||||
            <dd class="mt-1 text-sm text-gray-900">{{ .driver_journey.Price.Amount }} {{ .driver_journey.Price.Currency}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </dl>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div>
 | 
			
		||||
        <div id="map" class="w-full h-full"></div>
 | 
			
		||||
<script>
 | 
			
		||||
  var map = new maplibregl.Map({
 | 
			
		||||
    container: 'map', // container id
 | 
			
		||||
    style: {
 | 
			
		||||
      version: 8,
 | 
			
		||||
      glyphs:'https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf',
 | 
			
		||||
      sprite: "https://protomaps.github.io/basemaps-assets/sprites/v4/light",
 | 
			
		||||
      sources: {
 | 
			
		||||
        "protomaps": {
 | 
			
		||||
            type: "vector",
 | 
			
		||||
            url: "pmtiles://https://coopgo-gis-data.s3.fr-par.scw.cloud/vector-tiles/pmtiles/europe-latest.pmtiles",
 | 
			
		||||
            //       ^-- Remember to prefix the URL with pmtiles://
 | 
			
		||||
            attribution: '<a href="https://protomaps.com">Protomaps</a> © <a href="https://openstreetmap.org">OpenStreetMap</a>'
 | 
			
		||||
        },
 | 
			
		||||
        "points": {
 | 
			
		||||
          type: "geojson",
 | 
			
		||||
          data: {
 | 
			
		||||
            "type": "FeatureCollection",
 | 
			
		||||
            "features": [
 | 
			
		||||
              {{ json .driver_journey.DriverDeparture }},
 | 
			
		||||
              {{ json .driver_journey.PassengerPickup }},
 | 
			
		||||
              {{ json .driver_journey.PassengerDrop }},
 | 
			
		||||
              {{ json .driver_journey.DriverArrival }}
 | 
			
		||||
            ]
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      layers: basemaps.layers("protomaps",basemaps.namedFlavor("light"),{lang:"en"})
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
</script>
 | 
			
		||||
                    </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  <div class="py-4 grid grid-cols-1 gap-6 sm:grid-cols-2">
 | 
			
		||||
    <div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200 flex flex-col">
 | 
			
		||||
      <div class="px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
 | 
			
		||||
        <div class="ml-4 mt-2 grid-cols-2">
 | 
			
		||||
          <h3 class="text-lg leading-6 font-medium text-gray-900">Conducteur</h3>
 | 
			
		||||
          <h2 class="text-sm leading-6 font-medium text-gray-600">{{.driver.Data.first_name}} {{.driver.Data.last_name}}</h2>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
                    <div class="border-t border-gray-200 px-4 py-5 sm:px-6">
 | 
			
		||||
                        <dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
 | 
			
		||||
                            {{if .driver.Data.email}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Email</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.driver.Data.email}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .driver.Data.phone_number}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Téléphone</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.driver.Data.phone_number}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .driver.Data.birthdate}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Date de naissance</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{(timeFrom .driver.Data.birthdate).Format
 | 
			
		||||
                                    "02/01/2006"}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if and .driver.Data.gender (ne .driver.Data.gender "0")}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Genre</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{genderISO5218 .driver.Data.gender}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .driver.Data.address}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Adresse</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.driver.Data.address.properties.label}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .driver.Data.file_number}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Numéro de dossier (CAF / Pole emploi)</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.driver.Data.file_number}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                        </dl>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200 flex flex-col">
 | 
			
		||||
      <div class="px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
 | 
			
		||||
        <div class="ml-4 mt-2">
 | 
			
		||||
          <h3 class="text-lg leading-6 font-medium text-gray-900">Passager</h3>
 | 
			
		||||
        <h2 class="text-sm leading-6 font-medium text-gray-600">{{if ne .passenger.ID "" }}{{.passenger.Data.first_name}} {{.passenger.Data.last_name}}{{end}}</h2>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="border-t border-gray-200 px-4 py-5 sm:px-6">
 | 
			
		||||
        {{if eq .passenger.ID ""}}
 | 
			
		||||
        <form method="GET">
 | 
			
		||||
                        
 | 
			
		||||
                    <div x-data="{
 | 
			
		||||
                        text: '',
 | 
			
		||||
                        beneficiariesListOpen: false,
 | 
			
		||||
                        beneficiaries: {{json .beneficiaries}},
 | 
			
		||||
                        filteredBeneficiaries: (beneficiaries, text) => {
 | 
			
		||||
                            if(text=='') {
 | 
			
		||||
                              return beneficiaries
 | 
			
		||||
                            }
 | 
			
		||||
                            return beneficiaries.filter(b => b['data']['first_name'].toLowerCase().includes(text.toLowerCase()) || b['data']['last_name'].toLowerCase().includes(text.toLowerCase()))
 | 
			
		||||
                        },
 | 
			
		||||
                        fields: {
 | 
			
		||||
                            beneficiaryid: {{if .search}}'{{.search.beneficiary.ID}}'{{else}}null{{end}},
 | 
			
		||||
                        },
 | 
			
		||||
                        selectbeneficiary(beneficiary) {
 | 
			
		||||
                            this.fields.beneficiaryid = beneficiary.id 
 | 
			
		||||
                            this.text = beneficiary.data.first_name + ' ' + beneficiary.data.last_name
 | 
			
		||||
                            this.beneficiariesListOpen = false
 | 
			
		||||
                        },
 | 
			
		||||
                    }">
 | 
			
		||||
                        <input type="hidden" name="passengerid" x-model="fields.beneficiaryid">
 | 
			
		||||
                        <label for="combobox" class="block text-sm font-medium text-gray-700">Selectionner un bénéficiaire</label>
 | 
			
		||||
                        <div class="relative mt-1 mb-4">
 | 
			
		||||
                          <input autocomplete="off" @focus="beneficiariesListOpen = true" x-model="text" id="combobox" type="text" class="w-full rounded-2xl border border-gray-300 bg-white py-2 pl-3 pr-12 shadow-sm focus:border-co-blue focus:outline-none focus:ring-1 focus:ring-co-blue sm:text-sm" role="combobox" aria-controls="options" aria-expanded="false">
 | 
			
		||||
                          
 | 
			
		||||
                          <button @click="beneficiariesListOpen = ! beneficiariesListOpen" type="button" class="absolute inset-y-0 right-0 flex items-center rounded-r-2xl px-2 focus:outline-none">
 | 
			
		||||
                            <!-- Heroicon name: solid/selector -->
 | 
			
		||||
                            <svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
 | 
			
		||||
                              <path fill-rule="evenodd" d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd" />
 | 
			
		||||
                            </svg>
 | 
			
		||||
                          </button>
 | 
			
		||||
                      
 | 
			
		||||
                          <ul x-show="beneficiariesListOpen" class="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-xl bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm" id="options" role="listbox">
 | 
			
		||||
                            <!--
 | 
			
		||||
                              Combobox option, manage highlight styles based on mouseenter/mouseleave and keyboard navigation.
 | 
			
		||||
                      
 | 
			
		||||
                              Active: "text-white bg-indigo-600", Not Active: "text-gray-900"
 | 
			
		||||
                            -->
 | 
			
		||||
                            <template x-for="beneficiary in filteredBeneficiaries(beneficiaries, text)">
 | 
			
		||||
                                <li @click="selectbeneficiary(beneficiary)" class="relative cursor-default hover:bg-gray-100 select-none py-2 pl-3 pr-9 text-gray-900" id="option-0" role="option" tabindex="-1">
 | 
			
		||||
                                <!-- Selected: "font-semibold" -->
 | 
			
		||||
                                <span class="truncate" x-text="beneficiary.data.first_name"></span> <span class="truncate" x-text="beneficiary.data.last_name"></span>
 | 
			
		||||
                        
 | 
			
		||||
                                <!--
 | 
			
		||||
                                    Checkmark, only display for selected option.
 | 
			
		||||
                        
 | 
			
		||||
                                    Active: "text-white", Not Active: "text-indigo-600"
 | 
			
		||||
                                -->
 | 
			
		||||
                                <span class="absolute inset-y-0 right-0 flex items-center pr-4 text-co-blue">
 | 
			
		||||
                                    <!-- Heroicon name: solid/check -->
 | 
			
		||||
                                    <!-- <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
 | 
			
		||||
                                    <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
 | 
			
		||||
                                    </svg> -->
 | 
			
		||||
                                </span>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </template>
 | 
			
		||||
                      
 | 
			
		||||
                            <!-- More items... -->
 | 
			
		||||
                          </ul>
 | 
			
		||||
                        </div>
 | 
			
		||||
                      </div>
 | 
			
		||||
                    <button type="submit" class="inline-flex w-full justify-center max-w-xs bg-co-blue  border-gray-300 border px-4 py-2 text-white items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
 | 
			
		||||
                      Valider
 | 
			
		||||
                    </button>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </form>
 | 
			
		||||
 | 
			
		||||
        {{ else }}
 | 
			
		||||
                        <dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
 | 
			
		||||
                            {{if .passenger.Data.email}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Email</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.email}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .passenger.Data.phone_number}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Téléphone</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.phone_number}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .passenger.Data.birthdate}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Date de naissance</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{(timeFrom .passenger.Data.birthdate).Format
 | 
			
		||||
                                    "02/01/2006"}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if and .passenger.Data.gender (ne .passenger.Data.gender "0")}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Genre</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{genderISO5218 .passenger.Data.gender}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .passenger.Data.address}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Adresse</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.address.properties.label}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            {{if .passenger.Data.file_number}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Numéro de dossier (CAF / Pole emploi)</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.file_number}}</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{end}}
 | 
			
		||||
                            <div class="sm:col-span-1">
 | 
			
		||||
                                <dt class="text-sm font-medium text-gray-500">Compte mobilié (solde)</dt>
 | 
			
		||||
                                <dd class="mt-1 text-sm text-gray-900">{{if .passenger.Data.wallet}}{{ .passenger.Data.wallet }}{{else}}0{{end}} EUR</dd>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </dl>
 | 
			
		||||
                    </div>
 | 
			
		||||
 | 
			
		||||
        {{end}}
 | 
			
		||||
      </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,35 @@
 | 
			
		|||
{{define "content"}}
 | 
			
		||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
 | 
			
		||||
    <h1 class="text-2xl font-semibold text-gray-900">
 | 
			
		||||
      Transport solidaire 
 | 
			
		||||
    </h1>
 | 
			
		||||
      {{ if eq .ViewState.booking.Status "WAITING_CONFIRMATION"}}
 | 
			
		||||
      <div class="mt-4"><span class="p-2 text-sm bg-gray-300 rounded-2xl px-4">Attente confirmation</span></div>
 | 
			
		||||
      {{ else if eq .ViewState.booking.Status "VALIDATED"}}
 | 
			
		||||
      <div class="mt-4"><span class="p-1 text-sm bg-co-green rounded-2xl px-4">Validé</span></div>
 | 
			
		||||
      {{ else if eq .ViewState.booking.Status "CANCELLED"}}
 | 
			
		||||
      <div class="mt-4"><span class="p-1 text-sm bg-co-red text-white rounded-2xl px-4">Annulé</span></div>
 | 
			
		||||
      {{ end }}
 | 
			
		||||
<div
 | 
			
		||||
  class="mt-6 flex flex-col-reverse justify-stretch space-y-4 space-y-reverse sm:flex-row-reverse sm:justify-end sm:space-x-reverse sm:space-y-0 sm:space-x-3 md:mt-0 md:flex-row md:space-x-3">
 | 
			
		||||
  <!-- <button type="button"
 | 
			
		||||
       class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Supprimer</button> -->
 | 
			
		||||
  {{if eq .ViewState.booking.Status "WAITING_CONFIRMATION" }}
 | 
			
		||||
  <a href="/app/solidarity-transport/bookings/{{.ViewState.booking.Id}}/confirm" class="inline-flex"><button type="button"
 | 
			
		||||
     class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Confirmer</button></a>
 | 
			
		||||
  {{end}}
 | 
			
		||||
  {{if ne .ViewState.booking.Status "WAITING_CONFIRMATION" }}
 | 
			
		||||
  <a href="/app/solidarity-transport/bookings/{{.ViewState.booking.Id}}/waitconfirmation" class="inline-flex"><button type="button"
 | 
			
		||||
     class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Remettre en attente</button></a>
 | 
			
		||||
  {{end}}
 | 
			
		||||
  {{if ne .ViewState.booking.Status "CANCELLED" }}
 | 
			
		||||
  <a href="/app/solidarity-transport/bookings/{{.ViewState.booking.Id}}/cancel" class="inline-flex"><button type="button"
 | 
			
		||||
     class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-red hover:bg-co-red focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Annuler</button></a>
 | 
			
		||||
  {{end}}
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
 | 
			
		||||
  {{template "journey_preview" (dict "driver_journey" .ViewState.booking.Journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}}
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
{{ end }}
 | 
			
		||||
| 
						 | 
				
			
			@ -58,7 +58,7 @@
 | 
			
		|||
                        <div class="col-span-6 sm:col-span-3">
 | 
			
		||||
                            <label for="first_name" class="block text-sm font-medium text-gray-700">Prénom</label>
 | 
			
		||||
                            <input type="text" name="first_name" id="first_name" autocomplete="given-name"
 | 
			
		||||
                                class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm  rounded-2xl"
 | 
			
		||||
                                class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm  rounded-2xl"
 | 
			
		||||
                                x-model="fields.first_name" @blur="validateField('first_name')"
 | 
			
		||||
                                :class="formValidation.fields.first_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
 | 
			
		||||
                        </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +66,7 @@
 | 
			
		|||
                        <div class="col-span-6 sm:col-span-3">
 | 
			
		||||
                            <label for="last_name" class="block text-sm font-medium text-gray-700">Nom</label>
 | 
			
		||||
                            <input type="text" name="last_name" id="last_name" autocomplete="family-name"
 | 
			
		||||
                                class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                x-model="fields.last_name" @blur="validateField('last_name')"
 | 
			
		||||
                                :class="formValidation.fields.last_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
 | 
			
		||||
                        </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -74,7 +74,7 @@
 | 
			
		|||
                        <div class="col-span-6 sm:col-span-3">
 | 
			
		||||
                            <label for="email" class="block text-sm font-medium text-gray-700">Email</label>
 | 
			
		||||
                            <input type="text" name="email" id="email" autocomplete="email"
 | 
			
		||||
                                class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                x-model="fields.email" @blur="validateField('email')"
 | 
			
		||||
                                :class="formValidation.fields.email.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
 | 
			
		||||
                        </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +83,7 @@
 | 
			
		|||
                            <label for="phone_number" class="block text-sm font-medium text-gray-700">Numéro de
 | 
			
		||||
                                téléphone</label>
 | 
			
		||||
                            <input type="text" name="phone_number" id="phone_number" autocomplete="phone" placeholder="+33612345678"
 | 
			
		||||
                                class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                x-model="fields.phone_number" @blur="validateField('phone_number')"
 | 
			
		||||
                                :class="formValidation.fields.phone_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
 | 
			
		||||
                        </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -92,10 +92,12 @@
 | 
			
		|||
                            <label for="birthdate" class="block text-sm font-medium text-gray-700">Date de
 | 
			
		||||
                                naissance</label>
 | 
			
		||||
                            <input type="date" name="birthdate" id="birthdate" autocomplete="birthdate" placeholder="JJ/MM/AAAA"
 | 
			
		||||
                                class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
 | 
			
		||||
                                x-model="fields.birthdate" @blur="validateField('birthdate')"
 | 
			
		||||
                                :class="formValidation.fields.birthdate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
 | 
			
		||||
                        </div>
 | 
			
		||||
                    {{ $fieldName := "address" }}
 | 
			
		||||
                    {{ template "address_autocomplete" dict "FieldName" $fieldName }}
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +116,7 @@
 | 
			
		|||
                            <label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
 | 
			
		||||
                            <div class="sm:mt-0 sm:col-span-2">
 | 
			
		||||
                                <select id="gender" name="gender" autocomplete="gender" x-model="gender"
 | 
			
		||||
                                    class="max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
 | 
			
		||||
                                    class="p-2 max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
 | 
			
		||||
                                    <option value="0">Inconnu</option>
 | 
			
		||||
                                    <option value="1">Masculin</option>
 | 
			
		||||
                                    <option value="2">Féminin</option>
 | 
			
		||||
| 
						 | 
				
			
			@ -141,7 +143,7 @@
 | 
			
		|||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
 | 
			
		||||
        <!--<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
 | 
			
		||||
            <div class="md:grid md:grid-cols-3 md:gap-6">
 | 
			
		||||
                <div class="md:col-span-1">
 | 
			
		||||
                    <h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
 | 
			
		||||
| 
						 | 
				
			
			@ -152,11 +154,9 @@
 | 
			
		|||
                    {{ $fieldName := "address" }}
 | 
			
		||||
                    {{ template "address_autocomplete" dict "FieldName" $fieldName }}
 | 
			
		||||
 | 
			
		||||
                    <!-- will dolater : tags, groups, ... -->
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        </div>-->
 | 
			
		||||
 | 
			
		||||
        <div class="flex justify-end">
 | 
			
		||||
            <p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
 | 
			
		||||
{{define "content"}}
 | 
			
		||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
 | 
			
		||||
    <h1 class="text-2xl font-semibold text-gray-900">Organiser le transport solidaire</h1>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
 | 
			
		||||
  {{template "journey_preview" (dict "driver_journey" .ViewState.driver_journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}}
 | 
			
		||||
          {{if ne .ViewState.passenger.ID ""}}
 | 
			
		||||
<div class="max-w-7xl m-auto px-4 sm:px-6 md:px-8 flex justify-items-center">
 | 
			
		||||
  <form method="POST">
 | 
			
		||||
    <button class="w-100 bg-co-blue  border-gray-300 border px-4 py-2 text-white items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
 | 
			
		||||
      Envoyer la mise en relation
 | 
			
		||||
    </button>
 | 
			
		||||
  </form>
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
{{ end }}
 | 
			
		||||
| 
						 | 
				
			
			@ -37,9 +37,7 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
            <div x-show="tab == 'beneficiaries'">1</div>
 | 
			
		||||
            <div x-show="tab == 'solidarityService'">
 | 
			
		||||
              <div class="m-10 text-center text-gray-600">Aucun trajet déclaré</div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div x-show="tab == 'solidarityService'">{{template "solidarity_bookings_list" .}}</div>
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,6 +55,7 @@
 | 
			
		|||
    --font-weight-extrabold: 800;
 | 
			
		||||
    --tracking-tight: -0.025em;
 | 
			
		||||
    --tracking-wide: 0.025em;
 | 
			
		||||
    --radius-sm: 0.25rem;
 | 
			
		||||
    --radius-md: 0.375rem;
 | 
			
		||||
    --radius-lg: 0.5rem;
 | 
			
		||||
    --radius-xl: 0.75rem;
 | 
			
		||||
| 
						 | 
				
			
			@ -451,6 +452,9 @@
 | 
			
		|||
  .m-10 {
 | 
			
		||||
    margin: calc(var(--spacing) * 10);
 | 
			
		||||
  }
 | 
			
		||||
  .m-auto {
 | 
			
		||||
    margin: auto;
 | 
			
		||||
  }
 | 
			
		||||
  .-mx-4 {
 | 
			
		||||
    margin-inline: calc(var(--spacing) * -4);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -466,9 +470,6 @@
 | 
			
		|||
  .-my-2 {
 | 
			
		||||
    margin-block: calc(var(--spacing) * -2);
 | 
			
		||||
  }
 | 
			
		||||
  .my-2 {
 | 
			
		||||
    margin-block: calc(var(--spacing) * 2);
 | 
			
		||||
  }
 | 
			
		||||
  .my-4 {
 | 
			
		||||
    margin-block: calc(var(--spacing) * 4);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -742,6 +743,9 @@
 | 
			
		|||
  .w-48 {
 | 
			
		||||
    width: calc(var(--spacing) * 48);
 | 
			
		||||
  }
 | 
			
		||||
  .w-100 {
 | 
			
		||||
    width: calc(var(--spacing) * 100);
 | 
			
		||||
  }
 | 
			
		||||
  .w-auto {
 | 
			
		||||
    width: auto;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -1445,6 +1449,9 @@
 | 
			
		|||
  .rounded-md {
 | 
			
		||||
    border-radius: var(--radius-md);
 | 
			
		||||
  }
 | 
			
		||||
  .rounded-sm {
 | 
			
		||||
    border-radius: var(--radius-sm);
 | 
			
		||||
  }
 | 
			
		||||
  .rounded-xl {
 | 
			
		||||
    border-radius: var(--radius-xl);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -1669,6 +1676,12 @@
 | 
			
		|||
  .bg-gray-200 {
 | 
			
		||||
    background-color: var(--color-gray-200);
 | 
			
		||||
  }
 | 
			
		||||
  .bg-gray-300 {
 | 
			
		||||
    background-color: var(--color-gray-300);
 | 
			
		||||
  }
 | 
			
		||||
  .bg-gray-400 {
 | 
			
		||||
    background-color: var(--color-gray-400);
 | 
			
		||||
  }
 | 
			
		||||
  .bg-gray-500 {
 | 
			
		||||
    background-color: var(--color-gray-500);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -1886,9 +1899,6 @@
 | 
			
		|||
  .p-4 {
 | 
			
		||||
    padding: calc(var(--spacing) * 4);
 | 
			
		||||
  }
 | 
			
		||||
  .p-10 {
 | 
			
		||||
    padding: calc(var(--spacing) * 10);
 | 
			
		||||
  }
 | 
			
		||||
  .p-12 {
 | 
			
		||||
    padding: calc(var(--spacing) * 12);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -2381,9 +2391,6 @@
 | 
			
		|||
  .opacity-0 {
 | 
			
		||||
    opacity: 0%;
 | 
			
		||||
  }
 | 
			
		||||
  .opacity-25 {
 | 
			
		||||
    opacity: 25%;
 | 
			
		||||
  }
 | 
			
		||||
  .opacity-30 {
 | 
			
		||||
    opacity: 30%;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -3542,6 +3549,9 @@
 | 
			
		|||
  html {
 | 
			
		||||
    font-family: Bitter, serif;
 | 
			
		||||
  }
 | 
			
		||||
  input {
 | 
			
		||||
    padding: 2px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@property --tw-translate-x {
 | 
			
		||||
  syntax: "*";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue