From cb5f9d05c6363662525376a787ba409e6fa51a25 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 7 Jun 2022 05:26:22 -0400 Subject: [PATCH] templates: Fix improper plurals, create helpers. Previously, the three instances of 'Report[s]' and one instance of 'Coin[s]' in the UI templates were always pluralized, even when they referred to a singular instance. This has been corrected by creating a `plural` helper macro. Additionally, this was used as impetus to create `utils/helpers.html` to eventually move more recurring template logic into macros. --- files/templates/authforms.html | 1 + files/templates/chat.html | 1 + files/templates/comments.html | 3 ++- files/templates/default.html | 1 + files/templates/header.html | 2 +- files/templates/login.html | 1 + files/templates/login_2fa.html | 1 + files/templates/settings.html | 1 + files/templates/settings2.html | 1 + files/templates/sign_up.html | 1 + files/templates/sign_up_failed_ref.html | 1 + files/templates/submission.html | 2 +- files/templates/submission_listing.html | 3 ++- files/templates/submit.html | 1 + files/templates/util/helpers.html | 5 +++++ 15 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 files/templates/util/helpers.html diff --git a/files/templates/authforms.html b/files/templates/authforms.html index dc31e8745..61fab8a53 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -1,4 +1,5 @@ {%- from 'util/assetcache.html' import asset -%} +{%- import 'util/helpers.html' as help -%} diff --git a/files/templates/chat.html b/files/templates/chat.html index 04c53b193..eafc097ce 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -1,4 +1,5 @@ {%- from 'util/assetcache.html' import asset -%} +{%- import 'util/helpers.html' as help -%} diff --git a/files/templates/comments.html b/files/templates/comments.html index f314824ed..50d7e368e 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -1,4 +1,5 @@ {%- from 'util/assetcache.html' import asset -%} +{%- import 'util/helpers.html' as help -%} {% if not ajax %} {% if comment_info and not request.full_path.endswith('#context') %}