From bdf23d8a67d88afc9560ddb87ac1e1dad3fef330 Mon Sep 17 00:00:00 2001 From: Darks Date: Sat, 7 Dec 2019 16:12:23 +0100 Subject: [PATCH] =?UTF-8?q?Corrige=20un=20bug=20apport=C3=A9=20par=20le=20?= =?UTF-8?q?commit=20a2e408da=20Retire=20les=20utilitaires=20du=20scope=20g?= =?UTF-8?q?lobal=20du=20rendu=20(inutile=20pour=20le=20moment)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/processors/utilities.py | 4 ++-- app/templates/forum/forum.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/processors/utilities.py b/app/processors/utilities.py index bc28c70..b3483f5 100644 --- a/app/processors/utilities.py +++ b/app/processors/utilities.py @@ -4,6 +4,6 @@ from app import app def utilities_processor(): """ Add some utilities to render context """ return dict( - len=len, - enumerate=enumerate + # len=len, + # enumerate=enumerate ) diff --git a/app/templates/forum/forum.html b/app/templates/forum/forum.html index 45efe52..6fbceed 100644 --- a/app/templates/forum/forum.html +++ b/app/templates/forum/forum.html @@ -19,15 +19,15 @@ {{ t.title }} {{ t.author.name }} {{ t.date_created | date }} - {{ t.thread.comments | length }} + {{ t.thread.comments.count() }} {{ t.views }} {% endfor %} - {% elif len(f.sub_forums) == 0 %} + {% elif not f.sub_forums %}

Il n'y a aucun topic sur ce forum ! Animons-le vite !

{% endif %} - {% if len(f.sub_forums) > 0 %} + {% if f.sub_forums %}

Forums

@@ -41,7 +41,7 @@
{{ f.name }}Nombre de sujets
{% endif %} - {% if len(f.sub_forums) == 0 or (current_user.is_authenticated and current_user.priv('access-admin-board')) %} + {% if (not f.sub_forums) == 0 or (current_user.is_authenticated and current_user.priv('access-admin-board')) %}

Créer un nouveau sujet