refonte de la partie contents
This commit is contained in:
97
caotek_mesavoirs/templates/contents/doc_edit.pt
Normal file
97
caotek_mesavoirs/templates/contents/doc_edit.pt
Normal file
@@ -0,0 +1,97 @@
|
||||
<div metal:use-macro="load: ../global_layout.pt">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div class="alert alert-danger" tal:condition="message" tal:content="message" />
|
||||
|
||||
<div class="row">
|
||||
<form id="doc_edit-form" action="${url}" method="post" class="form-horizontal">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="intitule">Intitulé</label>
|
||||
<div class="col-xs-10">
|
||||
<input class="form-control" type="text" id="intitule" name="intitule" value="${doc.intitule}"
|
||||
data-fv-notempty="true"
|
||||
data-fv-notempty-message="L'intitule est obligatoire"
|
||||
data-fv-stringlength="true"
|
||||
data-fv-stringlength-max="100"
|
||||
data-fv-stringlength-message="100 caractères maximum" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="texte">Texte</label>
|
||||
<div class="col-xs-10">
|
||||
<textarea class="form-control monospace-font" rows="15" cols="40" id="texte" name="texte">${doc.texte}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="theme">Thème</label>
|
||||
<div class="col-xs-6">
|
||||
<select class="form-control" id="theme" name="theme">
|
||||
<div tal:repeat="item themes">
|
||||
<option value="${item.theme}" tal:attributes="selected doc.theme==item.theme and 'selected' or None">${item.theme}</option>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="tag1">Tag 1</label>
|
||||
<div class="col-xs-6">
|
||||
<select class="form-control" id="tag1" name="tag1">
|
||||
<div tal:repeat="item tags">
|
||||
<option value="${item.tag}" tal:attributes="selected doc.tag1==item.tag and 'selected' or None">${item.tag}</option>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="tag2">Tag 2</label>
|
||||
<div class="col-xs-6">
|
||||
<input type="text" class="form-control" name="tag2" value="${doc.tag2}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2" for="tag2">Statut</label>
|
||||
<div class="col-xs-6">
|
||||
<select class="form-control" id="tag1" name="tag1">
|
||||
<div tal:repeat="item statuts">
|
||||
<option value="${item}" tal:attributes="selected doc.statut==item and 'selected' or None">${item}</option>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="${request.application_url}/doc_view/${doc_id}" class="btn btn-default" role="button">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span> Annuler</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="doc_id != '0'">
|
||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
</div> <!-- row -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#doc_edit-form').formValidation({
|
||||
framework: 'bootstrap',
|
||||
message: 'This value is not valid',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
});
|
||||
$('form input').on('keypress', function(e) {
|
||||
return e.which !== 13;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
77
caotek_mesavoirs/templates/contents/doc_search.pt
Normal file
77
caotek_mesavoirs/templates/contents/doc_search.pt
Normal file
@@ -0,0 +1,77 @@
|
||||
<div metal:use-macro="load: ../global_layout.pt">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div class="row">
|
||||
<form id="search-form" class="form-horizontal" role="form" action="/doc_search" method="post">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-8">
|
||||
<div class="input-group" align="center">
|
||||
<input type="text" class="form-control" name="critere" value="${critere}" />
|
||||
<span class="input-group-btn">
|
||||
<button id="submitButton" class="btn btn-primary" type="submit" name="form.submitted">
|
||||
Rechercher
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
</table>
|
||||
</div>
|
||||
<div tal:condition="not docs">
|
||||
<p class="text-danger text-center">Aucun document ne correspond à la recherche</p>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#search-form').formValidation({
|
||||
framework: 'bootstrap',
|
||||
message: 'This value is not valid',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
fields: {
|
||||
critere: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: 'Veuillez saisir le texte à rechercher'
|
||||
},
|
||||
stringLength: {
|
||||
min: 3,
|
||||
max: 30,
|
||||
message: 'Le texte doit avoir de 3 à 30 caractères de long'
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$('form input').on('keypress', function(e) {
|
||||
var code = e.keyCode || e.which;
|
||||
if (code === 13) {
|
||||
e.preventDefault();
|
||||
// simuler clic bouton submit
|
||||
document.getElementById("submitButton").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
24
caotek_mesavoirs/templates/contents/doc_view.pt
Normal file
24
caotek_mesavoirs/templates/contents/doc_view.pt
Normal file
@@ -0,0 +1,24 @@
|
||||
<div metal:use-macro="load: ../global_layout.pt">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<p>
|
||||
<a href="${url_retour}">[ Fermer ]</a>
|
||||
<a href="${request.application_url}/doc_edit/${doc_id}" tal:condition="not layout.isAnonymous()">[ Modifier ]</a>
|
||||
</p>
|
||||
<hr>
|
||||
<div tal:replace="structure texte">
|
||||
Page text goes here.
|
||||
</div>
|
||||
<hr>
|
||||
Dernière modification le ${doc.modif_le.strftime('%d/%m/%Y')}<br />
|
||||
Tags : ${tags}
|
||||
|
||||
<div tal:condition="not layout.isAnonymous">
|
||||
Status : ${doc.statut}
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
19
caotek_mesavoirs/templates/contents/folder.pt
Normal file
19
caotek_mesavoirs/templates/contents/folder.pt
Normal file
@@ -0,0 +1,19 @@
|
||||
<div metal:use-macro="load: ../global_layout.pt">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div class="row">
|
||||
<table class="table">
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user