Corrige un bug apporté par le commit a2e408da

Retire les utilitaires du scope global du rendu (inutile pour le moment)
This commit is contained in:
Darks 2019-12-07 16:12:23 +01:00
parent a2e408daf9
commit bdf23d8a67
Signed by: Darks
GPG Key ID: F61F10FA138E797C
2 changed files with 6 additions and 6 deletions

View File

@ -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
)

View File

@ -19,15 +19,15 @@
<tr><td><a href='{{ url_for('forum_topic', f=t.forum, t=t) }}'>{{ t.title }}</a></td>
<td><a href='{{ url_for('user', username=t.author.name) }}'>{{ t.author.name }}</a></td>
<td>{{ t.date_created | date }}</td>
<td>{{ t.thread.comments | length }}</td>
<td>{{ t.thread.comments.count() }}</td>
<td>{{ t.views }} </td></tr>
{% endfor %}
</table>
{% elif len(f.sub_forums) == 0 %}
{% elif not f.sub_forums %}
<p>Il n'y a aucun topic sur ce forum ! Animons-le vite !</p>
{% endif %}
{% if len(f.sub_forums) > 0 %}
{% if f.sub_forums %}
<h2>Forums</h2>
<table class=forumlist>
<tr><th>{{ f.name }}</th><th>Nombre de sujets</th></tr>
@ -41,7 +41,7 @@
</table>
{% 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')) %}
<div class=form>
<h2>Créer un nouveau sujet</h2>
<form action="" method="post" enctype="multipart/form-data">