From 99b74207d767bd7ce0d4aa1e93788da27d0698f6 Mon Sep 17 00:00:00 2001 From: Appleman1234 Date: Tue, 6 Jul 2021 19:44:38 +1000 Subject: Fixes for counting Uncountable error in mod templates by using twig count explicitly --- templates/mod/config-editor.html | 4 ++-- templates/mod/inbox.html | 2 +- templates/mod/recent_posts.html | 4 ++-- templates/mod/themes.html | 2 +- templates/mod/user.html | 2 +- templates/mod/view_ip.html | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'templates') diff --git a/templates/mod/config-editor.html b/templates/mod/config-editor.html index ebf4202b..411d55e6 100644 --- a/templates/mod/config-editor.html +++ b/templates/mod/config-editor.html @@ -23,7 +23,7 @@ {% trans 'Description' %} {% for var in conf if var.type != 'array' %} - {% if var.name and var.name|length == 1 %} + {% if var.name|count == 1 %} {% set name = 'cf_' ~ var.name %} {% else %} {% set name = 'cf_' ~ var.name|join('/') %} @@ -31,7 +31,7 @@ - {% if var.name and var.name|length == 1 %} + {% if var.name|count == 1 %} {{ var.name }} {% else %} {{ var.name|join(' → ') }} diff --git a/templates/mod/inbox.html b/templates/mod/inbox.html index 63f4de5c..97afe446 100644 --- a/templates/mod/inbox.html +++ b/templates/mod/inbox.html @@ -1,4 +1,4 @@ -{% if not messages %} +{% if messages|count == 0 %}

({% trans 'No private messages for you.' %})

{% else %} diff --git a/templates/mod/recent_posts.html b/templates/mod/recent_posts.html index e5a95ece..349dcea9 100644 --- a/templates/mod/recent_posts.html +++ b/templates/mod/recent_posts.html @@ -1,5 +1,5 @@ - -{% if not posts %} + +{% if not posts|count %}

({% trans 'There are no active posts.' %})

{% else %}

Viewing last {{ limit|e }} posts

diff --git a/templates/mod/themes.html b/templates/mod/themes.html index 87639dbc..b230bc48 100644 --- a/templates/mod/themes.html +++ b/templates/mod/themes.html @@ -1,4 +1,4 @@ -{% if not themes %} +{% if themes|count == 0 %}

({% trans 'There are no themes available.' %})

{% else %}
diff --git a/templates/mod/user.html b/templates/mod/user.html index 6cc454d8..08598fe5 100644 --- a/templates/mod/user.html +++ b/templates/mod/user.html @@ -87,7 +87,7 @@ -{% if logs and logslength > 0 %} +{% if logs|count > 0 %}
diff --git a/templates/mod/view_ip.html b/templates/mod/view_ip.html index be4119e0..4bacc7f6 100644 --- a/templates/mod/view_ip.html +++ b/templates/mod/view_ip.html @@ -18,7 +18,7 @@ {{ notes|count }} {% trans notes_on_record %} - {% if notes and notes|length > 0 %} + {% if notes|count > 0 %}
{% trans 'IP address' %}
@@ -81,7 +81,7 @@ {% endif %} -{% if bans and bans|length > 0 and mod|hasPermission(config.mod.view_ban) %} +{% if bans|count > 0 and mod|hasPermission(config.mod.view_ban) %}
{% set bans_on_record = 'ban' ~ (bans|count != 1 ? 's' : '') ~ ' on record' %} {{ bans|count }} {% trans bans_on_record %} @@ -174,7 +174,7 @@
{% endif %} -{% if logs and logs|length > 0 %} +{% if logs|count > 0 %}
History
{% trans 'Staff' %}
-- cgit v1.3