use table layout for twtxt feed preview

This commit is contained in:
Iris Lightshard 2021-09-01 17:59:15 -06:00
parent 1c0bd73dab
commit acc2de6dd7
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

9
main.c
View file

@ -83,7 +83,7 @@ int gettwtxt(FILE* f) {
char *l, *d, *m; char *l, *d, *m;
FILE* twtxt = fopen(SITEROOT "twtxt.txt", "r"); FILE* twtxt = fopen(SITEROOT "twtxt.txt", "r");
scat(buf, "<div id='twtxtFeed'><h2>recent activity:</h2>"); scat(buf, "<div id='twtxtFeed'><h2>recent activity:</h2><table>");
if (!twtxt) { if (!twtxt) {
error("Get twtxt feed", "no twtxt.txt"); error("Get twtxt feed", "no twtxt.txt");
return 0; return 0;
@ -98,10 +98,11 @@ int gettwtxt(FILE* f) {
l++; l++;
} }
scat(msgbuf, l); scat(msgbuf, l);
scat(buf, "<tr><td style='white-space:nowrap;vertical-align: top;'>");
scat(buf, datebuf); scat(buf, datebuf);
scat(buf, ": "); scat(buf, ":</td><td> ");
scat(buf, msgbuf); scat(buf, msgbuf);
scat(buf, "<br/>"); scat(buf, "</td></tr>");
d = datebuf; d = datebuf;
while (*d) { while (*d) {
*d++ = 0; *d++ = 0;
@ -112,7 +113,7 @@ int gettwtxt(FILE* f) {
} }
i++; i++;
} }
scat(buf, "<a href='/twtxt.txt'>see all</a>"); scat(buf, "</table><a href='/twtxt.txt'>see all</a>");
scat(buf, "</div>"); scat(buf, "</div>");
fputs(buf, f); fputs(buf, f);
return 1; return 1;