76 lines
2.6 KiB
XML
76 lines
2.6 KiB
XML
<metal:block use-macro="main_template">
|
|
<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-8">
|
|
<input class="form-control" type="text" id="intitule" name="intitule" value="${intitule}"
|
|
placeholder="40 caractères maximum"
|
|
data-fv-notempty="true"
|
|
data-fv-notempty-message="L'intitule est obligatoire"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="40"
|
|
data-fv-stringlength-message="40 caractères maximum" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-2" for="doc-text">Texte</label>
|
|
<div class="col-xs-8">
|
|
<textarea class="form-control" rows="15" cols="40" id="doc-text" name="texte"
|
|
data-fv-notempty="true"
|
|
data-fv-notempty-message="Le texte est obligatoire"
|
|
data-fv-stringlength="true"
|
|
data-fv-stringlength-max="30000"
|
|
data-fv-stringlength-message="30000 caractères maximum">${texte}
|
|
</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-2" for="theme">Thème</label>
|
|
<div class="col-xs-4">
|
|
<select class="form-control" id="theme" name="theme">
|
|
<div tal:repeat="item themes">
|
|
<option value="${item}" tal:attributes="selected theme==item and 'selected' or None">${item}</option>
|
|
</div>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-sm-offset-2 col-sm-8">
|
|
<button class="btn btn-primary" type="submit" name="form.submitted">
|
|
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
|
<a href="${request.application_url}/doc_view/${doc_id}" class="btn btn-default" role="button">
|
|
<span class="glyphicon glyphicon-chevron-left"></span> Annuler</a>
|
|
</div>
|
|
</div>
|
|
<div class="form-group" tal:condition="doc_id<>'0'">
|
|
<div class="col-sm-offset-2 col-sm-8">
|
|
<button class="btn btn-warning" type="submit" name="form.deleted">
|
|
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<br />
|
|
<br />
|
|
</div> <!-- row -->
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#doc_edit-form').formValidation();
|
|
$('form input').on('keypress', function(e) {
|
|
return e.which !== 13;
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</div>
|
|
</metal:block>
|