afpy.org/templates/edit_post.html

83 lines
2.8 KiB
HTML

{% extends '_layout.jinja2' %}
{% block script %}
<script type="text/javascript" src="{{ url_for('static', filename='js/nicEdit.js') }}"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() {
new nicEditor({
buttonList : ['fontFormat','bold','italic','underline','strikeThrough','subscript','superscript','link','unlink','xhtml']
}).panelInstance('content');
});
</script>
{% endblock script %}
{% block header %}
<h1>
{% if post %}
Modification d'un article
{% else %}
Création d'un article
{% endif %}
</h1>
{% endblock header %}
{% block main %}
<article>
<form method="post" enctype="multipart/form-data">
<label>Titre
<input name="title" value="{{ post.title }}" />
</label>
<label>Description
<textarea name="summary">{{ post.summary }}</textarea>
</label>
<label>Image
{% if post._image %}
<img alt="" src="{{ url_for('post_image', path=post._image) }}" />
<input name="_image_path" id="_image_path" value="{{ post._image }}" type="hidden"/>
<input type="submit" name="delete_image" value="Supprimer l'image" class="button" />
{% endif %}
<input name="image" id="image" type="file" value="{{ post.image }}" />
</label>
<label>Contenu de l'article
<textarea name="content" id="content">{{ post.content }}</textarea>
</label>
{% if name == 'emplois' %}
<label>Entreprise
<input name="company" value="{{ post.company }}" />
</label>
<label>Adresse
<input name="address" value="{{ post.address }}" />
</label>
<label>Personne à contacter
<input name="contact" value="{{ post.contact }}" />
</label>
<label>Téléphone
<input name="phone" value="{{ post.phone }}" />
</label>
{% endif %}
<label>Adresse e-mail
<input name="email" type="email" value="{{ post.email }}" />
</label>
<input type="submit" name="edit" value="Enregistrer" />
{% if admin %}
{% if post._state == 'waiting' %}
<input type="submit" name="publish" value="Publier" />
{% elif post._state == 'published' %}
<input type="submit" name="unpublish" value="Dépublier" />
{% else %}
<input type="submit" name="republish" value="Republier" />
{% endif %}
{% endif %}
{% if post._state == 'published' %}
<input type="submit" name="trash" value="Supprimer" />
{% endif %}
</form>
{% if name == 'actualites' %}
<p>
L'adresse e-mail n'est pas rendue publique, elle est uniquement
utilisée par les modérateurs pour vous contacter si nécessaire.
</p>
{% endif %}
</article>
{% endblock main %}