102 lines
3.5 KiB
XML
102 lines
3.5 KiB
XML
<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="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">
|
|
<label class="control-label col-xs-2">Dossier</label>
|
|
<div class="col-xs-7">
|
|
<p class="form-control-static">${doc.topic}</p>
|
|
</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" tal:condition="doc_id!='0'">
|
|
<span class="glyphicon glyphicon-chevron-left"></span> Annuler</a>
|
|
<a href="${request.application_url}/folder/article" class="btn btn-default" role="button" tal:condition="doc_id=='0'">
|
|
<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>
|
|
<br />
|
|
<div class="col-xs-6">
|
|
<h3>Tags</h3>
|
|
<table class="table table-condensed">
|
|
<tbody>
|
|
<tr tal:repeat="ligne tags">
|
|
<td>${ligne.tag}</td>
|
|
<td><a href="/tag_change/DEL/${doc.topic}/${ligne.doc_id}/${ligne.tag}">[ supprimer ]</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-xs-6">
|
|
<h3>Tags à ajouter</h3>
|
|
<table class="table table-condensed">
|
|
<tbody>
|
|
<tr tal:repeat="ligne d_tags">
|
|
<td>${ligne.tag}</td>
|
|
<td><a href="/tag_change/ADD/${doc.topic}/${doc.doc_id}/${ligne.tag}">[ ajouter ]</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</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>
|