ajout p_texts

This commit is contained in:
2020-03-12 22:33:40 +01:00
parent 932fc6a441
commit ae4484374f
14 changed files with 327 additions and 28 deletions

View File

@@ -11,6 +11,10 @@
<a href="${request.application_url}/rdf_causes_list"><span class="glyphicon glyphicon-tint logo-primary"></span></a>
<h4>RDF : CAUSES</h4>
</div>
<div class="col-sm-3">
<a href="${request.application_url}/text_list"><span class="glyphicon glyphicon-list-alt logo-primary"></span></a>
<h4>TEXTES EMAIL</h4>
</div>
</div>
<br />
<div class="row text-center">

View File

@@ -0,0 +1,69 @@
<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>

View File

@@ -0,0 +1,31 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<div class="row">
<p>
<a href="text_edit/0" class="btn btn-success" role="button">
<span class="glyphicon glyphicon-plus"></span>&nbsp;
Créer un nouveau texte</a>
</p>
<table class="table table-condensed table-striped table-bordered">
<tr>
<th>Intitulé</th>
<th>Thème</th>
<th>Dernière mise à jour</th>
</tr>
<tr tal:repeat="ligne texts">
<td><a href="text_view/${ligne.text_id}">${ligne.intitule}</a></td>
<td>${ligne.theme}</td>
<td><span tal:content="ligne.modif_le.strftime('%d/%m/%Y %H:%M')" /></td>
</tr>
</table>
</div>
<br />
<br />
</div>
</metal:block>

View File

@@ -0,0 +1,18 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<br />
<a href="${request.application_url}/text_list" class="btn btn-default" role="button">
<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Fermer</a>
<a href="${request.application_url}/text_edit/${text_id}" class="btn btn-primary" role="button">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;Modifier</a>
<br />
<hr>
<div tal:replace="structure texte">Page text goes here.</div>
<hr>
<br />
<br />
</div>
</metal:block>