Files
dumas_gestion/mondumas/templates/chantier_lookup.pt

106 lines
3.0 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">Societe</label>
<div class="col-xs-3">
<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-xs-4 control-label">Nom ou numéro du chantier</label>
<div class="col-xs-8">
<input type="text" class="form-control" name="name" value="${name}"
data-fv-notempty="true"
data-fv-notempty-message="Le nom ou le numéro est obligatoire"
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>
<!-- case a cocher "Afficher fiches cloturées" -->
<div class="form-group">
<div class="col-xs-offset-4 col-xs-8">
<input type="checkbox" name="cb_tous" value="cb_tous"
tal:attributes="checked cb_tous == 'oui' and 'checked' or None">
Afficher les chantiers cloturées</input>
</div>
</div>
<div class="form-group">
<div class="col-xs-offset-4 col-xs-8">
<button class="btn btn-primary" type="submit" name="form.submitted">
<span class="glyphicon glyphicon-search"></span>&nbsp;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};
$(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'
},
columnDefs: [
{ "targets": 0,
"render": function (data, type, full, meta) {
// ajouter un link vers le formulaire
return '<a href="/dossier_view/' + data + '">' + data + '</a>';
},
},
]
});
});
$('#site-search-form').formValidation();
$('form input').on('keypress', function(e) {
return e.which !== 13;
});
</script>
</div>
</metal:block>