added showing blogs by tag

This commit is contained in:
2023-02-09 21:53:51 +01:00
parent fcd83c48d7
commit f1287c3fad
9 changed files with 85 additions and 20 deletions

View File

@@ -0,0 +1,26 @@
{% extends "layout.jinja2" %}
{% block content %}
<p><a href="{{ url_retour }}">[ retour ]</a></p>
<table class="table table-condensed">
{% for entry in items %}
<tr>
<td>{{ entry.created.strftime("%d %b %y") }}</td>
<td>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
</td>
{% if entry.status != 'publié' %}
<td><span class="label label-danger">{{ entry.status }}</span></td>
{% else %}
<td>&nbsp;</td>
{% endif%}
</tr>
{% else %}
<p class="text-danger">Aucun post trouvé !</p>
{% endfor %}
</table>
<p class="text-center">[ {{nb_items}} billets ]</p>
{% endblock %}

View File

@@ -46,6 +46,12 @@
{% endif %}
</div>
<br />
<br />
<h2 class="text-center">Index</h2>
<p class="text-center">
|&nbsp;
{% for tag in tags %}
<a href="{{ request.route_url('blog_bytag', tag=tag.tag, retour='blog_search') }}">{{ tag.tag }}</a>&nbsp;|
{% endfor %}
</p>
{% endblock %}

View File

@@ -10,11 +10,13 @@
<table id="posts_list" class="table table-condensed">
{% for entry in last_ten %}
<tr>
<td>{{ entry.created.strftime("%d.%m.%Y") }}</td>
<td>{{ entry.created.strftime("%d %b %y") }}</td>
<td>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
</td>
<td>{{ entry.tag }}</td>
<td>
[ <a href="{{ request.route_url('blog_bytag', tag=entry.tag, retour='home') }}">{{ entry.tag }}</a> ]
</td>
{% if entry.status != 'publié' %}
<td><span class="label label-danger">{{ entry.status }}</span></td>
{% else %}
@@ -25,5 +27,5 @@
<p class="text-danger">Aucun post trouvé</p>
{% endfor %}
</table>
{% endblock %}

View File

@@ -29,7 +29,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ request.route_url('home') }}">CAO Blogr</a>
<a class="navbar-brand" href="{{ request.route_url('home') }}">CAOTEK</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
@@ -59,14 +59,10 @@
</div>
</nav>
{% if request.path == '/' %}
{# -- display carousel -- #}
{% block carousel %}
{% endblock carousel %}
{% endif %}
<!-- Container (The Page Template Section) -->
<div class="container">
<br>
<br>
<!-- Display Page Title -->
{% if page_title %}
<h1>{{ page_title }}</h1>