ajout actif_list.pt et actif_edit.pt
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div class="content text-center">
|
||||
<img src="${request.static_url('mondumas:static/img/globe.png')}" width="90" />
|
||||
<img src="${request.static_url('caotek_mesavoirs:static/img/globe.png')}" width="90" />
|
||||
<br />
|
||||
<br />
|
||||
<p class="lead"><span class="font-semi-bold">404</span> Page non trouvée</p>
|
||||
|
||||
83
caotek_mesavoirs/templates/actif_edit.pt
Normal file
83
caotek_mesavoirs/templates/actif_edit.pt
Normal file
@@ -0,0 +1,83 @@
|
||||
<metal:block use-macro="main_template">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div tal:condition="message" tal:content="message" class="alert alert-danger" />
|
||||
<br />
|
||||
<div class="row">
|
||||
<form id="actif_edit-form" class="form-horizontal" action="${url}" method="post" tal:condition="actif"
|
||||
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="col-xs-2 control-label">Symbole</label>
|
||||
<div class="col-xs-3">
|
||||
<input class="form-control" type="text" name="symbole"
|
||||
value="${actif.symbole}" placeholder="15 caractères maximum"
|
||||
data-fv-notempty="true"
|
||||
data-fv-notempty-message="Le symbole est obligatoire"
|
||||
data-fv-stringlength="true"
|
||||
data-fv-stringlength-max="15"
|
||||
data-fv-stringlength-message="15 caractères maximum" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="categorie">Catégorie</label>
|
||||
<div class="col-xs-3">
|
||||
<select class="form-control" id="categorie" name="categorie">
|
||||
<div tal:repeat="item categories_list">
|
||||
<option value="${item.categorie}" tal:attributes="selected actif.categorie==item.categorie and 'selected' or None">${item.categorie}</option>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="nombre">Nombre</label>
|
||||
<div class="col-xs-2">
|
||||
<input class="form-control" type="text" id="nombre" name="nombre" value="${actif.nombre}"
|
||||
data-fv-digits="true"
|
||||
data-fv-digits-message="Le nombre doit être composé que de chiffres" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="pru">PRU</label>
|
||||
<div class="col-xs-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">€</div>
|
||||
<input class="form-control" type="text" id="pru" name="pru" value="${actif.pru}"
|
||||
data-fv-numeric="true"
|
||||
data-fv-numeric-message="Le nombre doit être composé de chiffres et/ou de ." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group">
|
||||
<div class="col-xs-offset-2 col-xs-10">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-default" href="${request.application_url}/home"><span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
|
||||
<button class="btn btn-primary" type="submit" name="form.submitted">
|
||||
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
||||
<button class="btn btn-warning" type="submit" name="form.deleted"
|
||||
tal:condition="actif.no_id <> 0">
|
||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
</div> <!-- row -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#actif_edit-form').formValidation();
|
||||
$('form input').on('keypress', function(e) {
|
||||
return e.which !== 13;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</metal:block>
|
||||
@@ -1,11 +1,52 @@
|
||||
<metal:block use-macro="main_template">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div class="container-fluid text-center">
|
||||
<p>
|
||||
<a href="${request.application_url}/actif_edit/0" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouvel actif</a>
|
||||
</p>
|
||||
|
||||
<table id="actifs_list" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Symbole</th>
|
||||
<th>Libellé</th>
|
||||
<th>Catégorie</th>
|
||||
<th>Nombre</th>
|
||||
<th>Cours</th>
|
||||
<th>PRU</th>
|
||||
<th>Valeur</th>
|
||||
<th>Plus-Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<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": [4,5,6,7,8] },
|
||||
{ "targets": 0,
|
||||
"render": function (data, type, full, meta) {
|
||||
// ajouter un link vers le formulaire
|
||||
return '<a href="/actif_edit/' + data + '">' + data + '</a>';
|
||||
},
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</div><!-- content -->
|
||||
</metal:block>
|
||||
|
||||
Reference in New Issue
Block a user