added tag_edit
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
<p>{{ body_html | safe }}</p>
|
||||
<hr/>
|
||||
<p>
|
||||
Publié le : <strong title="{{ entry.created }}">{{ entry.edited.strftime("%d-%m-%Y - %H:%M") }}</strong>
|
||||
Auteur : <strong>{{ entry.author }}</strong><br>
|
||||
Publié le : <strong>{{ entry.created.strftime("%d-%m-%Y - %H:%M") }}</strong><br>
|
||||
</p>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
{{ form.tag(class_='form-control') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="required-field" for="author">{{ form.author.label }}</label>
|
||||
{{ form.author(class_='form-control') }}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Topic : <strong>{{ entry.topic_id }}</strong>
|
||||
{% if blog_id != '0' %}
|
||||
|
||||
@@ -150,10 +150,10 @@
|
||||
<ul>
|
||||
{% for entry in last_five %}
|
||||
<li>
|
||||
{{ entry.edited.strftime("%d-%m-%Y") }}
|
||||
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">
|
||||
<span class="glyphicon glyphicon-menu-right"></span> {{ entry.title }}
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
— {{ entry.author }}, {{ entry.created.strftime("%d-%m-%Y") }}
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
64
cao_blogr/templates/tag_edit.jinja2
Normal file
64
cao_blogr/templates/tag_edit.jinja2
Normal file
@@ -0,0 +1,64 @@
|
||||
{% extends "cao_blogr:templates/layout.jinja2" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form action="{{ url }}" method="post" class="form">
|
||||
|
||||
{% for error in form.tag.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="form-group">
|
||||
<label class="required-field" for="tag">{{form.tag.label}}</label>
|
||||
{{form.tag(class_='form-control')}}
|
||||
</div>
|
||||
|
||||
{% for error in form.tag_name.errors %}
|
||||
<div class="error">{{error}}</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="form-group">
|
||||
<label class="required-field" for="tag_name">{{form.tag_name.label}}</label>
|
||||
{{form.tag_name(class_='form-control')}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<a class="btn btn-default" href="{{ request.route_url('topic_edit', topic=topic) }}">
|
||||
<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.id.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>
|
||||
|
||||
<!-- 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 sous-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 sous-rubrique <b>{{ form.tag_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 %}
|
||||
@@ -35,9 +35,62 @@
|
||||
<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 %}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<p>
|
||||
<a href="{{ request.route_url('settings') }}" class="btn btn-default" role="button">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
|
||||
<a href="{{ request.route_url('user_add', name='new') }}" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouvel utilisateur</a>
|
||||
<a href="{{ request.route_url('topic_edit', topic='0') }}" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouvelle rubrique</a>
|
||||
</p>
|
||||
|
||||
<table id="users_list" class="table table-striped table-bordered table-condensed">
|
||||
|
||||
Reference in New Issue
Block a user