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>
|
||||
Reference in New Issue
Block a user