diff options
| author | 2023-11-08 10:22:25 +0100 | |
|---|---|---|
| committer | 2023-11-08 10:22:25 +0100 | |
| commit | 42629c9742beda51675cc8a9fef4b9f349ff9dd7 (patch) | |
| tree | 671b9348a412ec2c5e02f2be38d1719abb7c48ba | |
| parent | Added a tag argument to html_timeline(). (diff) | |
| download | snac2-42629c9742beda51675cc8a9fef4b9f349ff9dd7.tar.gz snac2-42629c9742beda51675cc8a9fef4b9f349ff9dd7.tar.xz snac2-42629c9742beda51675cc8a9fef4b9f349ff9dd7.zip | |
Show the "Search results for #tag" title.
| -rw-r--r-- | html.c | 19 |
1 files changed, 11 insertions, 8 deletions
| @@ -241,7 +241,7 @@ xs_str *html_base_header(xs_str *s) | |||
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | 243 | ||
| 244 | xs_str *html_instance_header(xs_str *s) | 244 | xs_str *html_instance_header(xs_str *s, char *tag) |
| 245 | { | 245 | { |
| 246 | s = html_base_header(s); | 246 | s = html_base_header(s); |
| 247 | 247 | ||
| @@ -304,8 +304,10 @@ xs_str *html_instance_header(xs_str *s) | |||
| 304 | s = xs_str_cat(s, "</div>\n"); | 304 | s = xs_str_cat(s, "</div>\n"); |
| 305 | 305 | ||
| 306 | { | 306 | { |
| 307 | xs *s1 = xs_fmt("<h2 class=\"snac-header\">%s</h2>\n", | 307 | xs *l = tag ? xs_fmt(L("Search results for #%s"), tag) : |
| 308 | L("Recent posts by users in this instance")); | 308 | xs_dup(L("Recent posts by users in this instance")); |
| 309 | |||
| 310 | xs *s1 = xs_fmt("<h2 class=\"snac-header\">%s</h2>\n", l); | ||
| 309 | s = xs_str_cat(s, s1); | 311 | s = xs_str_cat(s, s1); |
| 310 | } | 312 | } |
| 311 | 313 | ||
| @@ -1554,7 +1556,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local, | |||
| 1554 | if (user) | 1556 | if (user) |
| 1555 | s = html_user_header(user, s, local); | 1557 | s = html_user_header(user, s, local); |
| 1556 | else | 1558 | else |
| 1557 | s = html_instance_header(s); | 1559 | s = html_instance_header(s, tag); |
| 1558 | 1560 | ||
| 1559 | if (user && !local) | 1561 | if (user && !local) |
| 1560 | s = html_top_controls(user, s); | 1562 | s = html_top_controls(user, s); |
| @@ -1629,16 +1631,17 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local, | |||
| 1629 | } | 1631 | } |
| 1630 | 1632 | ||
| 1631 | if (show_more) { | 1633 | if (show_more) { |
| 1632 | xs *t = NULL; | 1634 | xs *t = NULL; |
| 1633 | xs *m = NULL; | 1635 | xs *m = NULL; |
| 1636 | xs *ss = xs_fmt("skip=%d&show=%d", skip + show, show); | ||
| 1634 | 1637 | ||
| 1635 | if (tag) { | 1638 | if (tag) { |
| 1636 | t = xs_fmt("%s?t=%s", srv_baseurl, tag); | 1639 | t = xs_fmt("%s?t=%s", srv_baseurl, tag); |
| 1637 | m = xs_fmt("%s&skip=%d&show=%d", t, skip + show, show); | 1640 | m = xs_fmt("%s&%s", t, ss); |
| 1638 | } | 1641 | } |
| 1639 | else { | 1642 | else { |
| 1640 | t = xs_fmt("%s%s", user ? user->actor : srv_baseurl, local ? "" : "/admin"); | 1643 | t = xs_fmt("%s%s", user ? user->actor : srv_baseurl, local ? "" : "/admin"); |
| 1641 | m = xs_fmt("%s?&skip=%d&show=%d", t, skip + show, show); | 1644 | m = xs_fmt("%s?%s", t, ss); |
| 1642 | } | 1645 | } |
| 1643 | 1646 | ||
| 1644 | xs *s1 = xs_fmt( | 1647 | xs *s1 = xs_fmt( |