diff options
| author | 2024-02-05 19:50:56 +0100 | |
|---|---|---|
| committer | 2024-02-05 19:50:56 +0100 | |
| commit | 7efa3ce519b0a4dd769e3be5afce3d4bfda39bfa (patch) | |
| tree | 24e2c6770492422db1f791af675bff1de18a6159 | |
| parent | Added paging to notify_list(), and use it in the notifications page. (diff) | |
| download | snac2-7efa3ce519b0a4dd769e3be5afce3d4bfda39bfa.tar.gz snac2-7efa3ce519b0a4dd769e3be5afce3d4bfda39bfa.tar.xz snac2-7efa3ce519b0a4dd769e3be5afce3d4bfda39bfa.zip | |
Added a navigation footer (i.e., an optional "More..." link) to the notification page.
| -rw-r--r-- | html.c | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -2272,6 +2272,19 @@ xs_str *html_notifications(snac *user, int skip, int show) | |||
| 2272 | xs_html_attr("class", "snac-header"), | 2272 | xs_html_attr("class", "snac-header"), |
| 2273 | xs_html_text(L("None")))); | 2273 | xs_html_text(L("None")))); |
| 2274 | 2274 | ||
| 2275 | /* add the navigation footer */ | ||
| 2276 | xs *next_p = notify_list(user, skip + show, 1); | ||
| 2277 | if (xs_list_len(next_p)) { | ||
| 2278 | xs *url = xs_fmt("%s/notifications?skip=%d&show=%d", | ||
| 2279 | user->actor, skip + show, show); | ||
| 2280 | |||
| 2281 | xs_html_add(body, | ||
| 2282 | xs_html_tag("p", | ||
| 2283 | xs_html_tag("a", | ||
| 2284 | xs_html_attr("href", url), | ||
| 2285 | xs_html_text(L("More..."))))); | ||
| 2286 | } | ||
| 2287 | |||
| 2275 | xs_html_add(body, | 2288 | xs_html_add(body, |
| 2276 | html_footer()); | 2289 | html_footer()); |
| 2277 | 2290 | ||