commit ceb82f3a743f96960fbf349512a6db8a1b72d795
parent 2b94e244c52943ed67677ceca17a493c7fbbe36c
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Tue, 19 Mar 2024 20:22:12 -0700
Fix export form in main page
Set the period field in the export form when it's set in the main
page..
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/pages/main.c b/pages/main.c
@@ -304,6 +304,14 @@ exportform(struct pagedata *pd)
if ((status = khtml_attr(&pd->html, KELEM_FORM,
KATTR_ACTION, pd->pages[PageExport], KATTR__MAX)) != KCGI_OK ||
(status = khtml_elem(&pd->html, KELEM_LABEL)) != KCGI_OK ||
+ ((pd->req.fieldmap[KeyPeriod] &&
+ pd->req.fieldmap[KeyPeriod]->parsed.i > 0) &&
+ (status = khtml_attrx(&pd->html, KELEM_INPUT,
+ KATTR_TYPE, KATTRX_STRING, "hidden",
+ KATTR_NAME, KATTRX_STRING, pd->keys[KeyPeriod].name,
+ KATTR_VALUE, KATTRX_INT,
+ (int64_t)pd->req.fieldmap[KeyPeriod]->parsed.i,
+ KATTR__MAX)) != KCGI_OK) ||
(status = khtml_putc(&pd->html, ' ')) != KCGI_OK ||
(status = khtml_attr(&pd->html, KELEM_INPUT,
KATTR_TYPE, "submit",