117 lines
4.0 KiB
XML
117 lines
4.0 KiB
XML
<metal:block use-macro="main_template">
|
|
<div metal:fill-slot="content">
|
|
|
|
<div tal:condition="message" tal:content="message" class="alert alert-danger" />
|
|
<br />
|
|
<form id="rdf_cabinet-form" class="form-horizontal" action="${url}" method="post"
|
|
data-fv-framework="bootstrap"
|
|
data-fv-icon-valid="glyphicon glyphicon-ok"
|
|
data-fv-icon-invalid="glyphicon glyphicon-remove"
|
|
data-fv-icon-validating="glyphicon glyphicon-refresh">
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-3" for="CODE">Code</label>
|
|
<div class="col-xs-9">
|
|
<input class="form-control" type="text" id="CODE" name="CODE" value="${expert.CODE}" readonly />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-3" for="NOM">Nom</label>
|
|
<div class="col-xs-9">
|
|
<input class="form-control" type="text" id="NOM" name="NOM" value="${expert.NOM}"
|
|
placeholder="30 caractères maximum"
|
|
data-fv-notempty="true"
|
|
data-fv-notempty-message="Un libellé est obligatoire"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="30"
|
|
data-fv-stringlength-message="30 caractères maximum" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-xs-3 control-label" for="TEL1">Télphone 1</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" name="TEL1" value="${expert.TEL1}"
|
|
placeholder="14 caractères maximum"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="14"
|
|
data-fv-stringlength-message="14 caractères maximum" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-xs-3 control-label" for="TEL2">Portable</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" name="TEL2" value="${expert.TEL2}"
|
|
placeholder="14 caractères maximum"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="14"
|
|
data-fv-stringlength-message="14 caractères maximum" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-xs-3 control-label" for="email">Email</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" name="email" value="${expert.email}"
|
|
placeholder="50 caractères maximum"
|
|
data-fv-emailaddress="true"
|
|
data-fv-emailaddress-message="L'adresse email n'est pas valide" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-sm-offset-3 col-xs-9 checkbox">
|
|
<label><input type="checkbox" name="afficher" value="expert.en_activite"
|
|
tal:attributes="checked expert.en_activite != 0 and 'checked' or None">La fiche est active
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-3">Dern. modif le</label>
|
|
<div class="col-xs-9">
|
|
<p class="form-control-static">${expert.modif_le.strftime('%d-%m-%Y %H:%M')}</p>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-xs-offset-3 col-xs-9">
|
|
<a class="btn btn-default" href="/cabinets">
|
|
<span class="glyphicon glyphicon-arrow-left"></span> Annuler</a>
|
|
<button class="btn btn-primary" type="submit" name="form.submitted">
|
|
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
|
<button class="btn btn-danger" type="submit" name="form.deleted" tal:condition="expert.CODE != '0'">
|
|
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<br />
|
|
<br />
|
|
<br />
|
|
|
|
<link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">
|
|
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#rdf_cabinet-form').formValidation();
|
|
$('form input').on('keypress', function(e) {
|
|
return e.which !== 13;
|
|
});
|
|
});
|
|
$('#code_postal').autocomplete({
|
|
source: function (request, response) {
|
|
$.ajax({
|
|
url:'/ajax_codepostal',
|
|
dataType: 'json',
|
|
data: {
|
|
recherche: request.term,
|
|
},
|
|
success: function (data) {
|
|
response( data );
|
|
},
|
|
});
|
|
},
|
|
minLength: 3,
|
|
});
|
|
|
|
</script>
|
|
|
|
</div>
|
|
</metal:block>
|