diff options
| author | 2023-04-14 09:57:18 +0200 | |
|---|---|---|
| committer | 2023-04-14 09:57:18 +0200 | |
| commit | f38de8c6b0a7b07a89fbecb55bea727b4552894b (patch) | |
| tree | 8a05fee7f477e27d85a97d9e2d1afcd615d6a959 /html.c | |
| parent | notify_list() returns the notifications in reverse order. (diff) | |
| download | snac2-f38de8c6b0a7b07a89fbecb55bea727b4552894b.tar.gz snac2-f38de8c6b0a7b07a89fbecb55bea727b4552894b.tar.xz snac2-f38de8c6b0a7b07a89fbecb55bea727b4552894b.zip | |
Show a top link to the (future) notifications area, including a count of new ones.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 15 |
1 files changed, 14 insertions, 1 deletions
| @@ -282,14 +282,27 @@ d_char *html_user_header(snac *snac, d_char *s, int local) | |||
| 282 | "<a href=\"%s/admin\" rel=\"nofollow\">%s</a></nav>\n", | 282 | "<a href=\"%s/admin\" rel=\"nofollow\">%s</a></nav>\n", |
| 283 | snac->actor, L("RSS"), | 283 | snac->actor, L("RSS"), |
| 284 | snac->actor, L("private")); | 284 | snac->actor, L("private")); |
| 285 | else | 285 | else { |
| 286 | xs *n_list = notify_list(snac, 1); | ||
| 287 | int n_len = xs_list_len(n_list); | ||
| 288 | xs *n_str = NULL; | ||
| 289 | |||
| 290 | /* show the notification number, if there are any */ | ||
| 291 | if (n_len) | ||
| 292 | n_str = xs_fmt("<sup style=\"background-color: red; color: white;\"> %d </sup> ", n_len); | ||
| 293 | else | ||
| 294 | n_str = xs_str_new(""); | ||
| 295 | |||
| 286 | s1 = xs_fmt( | 296 | s1 = xs_fmt( |
| 287 | "<a href=\"%s\">%s</a> - " | 297 | "<a href=\"%s\">%s</a> - " |
| 288 | "<a href=\"%s/admin\">%s</a> - " | 298 | "<a href=\"%s/admin\">%s</a> - " |
| 299 | "<a href=\"%s/admin\">%s</a>%s - " | ||
| 289 | "<a href=\"%s/people\">%s</a></nav>\n", | 300 | "<a href=\"%s/people\">%s</a></nav>\n", |
| 290 | snac->actor, L("public"), | 301 | snac->actor, L("public"), |
| 291 | snac->actor, L("private"), | 302 | snac->actor, L("private"), |
| 303 | snac->actor, L("notifications"), n_str, | ||
| 292 | snac->actor, L("people")); | 304 | snac->actor, L("people")); |
| 305 | } | ||
| 293 | 306 | ||
| 294 | s = xs_str_cat(s, s1); | 307 | s = xs_str_cat(s, s1); |
| 295 | } | 308 | } |