aboutsummaryrefslogtreecommitdiffstats
path: root/jm2l/templates/Logistique/Dialog_Covoit.mako
blob: 7e2bf9b0f913be097c612a00bb8684131a443f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<%namespace name="helper" file="jm2l:templates/helpers.mako"/>
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
##               Détail de l'échange de Co-voiturage
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<%def name="ShowC(Exch)"> \
  <div class="tabbable" id="itin_tab">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#Place_Detail" data-toggle="tab">Détail</a></li>
        <li><a href="#Place_Info" data-toggle="tab">Informations</a></li>
% if Exch.Itin.start.gps_coord and Exch.Itin.arrival.gps_coord:        
        <li><a href="#Place_Plan" id="ItinMap" data-toggle="tab">Carte</a></li>
        <li><a href="#Place_Itin" data-toggle="tab">Itineraire</a></li>
% endif        
    </ul>
    <div class="tab-content">
        <div class="tab-pane fade active in" id="Place_Detail">    
            ${helper.show_exchange(Exch, Exch.asker, Exch.provider)}
            <table class="table table-bordered table-striped" style="width: 100%">
                <thead>
                  <tr>
                    <th style="width:50%;text-align:center;">Au départ de</th>
                    <th style="width:50%;text-align:center;">À destination de</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>${helper.show_address(Exch.Itin.start)}</td>
                    <td>${helper.show_address(Exch.Itin.arrival)}</td>
                  </tr>
                </tbody>
            </table>
            <center>
            Pour un co-voiturage le <u>${Exch.start_time.strftime("%a %d %b").decode('utf-8')}</u>
            vers <strong>${Exch.start_time.strftime("%H:%M")}</strong>
            </center>            
            Temps de voyage estimé à <span id="summary"></span>
        </div>            
        <div class="tab-pane fade in" id="Place_Info">
            <table class="table table-bordered table-striped" style="width: 100%">
                <thead>
                  <tr>
                    <th>Départ</th>
                    <th>Arrivée</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="width:50%">${helper.show_desc(Exch.Itin.start)}</td>
                    <td style="width:50%">${helper.show_desc(Exch.Itin.arrival)}</td>
                  </tr>
                </tbody>
            </table>
        </div>
% if Exch.Itin.start.gps_coord and Exch.Itin.arrival.gps_coord:
        <div class="tab-pane fade in" id="Place_Plan">
            <div id="map"></div>
            <script type="text/javascript">
                var map = L.map('map');
                // create the tile layer with correct attribution
                var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
                var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
                var osm = new L.TileLayer(osmUrl, {minZoom: 8, maxZoom: 17, attribution: osmAttrib});
                map.addLayer(osm);                
                var toast = L.Routing.control({
                    containerClassName: '#map_Itineraire',
                    show:false,
                    waypoints: [
                        L.latLng(${Exch.Itin.start.gps_coord}),
                        L.latLng(${Exch.Itin.arrival.gps_coord})
                    ]
                });
                toast.addTo(map);
                
            </script>
        </div>
        <div class="tab-pane fade in" id="Place_Itin">
            <div id="map_Itineraire"></div>        
        </div>     
% endif

    </div>
  </div>
</%def> \
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
##                 Proposition de Co-voiturage
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<%def name="Covoit_Proposal(form)"> \
<% ## PlaceHolder, ContainerStyle, FieldStyle
    DicFormat = {
        "Day_start" :{'ContainerStyle':'float:left;', 'FieldStyle':'width:7em;'},
        "Confidence" :{'ContainerStyle':'float:left;', 'FieldStyle':'width:16em;'},        
        "Hour_start" :{'PlaceHolder':'10:00', 'FieldStyle':'width:4em;margin: 0 2px;'},
        "start_place":{'ContainerStyle':'float:left;','FieldStyle':'width:15em;'},
        "arrival_place":{'ContainerStyle':'float:left;','FieldStyle':'width:15em;'},
    }
%>
    ${helper.DisplayForm(form, DicFormat)}
    <div clear="both"><br><br><br></div>
    <div style="padding: 20px;">
        <small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small>
        <br />
        <small style="color:#999">Je peux </small>
        <a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');">
            <i class="icon-plus-sign icon-white"></i> Ajouter un lieu
        </a>
    </div>  
    </%def> \
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
##                   Demande de Co-voiturage
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=    
<%def name="Covoit_Ask(form)"> \
<% ## PlaceHolder, ContainerStyle, FieldStyle
    DicFormat = {
        "Day_start" :{'ContainerStyle':'float:left;', 'FieldStyle':'width:7em;'},
        "Confidence" :{'ContainerStyle':'float:left;', 'FieldStyle':'width:16em;'},
        "Hour_start" :{'PlaceHolder':'10:00', 'FieldStyle':'width:4em;margin: 0 2px;'},
        "start_place":{'ContainerStyle':'float:left;','FieldStyle':'width:15em;'},
        "arrival_place":{'ContainerStyle':'float:left;','FieldStyle':'width:15em;'},
    }
%>
    ${helper.DisplayForm(form, DicFormat)}
    <div clear="both"><br><br><br></div>
    <div style="margin-top: 15px;">
        <small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small>
        <br />
        <small style="color:#999">Je peux </small>
        <a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');">
            <i class="icon-plus-sign icon-white"></i> Ajouter un lieu
        </a>
    </div>    
</%def> \