97 lines
3.6 KiB
Django/Jinja
97 lines
3.6 KiB
Django/Jinja
{% extends "cao_blogr:templates/layout.jinja2" %}
|
|
|
|
{% block content %}
|
|
|
|
<form action="{{ url }}" method="post" class="form">
|
|
|
|
{% for error in form.topic.errors %}
|
|
<div class="error">{{ error }}</div>
|
|
{% endfor %}
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="topic">{{form.topic.label}}</label>
|
|
{{form.topic(class_='form-control')}}
|
|
</div>
|
|
|
|
{% for error in form.topic_name.errors %}
|
|
<div class="error">{{error}}</div>
|
|
{% endfor %}
|
|
|
|
<div class="form-group">
|
|
<label class="required-field" for="topic_name">{{form.topic_name.label}}</label>
|
|
{{form.topic_name(class_='form-control')}}
|
|
</div>
|
|
|
|
{% for error in form.topic_quote.errors %}
|
|
<div class="error">{{ error }}</div>
|
|
{% endfor %}
|
|
<div class="form-group">
|
|
<label class="required-field" for="topic_quote">{{ form.topic_quote.label }}</label>
|
|
{{ form.topic_quote(class_='form-control monospace-font', cols="35", rows="5") }}
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<a class="btn btn-default" href="{{ request.route_url('topics') }}">
|
|
<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 form.topic.data %}
|
|
<button class="btn btn-danger" type="button" data-toggle="modal" data-target="#confirmDelete">
|
|
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
|
{% endif %}
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|
|
<h3>Sous-rubriques</h3>
|
|
<p><a href="{{ request.route_url('tag_edit', topic=form.topic.data, id='0') }}" class="btn btn-success" role="button">
|
|
<span class="glyphicon glyphicon-plus"></span> Nouveau</a>
|
|
</p>
|
|
|
|
<table id="users_list" class="table table-striped table-bordered table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Sous-rubrique</th>
|
|
<th>Intitulé</th>
|
|
</tr>
|
|
</thead>
|
|
{% for entry in tags %}
|
|
<tr>
|
|
<td>{{ entry.tag }}</td>
|
|
<td>
|
|
<a href="{{ request.route_url('tag_edit', topic=form.topic.data, id=entry.id) }}">
|
|
{{ entry.tag_name }}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
|
|
<!-- 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 la rubrique</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<!-- The form is placed inside the body of modal -->
|
|
<p>Etes-vous certain(e) de vouloir supprimer la rubrique <b>{{ form.topic_name.data }}</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 %}
|