From ec79a05fe5f4fd6dc665eeb7136eb25e87b4cba9 Mon Sep 17 00:00:00 2001 From: Artemis Date: Thu, 23 Jan 2025 18:48:19 +0100 Subject: [PATCH] clean pronouns --- assets/site.css | 6 +++++- templates/macros.html.tera | 7 +++++++ templates/show_profile.html.tera | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 templates/macros.html.tera diff --git a/assets/site.css b/assets/site.css index 395ca92..771becf 100644 --- a/assets/site.css +++ b/assets/site.css @@ -79,12 +79,12 @@ header.padded, main { padding-left: 1em; padding-right: 1em; + align-items: center; } header { display: flex; justify-content: space-between; - align-items: center; } section { @@ -229,6 +229,10 @@ input#ident { letter-spacing: .1ch; } +.pronoun_fragment { + font-weight: bold; +} + .profile h2 { font-size: 2em; } \ No newline at end of file diff --git a/templates/macros.html.tera b/templates/macros.html.tera new file mode 100644 index 0000000..40b7bf5 --- /dev/null +++ b/templates/macros.html.tera @@ -0,0 +1,7 @@ +{% macro pretty_pronouns(pronouns) %} +{% set fragments = pronouns | split(pat="/") %} +{% for fr in fragments %} +{{fr}} +{% if not loop.last %}/{% endif %} +{% endfor %} +{% endmacro pretty_pronouns %} \ No newline at end of file diff --git a/templates/show_profile.html.tera b/templates/show_profile.html.tera index f428e38..51a58cf 100644 --- a/templates/show_profile.html.tera +++ b/templates/show_profile.html.tera @@ -1,4 +1,6 @@ {% extends "base" %} +{% import "macros" as macros %} + {% block title %}{{ profile.name }} - {% endblock title %} {% block main %}
@@ -11,7 +13,7 @@ Not microchipped {% endif %}

-

{{profile.pronouns}}

+

{{ macros::pretty_pronouns(pronouns=profile.pronouns) }}

{{profile.name}}