final test before release v1.0
This commit is contained in:
@@ -12,20 +12,23 @@
|
||||
<hr/>
|
||||
<p>{{ body_html | safe }}</p>
|
||||
<hr/>
|
||||
{% if request.authenticated_userid %}
|
||||
<p>
|
||||
Topic : <strong>{{ entry.topic }}</strong>
|
||||
|
|
||||
Tag : <strong>{{ entry.tag }}</strong>
|
||||
|
|
||||
Créé le : <strong>{{ entry.created.strftime("%d-%m-%Y - %H:%M") }}</strong>
|
||||
|
|
||||
Modifié le : <strong>{{ entry.edited.strftime("%d-%m-%Y - %H:%M") }}</strong>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
Créé : <strong title="{{ entry.created }}">{{ entry.created_in_words }}</strong>
|
||||
</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
Auteur : <strong>{{ entry.author }}</strong><br>
|
||||
Publié le : <strong>{{ entry.created.strftime("%d-%m-%Y - %H:%M") }}</strong><br>
|
||||
{% if request.authenticated_userid %}
|
||||
Modifié le : <strong>{{ entry.edited.strftime("%d-%m-%Y - %H:%M") }}</strong><br>
|
||||
Tag : <strong>{{ entry.tag }}</strong><br>
|
||||
Statut : <strong>{{ entry.status }}</strong>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<script>
|
||||
const anchors = document.querySelectorAll('a');
|
||||
anchors.forEach((a) => {
|
||||
a.setAttribute('target', '__blank');
|
||||
a.setAttribute('rel', 'noopener noreferrer');
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -19,30 +19,31 @@
|
||||
{{ form.body(class_='form-control', cols="35", rows="20") }}
|
||||
</div>
|
||||
|
||||
{% 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.tag.errors %}
|
||||
<div class="text-danger">{{ error }}</div>
|
||||
{% endfor %}
|
||||
<div class="form-group">
|
||||
<label class="required-field" for="tag">{{ form.tag.label }}</label>
|
||||
{{ form.tag(class_='form-control') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="required-field" for="status">{{ form.status.label }}</label>
|
||||
{{ form.status(class_='form-control') }}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
{% if blog_id != '0' %}
|
||||
Créé le : <strong>{{ entry.created.strftime("%d-%m-%Y - %H:%M") }}</strong><br>
|
||||
Modifié le : <strong>{{ entry.edited.strftime("%d-%m-%Y - %H:%M") }}</strong>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<br />
|
||||
<div class="form-group">
|
||||
<a class="btn btn-default" href="{{ request.route_url('home') }}"><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 action == 'edit' %}
|
||||
<button class="btn btn-warning" type="submit" name="form.deleted">
|
||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</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>
|
||||
|
||||
@@ -50,4 +51,30 @@
|
||||
|
||||
</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><br>
|
||||
{{ 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 %}
|
||||
|
||||
@@ -3,21 +3,24 @@
|
||||
{% block content %}
|
||||
|
||||
{% if request.authenticated_userid %}
|
||||
<p><a href="{{ request.route_url('blog_edit', id='0') }}">
|
||||
[Nouveau post]</a>
|
||||
</p>
|
||||
<p><a href="{{ request.route_url('blog_edit', id='0') }}" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouveau</a>
|
||||
</p>
|
||||
{% endif%}
|
||||
|
||||
<table id="posts_list" class="table table-condensed">
|
||||
{% for entry in last_ten %}
|
||||
<tr>
|
||||
<td>{{ entry.created.strftime("%d.%m.%Y") }}</td>
|
||||
<td>
|
||||
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
|
||||
</td>
|
||||
<td>{{ entry.topic }}</td>
|
||||
<td>{{ entry.tag }}</td>
|
||||
</td>
|
||||
<td>{{ entry.created.strftime("%d.%m.%Y") }}</td>
|
||||
<td>
|
||||
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
|
||||
</td>
|
||||
<td>{{ entry.tag }}</td>
|
||||
{% if entry.status != 'publié' %}
|
||||
<td><span class="label label-danger">{{ entry.status }}</span></td>
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif%}
|
||||
</tr>
|
||||
{% else %}
|
||||
<p class="text-danger">Aucun post trouvé</p>
|
||||
|
||||
@@ -32,27 +32,28 @@
|
||||
<a class="navbar-brand" href="{{ request.route_url('home') }}">CAO Blogr</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="myNavbar">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="{{ request.route_url('blog_search') }}"><span class="glyphicon glyphicon-search"></span></a></li>
|
||||
{% if request.authenticated_userid %}
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{request.authenticated_userid}}
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% if request.authenticated_userid == 'admin' %}
|
||||
<li><a href="{{request.route_url('users')}}">Utilisateurs</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{ request.route_url('logout') }}">Se déconnecter</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<!-- si anonyme, lien pour se connecter -->
|
||||
<li><a href="{{ request.route_url('login') }}">
|
||||
<span class="glyphicon glyphicon-user"></span></a></li>
|
||||
{% endif %}
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="{{ request.route_url('blog_search') }}"><span class="glyphicon glyphicon-search"></span></a></li>
|
||||
{% if request.authenticated_userid %}
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{request.authenticated_userid}}
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% if request.authenticated_userid == 'admin' %}
|
||||
<li><a href="{{request.route_url('users')}}">Utilisateurs</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{ request.route_url('tags') }}"><span class="glyphicon glyphicon-tag"></span> Tags</a></li>
|
||||
<li><a href="{{ request.route_url('logout') }}"><span class="glyphicon glyphicon-off"></span> Se déconnecter</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<!-- si anonyme, lien pour se connecter -->
|
||||
<li><a href="{{ request.route_url('login') }}">
|
||||
<span class="glyphicon glyphicon-user"></span></a></li>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
55
cao_blogr/templates/tag_edit.jinja2
Normal file
55
cao_blogr/templates/tag_edit.jinja2
Normal file
@@ -0,0 +1,55 @@
|
||||
{% 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>
|
||||
|
||||
<div class="form-group">
|
||||
<a class="btn btn-default" href="{{ request.route_url('tags') }}">
|
||||
<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 le Tag</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- The form is placed inside the body of modal -->
|
||||
<p>Etes-vous certain(e) de vouloir supprimer le Tag <b>{{ form.tag.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 %}
|
||||
17
cao_blogr/templates/tags.jinja2
Normal file
17
cao_blogr/templates/tags.jinja2
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "cao_blogr:templates/layout.jinja2" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<p><a href="{{ request.route_url('tag_edit', id='0') }}" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-plus"></span> Nouveau</a>
|
||||
</p>
|
||||
|
||||
<ul></ul>
|
||||
{% for entry in tags %}
|
||||
<li>
|
||||
<a href="{{ request.route_url('tag_edit', id=entry.id) }}">{{ entry.tag }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user