added actif2_edit.pt

This commit is contained in:
2017-07-24 12:54:24 +02:00
parent a2c5ac2cfe
commit 4c76a07a58
6 changed files with 171 additions and 39 deletions

View File

@@ -2,7 +2,7 @@
<div metal:fill-slot="content">
<div tal:condition="message" tal:content="message" class="alert alert-danger" />
<form id="actif_list-form" action="${request.application_url}" method="post">
<form id="actif_list-form" action="${url}" method="post">
<div class="form-group">
<div class="form-group">
<button class="btn btn-primary" type="submit" name="form.submitted">
@@ -13,7 +13,7 @@
</div>
</form>
<table id="actifs_list" class="table table-striped table-bordered">
<table id="actifs_list" class="table table-condensed table-bordered">
<thead>
<tr>
<th>Catégorie</th>
@@ -24,9 +24,22 @@
<th>PRU</th>
<th>Valeur</th>
<th>Plus-Value</th>
<th>No</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="ligne items">
<td class="${ligne.bg}">${ligne.categorie}</td>
<td>${ligne.symbole}</td>
<td tal:condition="ligne.categorie[:6]=='Action'"><a href="actif_edit/${ligne.no_id}">${ligne.libelle}</a></td>
<td tal:condition="ligne.categorie[:6]<>'Action'"><a href="actif2_edit/${ligne.no_id}">${ligne.libelle}</a></td>
<td class="text-right">${ligne.nombre}</td>
<td class="text-right">${ligne.cours}</td>
<td class="text-right">${layout.to_euro(ligne.pru)}</td>
<td class="text-right">${layout.to_euro(ligne.valeur)}</td>
<td tal:condition="ligne.plus_value>=0" class="text-right" style="color: green;">${layout.to_euro(ligne.plus_value)}</td>
<td tal:condition="ligne.plus_value <0" class="text-right" style="color: red;">${layout.to_euro(ligne.plus_value)}</td>
</tr>
</tbody>
</table>
<br />
@@ -55,30 +68,6 @@
</div>
</div>
<script type="text/javascript">
var dataSet = ${dt_data};
$(document).ready(function() {
$.fn.dataTable.moment('DD/MM/YYYY - HH:mm');
$('#actifs_list').DataTable({
data: dataSet,
pageLength: 50,
bLengthChange: false,
columnDefs: [
{ className: "text-right", "targets": [3,4,5,6,7] },
{ "targets": 8,
"render": function (data, type, full, meta) {
// ajouter un link vers le formulaire
return '<a class="btn btn-primary btn-sm" role="button" href="/actif_edit/' + data +
'"><span class="glyphicon glyphicon-pencil"></span> </a>';
},
},
]
});
});
</script>
</div><!-- content -->
</metal:block>