mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
History in html_timeline() uses xs_html.
This commit is contained in:
parent
593475fc19
commit
a6da1fdb64
1 changed files with 18 additions and 14 deletions
32
html.c
32
html.c
|
@ -2124,28 +2124,32 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local,
|
||||||
s = xs_str_cat(s, "<!-- history disabled -->\n");
|
s = xs_str_cat(s, "<!-- history disabled -->\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xs *s1 = xs_fmt(
|
xs_html *ul = xs_html_tag("ul", NULL);
|
||||||
"<div class=\"snac-history\">\n"
|
|
||||||
"<p class=\"snac-history-title\">%s</p><ul>\n",
|
|
||||||
L("History")
|
|
||||||
);
|
|
||||||
|
|
||||||
s = xs_str_cat(s, s1);
|
xs_html *history = xs_html_tag("div",
|
||||||
|
xs_html_attr("class", "snac-history"),
|
||||||
|
xs_html_tag("p",
|
||||||
|
xs_html_attr("class", "snac-history-title"),
|
||||||
|
xs_html_text(L("History"))),
|
||||||
|
ul);
|
||||||
|
|
||||||
xs *list = history_list(user);
|
xs *list = history_list(user);
|
||||||
char *p, *v;
|
xs_list *p = list;
|
||||||
|
char *v;
|
||||||
|
|
||||||
p = list;
|
|
||||||
while (xs_list_iter(&p, &v)) {
|
while (xs_list_iter(&p, &v)) {
|
||||||
xs *fn = xs_replace(v, ".html", "");
|
xs *fn = xs_replace(v, ".html", "");
|
||||||
xs *s1 = xs_fmt(
|
xs *url = xs_fmt("%s/h/%s", user->actor, v);
|
||||||
"<li><a href=\"%s/h/%s\">%s</a></li>\n",
|
|
||||||
user->actor, v, fn);
|
|
||||||
|
|
||||||
s = xs_str_cat(s, s1);
|
xs_html_add(ul,
|
||||||
|
xs_html_tag("li",
|
||||||
|
xs_html_tag("a",
|
||||||
|
xs_html_attr("href", url),
|
||||||
|
xs_html_text(fn))));
|
||||||
}
|
}
|
||||||
|
|
||||||
s = xs_str_cat(s, "</ul></div>\n");
|
xs *s1 = xs_html_render(history);
|
||||||
|
s = xs_str_cat(s, s1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue