diff options
| author | 2025-06-16 19:41:14 +0200 | |
|---|---|---|
| committer | 2025-11-14 17:22:00 +0100 | |
| commit | 380e5b397ef070061cd4393d529bd6d0f0d3eb0b (patch) | |
| tree | 65682f8cd06d135964a66c70bf94d1e5b32ce716 /html.c | |
| parent | metadata: quick fix for <p> tags (diff) | |
| download | snac2-380e5b397ef070061cd4393d529bd6d0f0d3eb0b.tar.gz snac2-380e5b397ef070061cd4393d529bd6d0f0d3eb0b.tar.xz snac2-380e5b397ef070061cd4393d529bd6d0f0d3eb0b.zip | |
metadata: location and bday properties
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 38 |
1 files changed, 38 insertions, 0 deletions
| @@ -3363,6 +3363,44 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c | |||
| 3363 | xs_html_attr("class", "snac-metadata")); | 3363 | xs_html_attr("class", "snac-metadata")); |
| 3364 | 3364 | ||
| 3365 | int count = 0; | 3365 | int count = 0; |
| 3366 | const xs_val *address = xs_dict_get(actor, "vcard:Address"); | ||
| 3367 | if (xs_is_string(address)) { | ||
| 3368 | xs_html_add(snac_metadata, | ||
| 3369 | xs_html_tag("span", | ||
| 3370 | xs_html_attr("class", "snac-property-name"), | ||
| 3371 | xs_html_raw("📍 Location")), | ||
| 3372 | xs_html_text(":"), | ||
| 3373 | xs_html_raw(" "), | ||
| 3374 | xs_html_tag("span", | ||
| 3375 | xs_html_attr("class", "snac-property-value p-adr"), | ||
| 3376 | xs_html_text(address)), | ||
| 3377 | xs_html_sctag("br", NULL)); | ||
| 3378 | |||
| 3379 | count++; | ||
| 3380 | } | ||
| 3381 | |||
| 3382 | const xs_val *birthday = xs_dict_get(actor, "vcard:bday"); | ||
| 3383 | if (xs_is_string(birthday)) { | ||
| 3384 | xs_html_add(snac_metadata, | ||
| 3385 | xs_html_tag("span", | ||
| 3386 | xs_html_attr("class", "snac-property-name"), | ||
| 3387 | xs_html_raw("🎂 Birthday")), | ||
| 3388 | xs_html_text(":"), | ||
| 3389 | xs_html_raw(" "), | ||
| 3390 | xs_html_tag("time", | ||
| 3391 | xs_html_attr("class", "snac-property-value dt-bday"), | ||
| 3392 | xs_html_text(birthday)), | ||
| 3393 | xs_html_sctag("br", NULL)); | ||
| 3394 | |||
| 3395 | count++; | ||
| 3396 | } | ||
| 3397 | |||
| 3398 | if (count > 0) { | ||
| 3399 | xs_html_add(snac_metadata, | ||
| 3400 | xs_html_sctag("hr", | ||
| 3401 | xs_html_attr("class", "snac-property-divider"))); | ||
| 3402 | } | ||
| 3403 | |||
| 3366 | const xs_val *v; | 3404 | const xs_val *v; |
| 3367 | const xs_list *attachment = xs_dict_get(actor, "attachment"); | 3405 | const xs_list *attachment = xs_dict_get(actor, "attachment"); |
| 3368 | xs_list_foreach(attachment, v) { | 3406 | xs_list_foreach(attachment, v) { |