174 lines
5.9 KiB
XML
174 lines
5.9 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 />
|
|
<h3>CABINET</h3>
|
|
<form id="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">
|
|
<p class="form-control-static">${code}</p>
|
|
</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="${cabinet.NOM}"
|
|
placeholder="30 caractères maximum"
|
|
data-fv-notempty="true"
|
|
data-fv-notempty-message="Le nom 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="ADRESSE">Adresse</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" id="ADRESSE" name="ADRESSE" value="${cabinet.ADRESSE}"
|
|
placeholder="40 caractères maximum"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="40"
|
|
data-fv-stringlength-message="40 caractères maximum" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-xs-3 control-label" for="ADRESSE2">Adresse 2</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" id="ADRESSE2" name="ADRESSE2" value="${cabinet.ADRESSE2}"
|
|
placeholder="40 caractères maximum"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="40"
|
|
data-fv-stringlength-message="40 caractères maximum" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-xs-3 control-label" for="code_postal">Code postal - Ville</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" id="code_postal" name="code_postal" value="${code_postal}"
|
|
placeholder="5 caractères maximum"
|
|
data-fv-notempty="true"
|
|
data-fv-notempty-message="Le code postal est obligatoire" />
|
|
</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="${cabinet.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">Télphone 2</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" name="TEL2" value="${cabinet.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="TELP">Télphone portable</label>
|
|
<div class="col-xs-8">
|
|
<input class="form-control" type="text" name="TELP" value="${cabinet.TELP}"
|
|
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">
|
|
<div class="col-sm-offset-3 col-sm-9 checkbox">
|
|
<label><input type="checkbox" name="afficher" value="cabinet.afficher"
|
|
tal:attributes="checked cabinet.afficher != 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">${cabinet.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" tal:condition="code != '1'">
|
|
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
|
<button class="btn btn-danger" type="submit" name="form.deleted" tal:condition="code != '1'">
|
|
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<br />
|
|
<h3>EXPERTS</h3>
|
|
<p>
|
|
<a class="btn btn-success" role="button" href="/expert_edit/${code}/0" tal:condition="code != '1'">
|
|
<span class="glyphicon glyphicon-plus"></span> Nouvel expert</a>
|
|
</p>
|
|
<table class="table table-bordered table-condensed">
|
|
<tr>
|
|
<th>Code</th>
|
|
<th>Nom expert</th>
|
|
<th>Tél 1</th>
|
|
<th>Tél 2</th>
|
|
<th>Email</th>
|
|
</tr>
|
|
<tr tal:repeat="expert experts">
|
|
<td tal:condition="expert.en_activite==0" class="bg-danger">${expert.CODE_EXP}</td>
|
|
<td tal:condition="expert.en_activite!=0">${expert.CODE_EXP}</td>
|
|
<td>
|
|
<a href="/expert_edit/${expert.CODE_CAB}/${expert.CODE_EXP}">${expert.NOM}</a>
|
|
</td>
|
|
<td>${expert.TEL1}</td>
|
|
<td>${expert.TEL2}</td>
|
|
<td>${expert.email}</td>
|
|
</tr>
|
|
</table>
|
|
<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() {
|
|
$('#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>
|