<%def name="sejour_wrapper(Places)">
<style>
fieldset:disabled {
	color:#CCC;
}
</style>
<form id="ProfilForm" action="/MonSejour" method="POST">
    <fieldset class="ComeToJM2L">
        <legend>Arriv&eacute;e</legend>
        <div class="form-inline">
            J'arrive
            <select style="width:12em;" id="Arrival:Place" name="Arrival:Place" title="Lieu">
                % for place in Places:
                	<option value="${place.place_id}">${place.display_name}</option>
                % endfor			
            </select>
            le
            <select style="width:7em;" id="Arrival:Day" name="Arrival:Day" title="Jour">
                % for daynum, daystr, selected in mytrip.PossibleDate("arrival"):
                	<option value="${daynum}" ${selected | n}>${daystr}</option>
                % endfor
            </select>
            ,
            <select style="width:15em;" id="Arrival:Confidence" name="Arrival:Confidence">
                <option value="Exacte" selected="selected">exactement à</option>
                <option value="Approximative">approximativement à</option>
                <option value="à peu près">à peu près (5 à 15 min) vers</option>
                <option value="à une vache près">à une vache près (1h) vers</option>
            </select>

            &agrave; 
                <select style="width:6em;" id="Arrival:Hour" class="formforform-field" name="Arrival:Hour" title="Le">
                % for StrTime, DispTime, selected in mytrip.PossibleTime("arrival"):
                	<option value="${StrTime}" ${selected | n}>${DispTime}</option>
                % endfor
                </select>
		
		<%
		context._kwargs['postpone_js'].append( "$('#Arrival\\\\:Place').select2({width:'resolve'});" )
		context._kwargs['postpone_js'].append( "$('#Arrival\\\\:Day').select2({width:'resolve'});" )
		context._kwargs['postpone_js'].append( "$('#Arrival\\\\:Confidence').select2({width:'resolve'});" )
		context._kwargs['postpone_js'].append( "$('#Arrival\\\\:Hour').select2({width:'resolve'});" )
		%>                
        </div>
        <p>
        <div class="control-group" style="background-color: #fafafa;padding: 10px 50px; width:60%">
            Je vais avoir besoin: &nbsp;&nbsp;<small style="color: #aaa;">(Cochez les cases correspondantes)</small>
            
            <ul style="list-style-type: none;">
                <li><label class="checkbox">
                    <input id="PMR" ${mytrip.IsCheck("Arrival:PMR")|n} name="Arrival:PMR" title="Assistance Personne à mobilit&eacute; r&eacute;duite (PMR)" type="checkbox">
                        d'assistance : Personne à mobilit&eacute; r&eacute;duite (PMR)</input></label> 
                </li>
                <li><label class="checkbox">           
                    <input id="Cov" ${mytrip.IsCheck("Arrival:Cov")|n} name="Arrival:Cov" title="Covoiturage" type="checkbox">
                    d'un covoiturage, d'un hébergement...<br>(j'ai rempli/je vais remplir la section Logistique).</input></label> 
                </li>
                <li><label class="checkbox">
                    <input id="Bras" ${mytrip.IsCheck("Arrival:Bras")|n} name="Arrival:Bras" title="Bras" type="checkbox">
                    de bras, car je rapporte plein de mat&eacute;riel. <br>(Je transporte ma maison, mon garage ...)</input></label> 
                </li>
                <li>
                    <div class="form-inline">
                        <label class="checkbox">
                            <input id="Other" ${mytrip.IsCheck("Arrival:Other")|n} name="Arrival:Other" title="Autres" type="checkbox">
                            Autres
                            </input></label> 
                        <input type="text" style="width:20em;" name="Arrival:Comment" 
                            placeholder="Pr&eacute;cisions à propos de mon arriv&eacute;e…" /> 
                    </div>
                </li>
            </ul>
        </div>
        </p>                
    </fieldset>
        
    <fieldset class="ComeToJM2L">
        <legend>D&eacute;part</legend>
        <div class="form-inline">                
            Je repars
                <select style="width:12em;" id="Departure:Place" class="formforform-field" name="Departure:Place" title="Alors, j'arrive">
					% for place in Places:
						<option value="${place.place_id}">${place.display_name}</option>
					% endfor
                </select>
            le
                <select style="width:7em;" id="Departure:Day" class="formforform-field" name="Departure:Day" title="Le">
	                % for daynum, daystr, selected in mytrip.PossibleDate("departure"):
	                	<option value="${daynum}" ${selected | n}>${daystr}</option>
	                % endfor                        
                </select>
            ,
                <select style="width:14em;" id="Departure:Confidence" class="formforform-field" name="Departure:Confidence" title="Le">
                    <option value="Exacte" selected="selected">exactement</option>
                    <option value="Approximative">approximativement</option>
                    <option value="à peu près">à peu près (5 à 15 min)</option>
                    <option value="à une vache près">à une vache près (1h)</option>
                </select>
            &agrave;
                <select style="width:6em;" id="Departure:Hour" class="formforform-field" name="Departure:Hour" title="&agrave;">
	                % for StrTime, DispTime, selected in mytrip.PossibleTime("departure"):
	                	<option value="${StrTime}" ${selected | n}>${DispTime}</option>
	                % endfor
                </select>

		<%
		context._kwargs['postpone_js'].append( "$('#Departure\\\\:Place').select2({width:'resolve'});" )
		context._kwargs['postpone_js'].append( "$('#Departure\\\\:Day').select2({width:'resolve'});" )
		context._kwargs['postpone_js'].append( "$('#Departure\\\\:Confidence').select2({width:'resolve'});" )
		context._kwargs['postpone_js'].append( "$('#Departure\\\\:Hour').select2({width:'resolve'});" )
		%>
        </div>
        <p>
        <div class="control-group" style="background-color: #fafafa;padding: 10px 50px; width:60%">              
            Je vais avoir besoin: &nbsp;&nbsp;<small style="color: #aaa;">(Cochez les cases correspondantes)</small>
            <ul style="list-style-type: none;">
                <li><label class="checkbox">   
                    <input id="PMR" ${mytrip.IsCheck("Departure:PMR")|n} name="Departure:PMR" title="d'Assistance : Personne à mobilit&eacute; r&eacute;duite (PMR)" type="checkbox">
                        d'assistance : Personne à mobilit&eacute; r&eacute;duite (PMR)</input>
                    </label>
                </li>
                <li><label class="checkbox">   
                    <input id="Cov" ${mytrip.IsCheck("Departure:Cov")|n} name="Departure:Cov" title="d'un covoiturage" type="checkbox">
                    d'un covoiturage, (j'ai rempli la section intendance).</input>
                    </label>
                </li>
                <li><label class="checkbox">   
                    <input id="Bras" ${mytrip.IsCheck("Departure:Bras")|n}  name="Departure:Bras" title="de bras" type="checkbox">
                    de bras, car j'ai en stock plein de mat&eacute;riel (Ma maison).</input>
                    </label>
                </li>
                <li>
                    <div class="form-inline">
                        <label class="checkbox">
                            <input id="Other" ${mytrip.IsCheck("Departure:Other")|n}  name="Departure:Other" title="Autres" type="checkbox">
                            Autres
                            </input></label> 
                        <input type="text" style="width:20em;" name="Departure:Comment" 
                            placeholder="Pr&eacute;cisions à propos de mon d&eacute;part…" /> 
                    </div>
                </li>
            </ul>
        </div>
        </p>     
    </fieldset>
    <div class="center">
    % if mytrip.Sejour:
        <button type="submit" class="btn btn-large btn-primary" />
            <i class="icon-ok icon-white"></i> Enregistrer mes modifications
        </button>
    % else:    
        <button type="submit" class="btn btn-large btn-primary" />
            <i class="icon-ok icon-white"></i> Je viens aux JM2L ${CurrentYear}
        </button>
    % endif
    </div>
</form>

</%def>
