diff options
author | June McEnroe <june@causal.agency> | 2020-07-12 17:22:35 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-07-12 17:22:35 -0400 |
commit | fdec6c0642c06a0b2a6bcea554d41d049f65e552 (patch) | |
tree | 9049d798f7272ded4d9d2af15b553bb9a7925007 /events.c | |
parent | Set nick column to nowrap (diff) | |
download | scooper-fdec6c0642c06a0b2a6bcea554d41d049f65e552.tar.gz scooper-fdec6c0642c06a0b2a6bcea554d41d049f65e552.zip |
Rewrite default CSS
Diffstat (limited to '')
-rw-r--r-- | events.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/events.c b/events.c index 423ce1e..bdeb3f6 100644 --- a/events.c +++ b/events.c @@ -169,13 +169,8 @@ enum kcgi_err eventsPage(struct kreq *req) { if (result == SQLITE_ROW) { error = 0 || khtml_elem(&html, KELEM_THEAD) - || khtml_elem(&html, KELEM_TR) - || khtml_attr( - &html, KELEM_TH, - KATTR_CLASS, "topic", - KATTR_COLSPAN, "3", - KATTR__MAX - ) + || khtml_attr(&html, KELEM_TR, KATTR_CLASS, "topic", KATTR__MAX) + || khtml_attr(&html, KELEM_TH, KATTR_COLSPAN, "3", KATTR__MAX) || khtml_puts(&html, sqlite3_column_text(stmt.topic, 0)) || khtml_closeelem(&html, 3); if (error) return error; @@ -224,7 +219,7 @@ enum kcgi_err eventsPage(struct kreq *req) { free(base); error = 0 - || khtml_elem(&html, KELEM_TR) + || khtml_attr(&html, KELEM_TR, KATTR_CLASS, "page", KATTR__MAX) || khtml_attr(&html, KELEM_TH, KATTR_COLSPAN, "3", KATTR__MAX) || khtml_attr(&html, KELEM_A, KATTR_HREF, href, KATTR__MAX) || khtml_puts(&html, "Earlier messages") @@ -259,7 +254,7 @@ enum kcgi_err eventsPage(struct kreq *req) { ); if (!href) err(EX_OSERR, "khttp_urlpart"); error = 0 - || khtml_elem(&html, KELEM_TR) + || khtml_attr(&html, KELEM_TR, KATTR_CLASS, "page", KATTR__MAX) || khtml_attr(&html, KELEM_TH, KATTR_COLSPAN, "3", KATTR__MAX) || khtml_attr(&html, KELEM_A, KATTR_HREF, href, KATTR__MAX) || khtml_puts(&html, "Later messages") @@ -268,5 +263,13 @@ enum kcgi_err eventsPage(struct kreq *req) { if (error) return error; } + if (!rows) { + error = 0 + || khtml_elem(&html, KELEM_TR) + || khtml_attr(&html, KELEM_TH, KATTR_COLSPAN, "3", KATTR__MAX) + || khtml_puts(&html, "No matching messages"); + if (error) return error; + } + return htmlFooter(&html) || khtml_close(&html); } |