diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2021-07-06 19:44:38 +1000 |
|---|---|---|
| committer | Appleman1234 <applemansigloo@gmail.com> | 2021-07-06 19:44:38 +1000 |
| commit | 99b74207d767bd7ce0d4aa1e93788da27d0698f6 (patch) | |
| tree | dbc4dd1c118a4e89e257a04a45b5b591b54528c6 /templates/mod | |
| parent | bae0a912c7b5aee2eb43bf1a138f40d60fdb2d0e (diff) | |
Fixes for counting Uncountable error in mod templates by using twig count explicitly
Diffstat (limited to 'templates/mod')
| -rw-r--r-- | templates/mod/config-editor.html | 4 | ||||
| -rw-r--r-- | templates/mod/inbox.html | 2 | ||||
| -rw-r--r-- | templates/mod/recent_posts.html | 4 | ||||
| -rw-r--r-- | templates/mod/themes.html | 2 | ||||
| -rw-r--r-- | templates/mod/user.html | 2 | ||||
| -rw-r--r-- | templates/mod/view_ip.html | 6 |
6 files changed, 10 insertions, 10 deletions
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 @@ <th>{% trans 'Description' %}</th> </tr> {% 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 @@ <tr> <th class="minimal"> - {% 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 %} <p style="text-align:center" class="unimportant">({% trans 'No private messages for you.' %})</p> {% else %} <table class="modlog"> 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 @@ -<script src="{{ config.additional_javascript_url }}js/mod/recent_posts.js"></script> -{% if not posts %} +<script src="{{ config.additional_javascript_url }}js/mod/recent-posts.js"></script> +{% if not posts|count %} <p style="text-align:center" class="unimportant">({% trans 'There are no active posts.' %})</p> {% else %} <h4>Viewing last {{ limit|e }} posts</h4> 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 %} <p style="text-align:center" class="unimportant">({% trans 'There are no themes available.' %})</p> {% else %} <table class="modlog"> 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 @@ </ul> </form> -{% if logs and logslength > 0 %} +{% if logs|count > 0 %} <table class="modlog" style="width:600px"> <tr> <th>{% trans 'IP address' %}</th> 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 @@ <legend>{{ notes|count }} {% trans notes_on_record %}</legend> </legend> - {% if notes and notes|length > 0 %} + {% if notes|count > 0 %} <table class="modlog"> <tr> <th>{% trans 'Staff' %}</th> @@ -81,7 +81,7 @@ </fieldset> {% 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) %} <fieldset id="bans"> {% set bans_on_record = 'ban' ~ (bans|count != 1 ? 's' : '') ~ ' on record' %} <legend>{{ bans|count }} {% trans bans_on_record %}</legend> @@ -174,7 +174,7 @@ </fieldset> {% endif %} -{% if logs and logs|length > 0 %} +{% if logs|count > 0 %} <fieldset id="history"> <legend>History</legend> <table class="modlog" style="width:100%"> |
