commit 93dde76ed814d0c6b530a002fbecb6ad5772284a
parent 4ec3e7274683b05253250323ea359be0da46d311
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Wed, 20 Mar 2024 20:35:12 -0700
Use tk_startpage in all pages
Diffstat:
6 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/pages/account.c b/pages/account.c
@@ -24,7 +24,7 @@ pageaccount(struct pagedata *pd)
return errorpage(pd, KHTTP_500);
}
- if ((status = startpage(pd, &template, KHTTP_200)) != KCGI_OK ||
+ if ((status = tk_startpage(pd, &template, KHTTP_200)) != KCGI_OK ||
(status = htmlwithin(pd, KELEM_H1, "Account")) != KCGI_OK ||
(status = htmlwithin(pd, KELEM_H2, "Delete account")) != KCGI_OK ||
(status = htmlwithin(pd, KELEM_P, "Deleting an account is irreversible:"
diff --git a/pages/archive.c b/pages/archive.c
@@ -83,7 +83,7 @@ pagearchive(struct pagedata *pd)
enum kcgi_err status;
struct timesheet *times, *firsttimes;
- startpage(pd, &template, KHTTP_200);
+ tk_startpage(pd, &template, KHTTP_200);
if (!pd->user)
errorpage(pd, KHTTP_401);
diff --git a/pages/index.c b/pages/index.c
@@ -13,7 +13,7 @@ pageindex(struct pagedata *pd)
enum kcgi_err status;
- if ((status = startpage(pd, &template, KHTTP_200)) != KCGI_OK)
+ if ((status = tk_startpage(pd, &template, KHTTP_200)) != KCGI_OK)
return status;
khtml_elem(&pd->html, KELEM_H1);
diff --git a/pages/login.c b/pages/login.c
@@ -68,7 +68,7 @@ pagelogin(struct pagedata *pd)
}
}
- if ((status = startpage(pd, &template, KHTTP_200)) != KCGI_OK)
+ if ((status = tk_startpage(pd, &template, KHTTP_200)) != KCGI_OK)
return status;
if ((status = htmlwithin(pd, KELEM_H1, "Login")) != KCGI_OK)
diff --git a/pages/main.c b/pages/main.c
@@ -201,7 +201,8 @@ printtimes(struct pagedata *pd, struct timesheet *times)
};
struct timesheet *p;
- if ((status = khtml_elem(&pd->html, KELEM_TABLE)) != KCGI_OK ||
+ if ((status = khtml_attr(&pd->html, KELEM_TABLE,
+ KATTR_CLASS, "timetable", KATTR__MAX)) != KCGI_OK ||
(status = htmlwithin(pd, KELEM_CAPTION, "Timesheets")) != KCGI_OK)
return status;
@@ -375,7 +376,7 @@ pagemain(struct pagedata *pd)
return KCGI_SYSTEM;
}
- status = startpage(pd, &template, KHTTP_200);
+ status = tk_startpage(pd, &template, KHTTP_200);
if (status != KCGI_OK)
return status;
diff --git a/pages/util.c b/pages/util.c
@@ -23,7 +23,7 @@ redirect(struct pagedata *pd, char *to, char *msg)
if ((status = khttp_head(&pd->req, kresps[KRESP_LOCATION], "%s", to)) != KCGI_OK)
return status;
- if ((status = startpage(pd, &template, KHTTP_303)) != KCGI_OK)
+ if ((status = tk_startpage(pd, &template, KHTTP_303)) != KCGI_OK)
return status;
if ((status = khtml_elem(&pd->html, KELEM_H1)) != KCGI_OK ||
(status = khtml_puts(&pd->html, msg)) != KCGI_OK ||