From 680bbd5b2dd27dfe0e39c76a24ee0b24b0f3ffa8 Mon Sep 17 00:00:00 2001 From: Ben Aaron Goldberg Date: Sun, 24 Oct 2021 05:34:02 -0400 Subject: [PATCH] web: Added example sentences Signed-off-by: Ben Aaron Goldberg --- web/src/main.rs | 6 ++---- web/templates/index.html | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/web/src/main.rs b/web/src/main.rs index 24efffc..540030d 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -14,16 +14,14 @@ use pronouns_today::{InstanceSettings, Pronoun}; #[template(path = "index.html")] struct IndexTemplate<'a> { name: Option, - short: String, - objective: &'a str, + pronoun: &'a Pronoun, pronouns: Vec<(usize, &'a Pronoun)>, } fn render_page(pronoun: &Pronoun, settings: &InstanceSettings, name: Option) -> String { IndexTemplate { name, - short: pronoun.render_threeform(), - objective: &pronoun.object_pronoun, + pronoun, pronouns: settings.pronoun_list.iter().enumerate().collect(), } .render() diff --git a/web/templates/index.html b/web/templates/index.html index 71a0a53..68a4d00 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -12,13 +12,27 @@

{% if name.is_some() %} {{ name.as_ref().unwrap() }}'s {% else %} - My{% endif %} pronouns today are: {{ short }}

+ My{% endif %} pronouns today are: {{ pronoun.render_threeform() }}

This page picks a random pronoun from a list of preferred pronouns every day. {% if name.is_some() %} {{ name.as_ref().unwrap() }}{% else %} - Whoever linked you to this page{% endif %} would like you to try {{ short }} pronouns for - {{ objective }} today.

+ Whoever linked you to this page{% endif %} would like you to try {{ pronoun.render_threeform() }} pronouns for + {{ pronoun.object_pronoun }} today.

+ +

Here are some example sentences using my she/her pronouns:

+ +

{{ pronoun.subject_pronoun | capitalize }} walked the dog.

+ +

I went with {{ pronoun.object_pronoun }}.

+ +

{{ pronoun.subject_pronoun | capitalize }} rode {{ pronoun.possesive_determiner }} bike.

+ +

At least I think it is {{ pronoun.possesive_pronoun }}.

+ +

{{ pronoun.subject_pronoun | capitalize }} bought the stuffed animal for {{ pronoun.reflexive_pronoun }}.

+ +