100 lines
4.2 KiB
Django/Jinja
100 lines
4.2 KiB
Django/Jinja
{% extends "layout.jinja2" %}
|
|
|
|
{% block content %}
|
|
|
|
<form action="{{ url }}" method="post" class="form">
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="title">Titre</label>
|
|
<input class="form-control" name="title" type="text" value="{{entry.title}}" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="body">Corps du texte</label>
|
|
<textarea class="form-control monospace-font" id="body" name="body" required rows="20" cols="35">
|
|
{{ entry.body }}
|
|
</textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="tag">Tag</label>
|
|
<select class="form-control" id="tag" name="tag" value="{{ entry.tag }}">
|
|
{% for x in tags %}
|
|
<option value="{{x.tag}}"
|
|
{% if entry.tag == x.tag %} selected {% endif %}>{{x.tag_name}}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="author">Auteur}</label>
|
|
<input class="form-control" name="author" type="text" value="{{entry.author}}" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="status">Statut</label>
|
|
<select class="form-control" id="status" name="status" value="{{ entry.status}}">
|
|
<option value="brouillon"
|
|
{% if entry.status == "brouillon" %} selected {% endif %}>Brouillon</option>
|
|
<option value="privé"
|
|
{% if entry.status == "privé" %} selected {% endif %}>Privé</option>
|
|
<option value="publié"
|
|
{% if entry.status == "publié" %} selected {% endif %}>Publié</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="created">Créé le</label>
|
|
<input class="form-control" name="created" type="text" value="{{entry.created}}" required>
|
|
</div>
|
|
|
|
<p>
|
|
Topic : <strong>{{ entry.topic_id }}</strong><br>
|
|
{% if blog_id != '0' %}
|
|
Modifié le : <strong>{{ entry.edit_date }}</strong>
|
|
{% endif %}
|
|
</p>
|
|
<br />
|
|
<div class="form-group">
|
|
<a class="btn btn-default" href="{{ request.route_url('topic', topic=entry.topic_id) }}">
|
|
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
|
|
<button class="btn btn-primary" type="submit" name="form.submitted">
|
|
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
|
{% if blog_id != '0' %}
|
|
<button class="btn btn-danger" type="button" data-toggle="modal" data-target="#confirmDelete">
|
|
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<p class="text-center">Apprendre la syntaxe de <a href="https://daringfireball.net/projects/markdown/syntax"
|
|
target="_blank">Markdown</a></li></p>
|
|
|
|
</form>
|
|
|
|
<!-- Modal : Confirmation SUPRESSION -->
|
|
<div id="confirmDelete" class="modal" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="modal-title">Supprimer une page</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<!-- The form is placed inside the body of modal -->
|
|
<p>Etes-vous certain(e) de vouloir supprimer <b>{{ entry.title }}</b> ?</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="form-group">
|
|
<div class="text-center">
|
|
<form id="confirmForm" method="post">
|
|
<button type="submit" class="btn btn-danger" name="form.deleted">Supprimer</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|