diff options
| author | 2023-08-14 15:00:46 +0200 | |
|---|---|---|
| committer | 2023-08-14 15:00:46 +0200 | |
| commit | 2696f62dc5ec772c0a5ae3bfaf58c2e8cb1a5306 (patch) | |
| tree | 87f93799f343e83d989fb22d51053f01641204a3 | |
| parent | If a user 'header' field is defined, use it. (diff) | |
| download | snac2-2696f62dc5ec772c0a5ae3bfaf58c2e8cb1a5306.tar.gz snac2-2696f62dc5ec772c0a5ae3bfaf58c2e8cb1a5306.tar.xz snac2-2696f62dc5ec772c0a5ae3bfaf58c2e8cb1a5306.zip | |
If the user has a header image, show it the public page.
| -rw-r--r-- | html.c | 15 |
1 files changed, 13 insertions, 2 deletions
| @@ -459,8 +459,19 @@ xs_str *html_user_header(snac *snac, xs_str *s, int local) | |||
| 459 | 459 | ||
| 460 | /* user info */ | 460 | /* user info */ |
| 461 | { | 461 | { |
| 462 | char *_tmpl = | 462 | s = xs_str_cat(s, "<div class=\"h-card snac-top-user\">\n"); |
| 463 | "<div class=\"h-card snac-top-user\">\n" | 463 | |
| 464 | if (local) { | ||
| 465 | const char *header = xs_dict_get(snac->config, "header"); | ||
| 466 | if (header && *header) { | ||
| 467 | xs *h = encode_html(header); | ||
| 468 | xs *s1 = xs_fmt("<div class=\"snac-top-user-banner\" style=\"clear: both\">" | ||
| 469 | "<br><img src=\"%s\"/></div>\n", h); | ||
| 470 | s = xs_str_cat(s, s1); | ||
| 471 | } | ||
| 472 | } | ||
| 473 | |||
| 474 | const char *_tmpl = | ||
| 464 | "<p class=\"p-name snac-top-user-name\">%s</p>\n" | 475 | "<p class=\"p-name snac-top-user-name\">%s</p>\n" |
| 465 | "<p class=\"snac-top-user-id\">@%s@%s</p>\n"; | 476 | "<p class=\"snac-top-user-id\">@%s@%s</p>\n"; |
| 466 | 477 | ||