commit 3e40d5b6740ced4f35a574ccf12715ea40340aa0
parent 5cea413a2e2cbb3f38eede514acf088cd0c37150
Author: kristapsdz <kristaps@bsd.lv>
Date: Wed, 11 Mar 2020 22:31:18 +0000
parent 5cea413a2e2cbb3f38eede514acf088cd0c37150
Author: kristapsdz <kristaps@bsd.lv>
Date: Wed, 11 Mar 2020 22:31:18 +0000
Add which page we're on.
2 files changed, 60 insertions(+), 7 deletions(-)
diff --git a/main.c b/main.c @@ -307,6 +307,22 @@ get_single_html(struct kreq *r, const struct report *p) khtml_open(&req, r, 0); html_open(&req, "Minimal CI Report"); + /* Heading. */ + + khtml_attr(&req, KELEM_H1, + KATTR_CLASS, "singleton", KATTR__MAX); + khtml_attr(&req, KELEM_A, + KATTR_HREF, "index.html", KATTR__MAX); + khtml_puts(&req, "CI Dashboard"); + khtml_closeelem(&req, 1); /* a */ + khtml_ncr(&req, 0x203a); + khtml_elem(&req, KELEM_SPAN); + khtml_puts(&req, "Reports"); + khtml_closeelem(&req, 1); /* span */ + khtml_closeelem(&req, 1); /* h1 */ + + /* Body. */ + khtml_attr(&req, KELEM_DIV, KATTR_CLASS, "singleton", KATTR__MAX); khtml_attr(&req, KELEM_DIV, KATTR_CLASS, @@ -469,6 +485,35 @@ get_last(struct kreq *r) khtml_open(&req.html, r, 0); html_open(&req.html, "Recent Minimal CI Reports"); + + khtml_attr(&req.html, KELEM_H1, + KATTR_CLASS, "table", KATTR__MAX); + + if (kpn != NULL) { + khtml_attr(&req.html, KELEM_A, + KATTR_HREF, "index.html", KATTR__MAX); + khtml_puts(&req.html, "CI Dashboard"); + khtml_closeelem(&req.html, 1); /* a */ + khtml_ncr(&req.html, 0x203a); + khtml_elem(&req.html, KELEM_SPAN); + khtml_puts(&req.html, "Project Reports"); + khtml_closeelem(&req.html, 1); /* span */ + khtml_closeelem(&req.html, 1); /* h1 */ + } else if (kpd != NULL) { + khtml_attr(&req.html, KELEM_A, + KATTR_HREF, "index.html", KATTR__MAX); + khtml_puts(&req.html, "CI Dashboard"); + khtml_closeelem(&req.html, 1); /* a */ + khtml_ncr(&req.html, 0x203a); + khtml_elem(&req.html, KELEM_SPAN); + khtml_puts(&req.html, "Date Reports"); + khtml_closeelem(&req.html, 1); /* span */ + khtml_closeelem(&req.html, 1); /* h1 */ + } else + khtml_puts(&req.html, "CI Dashboard"); + + khtml_closeelem(&req.html, 1); /* h1 */ + khtml_attr(&req.html, KELEM_DIV, KATTR_CLASS, "table", KATTR__MAX); get_html_last_header(&req.html);
diff --git a/minci.css b/minci.css @@ -1,11 +1,20 @@ html, body { margin: 0; } body { font-family: sans-serif; } -.table { width: 100%; } +.table { width: 100%; + max-width: 88rem; + margin-right: auto; + margin-left: auto; } +h1 { font-size: larger; + text-align: center; } +h1 a, h1 span { display: inline-block; } +h1 a { margin-right: 0.3rem; } +h1 span { margin-left: 0.3rem; } .singleton { width: calc(100% - 1rem); max-width: 66rem; - margin: 1rem auto; } -.table > :nth-child(odd) { background-color: #f0f0f0; } -.table > :first-child { display: none; + margin-right: auto; + margin-left: auto; } +div.table > :nth-child(odd) { background-color: #f0f0f0; } +div.table > :first-child { display: none; background-color: #666; font-weight: bold; text-shadow: 0 0 #000; @@ -83,9 +92,8 @@ body { font-family: sans-serif; } @media (min-width: 80rem) { html, body { margin: 1rem 0; } - .table { max-width: 88rem; - margin: 0 auto; } - .table > :first-child, + h1 { text-align: left; } + div.table > :first-child, .row { display: flex; } .head, .cell { width: 4rem; padding: 0 1rem; }
: nply/minci