refonte de folder.pt et docs_search.pt

This commit is contained in:
2021-09-13 15:04:39 +02:00
parent 24a23c5f94
commit dd8cdb7564
5 changed files with 277 additions and 193 deletions

View File

@@ -20,24 +20,28 @@
</div><!-- row -->
<div class="row">
<div tal:condition="docs">
<table class="table table-striped table-bordered">
<tr tal:repeat="ligne docs">
<td><a href="/doc_view/${ligne.doc_id}"><b>${ligne.intitule}</b></a></td>
<td>${ligne.tag1}</td>
<td>${ligne.cree_le.strftime("%d-%m-%Y")}</td>
<td>${ligne.modif_le.strftime("%d-%m-%Y")}</td>
</tr>
<div tal:condition="dt_data != '[]'">
<table id="folder_list" class="table">
<thead>
<tr>
<th>Titre</th>
<th>Tags</th>
<th>Date</th>
<th></th>
</tr>
</thead>
</table>
</div>
<div tal:condition="not docs">
<p class="text-danger text-center">Aucun document ne correspond à la recherche</p>
<div tal:condition="dt_data == '[]'">
<h3 class="text-center">Aucun élément trouvé pour ce critère</h3>
</div>
</div>
<br />
<br />
<script>
<script type="text/javascript">
var dataSet = ${dt_data};
$(document).ready(function() {
$('#search-form').formValidation({
framework: 'bootstrap',
@@ -62,6 +66,23 @@ $(document).ready(function() {
},
}
});
$.fn.dataTable.moment('DD/MM/YYYY - HH:mm');
$('#folder_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, row, meta) {
// ajouter un link vers le formulaire
return '<a href="/doc_view/' + row[3] + '">' + data + '</a>';
},
},
]
});
$('form input').on('keypress', function(e) {
var code = e.keyCode || e.which;
if (code === 13) {