ajout cabinet+experts
This commit is contained in:
184
mondumas/templates/parametres/cabinet_edit.pt
Normal file
184
mondumas/templates/parametres/cabinet_edit.pt
Normal file
@@ -0,0 +1,184 @@
|
||||
<metal:block use-macro="main_template">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div tal:condition="message" tal:content="message" class="alert alert-danger" />
|
||||
<br />
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#tab_cabinet"><b>CABINET</b></a></li>
|
||||
<li><a data-toggle="tab" href="#tab_experts"><b>EXPERTS</b></a></li>
|
||||
</ul>
|
||||
<!-- PANEL SUIVI -->
|
||||
<div class="tab-content">
|
||||
<div id="tab_cabinet" class="tab-pane fade in active">
|
||||
|
||||
<h3>CABINET</h3>
|
||||
<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="${cabinet.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="${cabinet.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="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">
|
||||
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
||||
<button class="btn btn-danger" type="submit" name="form.deleted" tal:condition="cabinet.CODE != '0'">
|
||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- PANEL EXPERTS -->
|
||||
<div id="tab_experts" class="tab-pane fade">
|
||||
<h3>EXPERTS</h3>
|
||||
<p>
|
||||
<a class="btn btn-success" role="button" href="/expert_edit/${cabinet.CODE}/0">
|
||||
<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>${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>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
57
mondumas/templates/parametres/cabinets.pt
Normal file
57
mondumas/templates/parametres/cabinets.pt
Normal file
@@ -0,0 +1,57 @@
|
||||
<metal:block use-macro="main_template">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<p>
|
||||
<a href="${request.application_url}/parametres" class="btn btn-default" role="button">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
|
||||
<a href="${request.application_url}/cabinet_edit/0" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouvelle cause</a>
|
||||
</p>
|
||||
|
||||
<table id="cabinets" class="table table-striped table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<th>Nom</th>
|
||||
<th>Tél. 1</th>
|
||||
<th>Tél. 2</th>
|
||||
<th>Portable</th>
|
||||
<th>Ville</th>
|
||||
<th>Modif le</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<script type="text/javascript">
|
||||
var dataSet = ${dt_data};
|
||||
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.moment('DD/MM/YYYY - HH:mm');
|
||||
$('#cabinets').DataTable({
|
||||
data: dataSet,
|
||||
pageLength: 50,
|
||||
bLengthChange: false,
|
||||
language: {
|
||||
url: 'https://cdn.datatables.net/plug-ins/1.10.16/i18n/French.json'
|
||||
},
|
||||
order: [[ 1, "asc" ]],
|
||||
columnDefs: [
|
||||
{ targets: 1,
|
||||
"render": function (data, type, row, meta) {
|
||||
// ajouter un link vers la fiche élève
|
||||
return '<a href="/cabinet_edit/' + row[0] + '">' + data + '</a>';
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</div><!-- content -->
|
||||
</metal:block>
|
||||
|
||||
|
||||
116
mondumas/templates/parametres/expert_edit.pt
Normal file
116
mondumas/templates/parametres/expert_edit.pt
Normal file
@@ -0,0 +1,116 @@
|
||||
<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>
|
||||
@@ -21,6 +21,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row text-center">
|
||||
<div class="col-sm-3">
|
||||
<a href="${request.application_url}/cabinets"><span class="glyphicon glyphicon-list logo-primary"></span></a>
|
||||
<h4>CABINETS EXP.</h4>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row text-center">
|
||||
<div class="col-sm-3">
|
||||
<a href="${request.application_url}/dashboard"><span class="glyphicon glyphicon-dashboard logo-primary"></span></a>
|
||||
|
||||
Reference in New Issue
Block a user