added status to blog post

This commit is contained in:
2022-05-18 14:38:30 +02:00
parent 7fa1595f0a
commit 62371401c5
9 changed files with 85 additions and 28 deletions

View File

@@ -30,6 +30,11 @@
{{ form.author(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>
Topic : <strong>{{ entry.topic_id }}</strong>
{% if blog_id != '0' %}

View File

@@ -111,17 +111,23 @@
<br>
<h5 class="text-center">DERNIERES PUBLICATIONS</h5>
<ul>
{% for entry in last_five %}
<li>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">
{{ entry.title }}
</a>
&nbsp;—&nbsp;{{ entry.author }}, {{ entry.created.strftime("%d-%m-%Y") }}
</li>
{% endfor %}
</ul>
<table id="users_list" class="table table-condensed">
{% for entry in last_five %}
<tr>
<td>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
</td>
<td>{{ entry.author }}</td>
<td>{{ entry.created.strftime("%d-%m-%Y") }}</td>
{% if entry.status == 'brouillon' %}
<td><span class="label label-danger">{{ entry.status }}</span></td>
{% else %}
<td> </td>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>

View File

@@ -27,15 +27,24 @@
</p>
{% endif%}
<ul>
{% for item in items %}
<li>
{{ item.edited.strftime("%d-%m-%Y") }}&nbsp;&nbsp;
<a href="{{ request.route_url('blog', id=item.id, slug=item.slug) }}">
<span class="glyphicon glyphicon-menu-right"></span>&nbsp;&nbsp;{{ item.title }}</a>
</li>
{% endfor %}
</ul>
<table id="users_list" class="table table-condensed">
{% for entry in items %}
<tr>
<td>{{ entry.tag }}</td>
<td>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
</td>
<td>{{ entry.author }}</td>
<td>{{ entry.created.strftime("%d-%m-%Y") }}</td>
{% if entry.status == 'brouillon' %}
<td><span class="label label-danger">{{ entry.status }}</span></td>
{% else %}
td> </td>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}

View File

@@ -11,7 +11,6 @@
</p>
{% endif%}
{{ liste | safe }}
{% endblock %}