web: Add web page explantation message

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

View File

@ -15,6 +15,7 @@ use pronouns_today::{InstanceSettings, Pronoun};
struct IndexTemplate<'a> { struct IndexTemplate<'a> {
name: Option<String>, name: Option<String>,
short: String, short: String,
objective: &'a str,
pronouns: Vec<(usize, &'a Pronoun)>, pronouns: Vec<(usize, &'a Pronoun)>,
} }
@ -22,6 +23,7 @@ fn render_page(pronoun: &Pronoun, settings: &InstanceSettings, name: Option<Stri
IndexTemplate { IndexTemplate {
name, name,
short: pronoun.render_threeform(), short: pronoun.render_threeform(),
objective: &pronoun.object_pronoun,
pronouns: settings.pronoun_list.iter().enumerate().collect(), pronouns: settings.pronoun_list.iter().enumerate().collect(),
} }
.render() .render()

View File

@ -11,13 +11,14 @@
</style> </style>
</head> </head>
<body> <body>
<h1> <h1>{% if name.is_some() %} {{ name.as_ref().unwrap() }}'s {% else %}
{% if name.is_some() %} My{% endif %} pronouns today are: {{ short }}</h1>
{{ name.as_ref().unwrap() }}
{% else %} <p>This page picks a random pronoun from a list of preferred pronouns every
My day.
{% endif %} {% if name.is_some() %} {{ name.as_ref().unwrap() }}{% else %}
pronouns today are: {{ short }}</h1> Whoever linked you to this page{% endif %} would like you to try {{ short }} pronouns for
{{ objective }} today.</p>
<label for="form-toggle">Create your own custom link!</label> <label for="form-toggle">Create your own custom link!</label>
<input type="checkbox" id="form-toggle" style="display: none;"/> <input type="checkbox" id="form-toggle" style="display: none;"/>