98 lines
2.7 KiB
XML
98 lines
2.7 KiB
XML
<metal:block use-macro="main_template">
|
|
<div metal:fill-slot="content">
|
|
|
|
<div class="alert alert-danger" tal:condition="message" tal:content="message" />
|
|
|
|
<div class="row">
|
|
|
|
<form id="site-search-form" class="form-horizontal" role="form" 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-4" for="societe">Sociéte</label>
|
|
<div class="col-xs-8">
|
|
<select class="form-control" id="societe" name="societe">
|
|
<div tal:repeat="item societes">
|
|
<option value="${item}" tal:attributes="selected societe==item and 'selected' or None">${item}</option>
|
|
</div>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">Nom ou numéro du chantier</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control" name="name" value="${name}"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-min="2"
|
|
data-fv-stringlength-max="30"
|
|
data-fv-stringlength-message="Le nom ou le numéro doit avoir de 2 à 30 caractères de long" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-sm-offset-4 col-sm-8">
|
|
<button class="btn btn-primary" type="submit" name="form.submitted">
|
|
<span class="glyphicon glyphicon-search"></span> Rechercher</button>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div><!-- row -->
|
|
|
|
<div class="row">
|
|
<table id="dossiers_list" class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Numéro</th>
|
|
<th>Date</th>
|
|
<th>Client</th>
|
|
<th>Chantier</th>
|
|
<th class="text-right">Montant</th>
|
|
<th>Sinistre</th>
|
|
<th class="text-center">Statut</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<br />
|
|
<br />
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var dataSet = ${dt_data};
|
|
var goto_url = '${goto_url}';
|
|
var order_option = '${order_option}'
|
|
|
|
$(document).ready(function() {
|
|
$.fn.dataTable.moment('DD-MM-YYYY');
|
|
$('#dossiers_list').DataTable({
|
|
data: dataSet,
|
|
pageLength: 50,
|
|
bLengthChange: false,
|
|
language: {
|
|
url: 'https://cdn.datatables.net/plug-ins/1.10.16/i18n/French.json'
|
|
},
|
|
order: [[0, order_option]],
|
|
columnDefs: [
|
|
{ "targets": 0,
|
|
"render": function (data, type, full, meta) {
|
|
// ajouter un link vers le formulaire
|
|
return '<a href="' + goto_url + data + '">' + data + '</a>';
|
|
},
|
|
},
|
|
]
|
|
});
|
|
|
|
});
|
|
$('#site-search-form').formValidation();
|
|
$('form input').on('keypress', function(e) {
|
|
return e.which !== 13;
|
|
});
|
|
|
|
</script>
|
|
|
|
</div>
|
|
</metal:block>
|