From f0f5d035234fd3a755d6482887f541ab7ea2c0c7 Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Mon, 30 May 2022 11:01:31 +0800 Subject: [PATCH] Add page titles to most pages To make it easier to see what's what when one has multiple WS Contest tabs open. --- i18n/en.json | 1 + i18n/qqq.json | 1 + templates/base.html.twig | 6 +++++- templates/contests.html.twig | 4 ++++ templates/contests_edit.html.twig | 4 ++++ templates/contests_view.html.twig | 4 ++++ templates/contests_viewuser.html.twig | 4 ++++ 7 files changed, 23 insertions(+), 1 deletion(-) diff --git a/i18n/en.json b/i18n/en.json index f302eff..2aefa45 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -14,6 +14,7 @@ "stats-summary": "$1 {{PLURAL:$1|person|people}} have taken part in $2 {{PLURAL:$2|contest|contests}}.", + "all-contests": "All contests", "create-contest": "Create contest", "edit-contest": "Edit contest configuration", "name-label": "Name:", diff --git a/i18n/qqq.json b/i18n/qqq.json index c69eaca..1e2943c 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -13,6 +13,7 @@ "logged-in-as": "Informative sentence about the currently logged-in user. $1 is the username.", "logout": "Link to log out.", "stats-summary": "Summary sentence about the stats for the whole tool. $1 is the number of people; $2 is the number of contests.", + "all-contests": "Page title for the contest-list page.", "create-contest": "Header text displayed above the contest-creation form.", "edit-contest": "Header text displayed above the contest-editing form.", "name-label": "Form label for the 'name' field.\n{{Identical|Name}}", diff --git a/templates/base.html.twig b/templates/base.html.twig index 438cc5e..336fc6c 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -3,7 +3,11 @@ - {{ msg('app-title') }} + + {% block page_title %} + {% endblock %} + {{ msg('app-title') }} + {% block stylesheets %} {% endblock %} diff --git a/templates/contests.html.twig b/templates/contests.html.twig index 31a9c39..6eb6b8d 100644 --- a/templates/contests.html.twig +++ b/templates/contests.html.twig @@ -1,5 +1,9 @@ {% extends 'base.html.twig' %} +{% block page_title %} + {{ msg('all-contests') }} — +{% endblock %} + {% block main %}

diff --git a/templates/contests_edit.html.twig b/templates/contests_edit.html.twig index d26cfc1..0c6d9e3 100644 --- a/templates/contests_edit.html.twig +++ b/templates/contests_edit.html.twig @@ -1,5 +1,9 @@ {% extends 'base.html.twig' %} +{% block page_title %} + {% if contest.id %}{{ msg('edit-contest') }}{% else %}{{ msg('create-contest') }}{% endif %} — +{% endblock %} + {% block main %}

diff --git a/templates/contests_view.html.twig b/templates/contests_view.html.twig index 24428f3..63841a6 100644 --- a/templates/contests_view.html.twig +++ b/templates/contests_view.html.twig @@ -1,5 +1,9 @@ {% extends 'base.html.twig' %} +{% block page_title %} + {{ msg('contest', [contest.name]) }} — +{% endblock %} + {% block main %}

{{ msg('contest', [contest.name]) }}

diff --git a/templates/contests_viewuser.html.twig b/templates/contests_viewuser.html.twig index 0c19123..d1580fa 100644 --- a/templates/contests_viewuser.html.twig +++ b/templates/contests_viewuser.html.twig @@ -1,5 +1,9 @@ {% extends 'base.html.twig' %} +{% block page_title %} + {{ user.name }} — {{ msg('contest', [contest.name]) }} — +{% endblock %} + {% block main %}