Merge branch 'master' of https://bitbucket.org/ctphuoc/caotek_mesavoirs
This commit is contained in:
64
caotek_mesavoirs/templates/categorie_edit.pt
Normal file
64
caotek_mesavoirs/templates/categorie_edit.pt
Normal file
@@ -0,0 +1,64 @@
|
||||
<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="categorie_edit-form" class="form-horizontal" action="${url}" method="post" tal:condition="categorie"
|
||||
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">Categorie</label>
|
||||
<div class="col-xs-3">
|
||||
<input class="form-control" type="text" name="categorie"
|
||||
value="${categorie.categorie}" 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="pc_cible">Pourcentage cible</label>
|
||||
<div class="col-xs-2">
|
||||
<input class="form-control" type="text" id="pc_cible" name="pc_cible" value="${categorie.pc_cible}"
|
||||
data-fv-digits="true"
|
||||
data-fv-digits-message="Le nombre doit être composé que de chiffres" />
|
||||
</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}/categories_list">
|
||||
<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="categorie.no_cat <> 0">
|
||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
</div> <!-- row -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#categorie_edit-form').formValidation();
|
||||
$('form input').on('keypress', function(e) {
|
||||
return e.which !== 13;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</metal:block>
|
||||
@@ -2,6 +2,34 @@
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div tal:condition="message" tal:content="message" class="alert alert-danger" />
|
||||
|
||||
<p>
|
||||
<a href="categorie_edit/0" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouvelle categorie</a>
|
||||
</p>
|
||||
<div class="col-md-6">
|
||||
<table id="categories_list" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Categorie</th>
|
||||
<th class="text-right">% cible</th>
|
||||
<th class="text-right">% atteint</th>
|
||||
<th class="text-right">Valeur</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr tal:repeat="item items">
|
||||
<td class="${item.bg}"><a href="categorie_edit/${item.no_cat}">${item.categorie}</a></td>
|
||||
<td class="text-right">${layout.to_percent(item.pc_cible)}</td>
|
||||
<td class="text-right">${layout.to_percent(item.pc_atteint)}</td>
|
||||
<td class="text-right">${layout.to_euro(item.valeur)}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
</div><!-- content -->
|
||||
</metal:block>
|
||||
|
||||
Reference in New Issue
Block a user