Files
dumas_gestion/mondumas/templates/parametres/text_edit.pt
2020-03-12 22:33:40 +01:00

70 lines
2.4 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="text_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="text-text">Texte</label>
<div class="col-xs-8">
<textarea class="form-control monospace-font" rows="15" cols="40" id="text-text" name="texte">${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>&nbsp;Enregistrer</button>
<a href="${request.application_url}/text_view/${text_id}" class="btn btn-default" role="button">
<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Annuler</a>
</div>
</div>
<div class="form-group" tal:condition="text_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>&nbsp;Supprimer</button>
</div>
</div>
</form>
<br />
<br />
</div> <!-- row -->
<script>
$(document).ready(function() {
$('#text_edit-form').formValidation();
$('form input').on('keypress', function(e) {
return e.which !== 13;
});
});
</script>
</div>
</metal:block>