summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2026-01-12 06:14:58 +0100
committerGravatar grunfink2026-01-12 06:14:58 +0100
commita84e74e8f22e0be502d1b4b98cadaf284db5af23 (patch)
tree5ee4cb156d2900d6729093ad4f03275b7bb5c23e /html.c
parentAdded emoji categories. (diff)
downloadsnac2-a84e74e8f22e0be502d1b4b98cadaf284db5af23.tar.gz
snac2-a84e74e8f22e0be502d1b4b98cadaf284db5af23.tar.xz
snac2-a84e74e8f22e0be502d1b4b98cadaf284db5af23.zip
Move the pronouns closer to the account name.
Diffstat (limited to 'html.c')
-rw-r--r--html.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/html.c b/html.c
index 2107609..2ff6f79 100644
--- a/html.c
+++ b/html.c
@@ -222,9 +222,6 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
222 222
223 xs *name = actor_name(actor, proxy); 223 xs *name = actor_name(actor, proxy);
224 xs *pronouns = actor_pronouns(actor); 224 xs *pronouns = actor_pronouns(actor);
225 char pronouns_c = 0;
226 if (*pronouns != '\0')
227 pronouns_c = 1;
228 225
229 /* get the avatar */ 226 /* get the avatar */
230 if ((v = xs_dict_get(actor, "icon")) != NULL) { 227 if ((v = xs_dict_get(actor, "icon")) != NULL) {
@@ -259,16 +256,28 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
259 if (href == NULL) 256 if (href == NULL)
260 href = xs_dup(actor_id); 257 href = xs_dup(actor_id);
261 258
259 xs_html *name_link = xs_html_tag("a",
260 xs_html_attr("href", href),
261 xs_html_attr("class", "p-author h-card snac-author"),
262 xs_html_raw(name)); /* name is already html-escaped */
263
264 if (*pronouns) {
265 xs_html_add(name_link,
266 xs_html_text(" ["),
267 xs_html_tag("span",
268 xs_html_attr("class", "snac-pronouns"),
269 xs_html_attr("title", "user's pronouns"),
270 xs_html_raw(pronouns)),
271 xs_html_text("]"));
272 }
273
262 xs_html_add(actor_icon, 274 xs_html_add(actor_icon,
263 xs_html_sctag("img", 275 xs_html_sctag("img",
264 xs_html_attr("loading", "lazy"), 276 xs_html_attr("loading", "lazy"),
265 xs_html_attr("class", "snac-avatar"), 277 xs_html_attr("class", "snac-avatar"),
266 xs_html_attr("src", avatar), 278 xs_html_attr("src", avatar),
267 xs_html_attr("alt", "[?]")), 279 xs_html_attr("alt", "[?]")),
268 xs_html_tag("a", 280 name_link);
269 xs_html_attr("href", href),
270 xs_html_attr("class", "p-author h-card snac-author"),
271 xs_html_raw(name))); /* name is already html-escaped */
272 281
273 if (!xs_is_null(url)) { 282 if (!xs_is_null(url)) {
274 xs *md5 = xs_md5_hex(url, strlen(url)); 283 xs *md5 = xs_md5_hex(url, strlen(url));
@@ -281,14 +290,6 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
281 xs_html_text("»"))); 290 xs_html_text("»")));
282 } 291 }
283 292
284 if (pronouns_c > 0)
285 xs_html_add(actor_icon,
286 xs_html_text(" "),
287 xs_html_tag("span",
288 xs_html_attr("class", "snac-pronouns"),
289 xs_html_attr("title", "user's pronouns"),
290 xs_html_raw(pronouns)));
291
292 293
293 if (strcmp(xs_dict_get(actor, "type"), "Service") == 0) { 294 if (strcmp(xs_dict_get(actor, "type"), "Service") == 0) {
294 xs_html_add(actor_icon, 295 xs_html_add(actor_icon,