web: Added example sentences

Signed-off-by: Ben Aaron Goldberg <ben@benaaron.dev>
This commit is contained in:
Ben Aaron Goldberg 2021-10-24 05:34:02 -04:00
parent 5aa00e052e
commit 680bbd5b2d
2 changed files with 19 additions and 7 deletions

View File

@ -14,16 +14,14 @@ use pronouns_today::{InstanceSettings, Pronoun};
#[template(path = "index.html")]
struct IndexTemplate<'a> {
name: Option<String>,
short: String,
objective: &'a str,
pronoun: &'a Pronoun,
pronouns: Vec<(usize, &'a Pronoun)>,
}
fn render_page(pronoun: &Pronoun, settings: &InstanceSettings, name: Option<String>) -> String {
IndexTemplate {
name,
short: pronoun.render_threeform(),
objective: &pronoun.object_pronoun,
pronoun,
pronouns: settings.pronoun_list.iter().enumerate().collect(),
}
.render()

View File

@ -12,13 +12,27 @@
</head>
<body>
<h1>{% if name.is_some() %} {{ name.as_ref().unwrap() }}'s {% else %}
My{% endif %} pronouns today are: {{ short }}</h1>
My{% endif %} pronouns today are: {{ pronoun.render_threeform() }}</h1>
<p>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.</p>
Whoever linked you to this page{% endif %} would like you to try {{ pronoun.render_threeform() }} pronouns for
{{ pronoun.object_pronoun }} today.</p>
<h3>Here are some example sentences using my she/her pronouns:</h3>
<p>{{ pronoun.subject_pronoun | capitalize }} walked the dog.</p>
<p>I went with {{ pronoun.object_pronoun }}.</p>
<p>{{ pronoun.subject_pronoun | capitalize }} rode {{ pronoun.possesive_determiner }} bike.</p>
<p>At least I think it is {{ pronoun.possesive_pronoun }}.</p>
<p>{{ pronoun.subject_pronoun | capitalize }} bought the stuffed animal for {{ pronoun.reflexive_pronoun }}.</p>
<hr/>
<label for="form-toggle">Create your own custom link!</label>
<input type="checkbox" id="form-toggle" style="display: none;"/>