Show buttons on links in search

main
cel 5 years ago
parent deff461ed5
commit 9e302395a1
Signed by: cel
GPG Key ID: C28D95BB012367EA

@ -163,6 +163,15 @@ static int write_zet_link(int fd, const char *id, const char *title) {
return rc; return rc;
} }
static int write_zet_link_btn(int fd, const char *id, const char *title) {
int rc = 0;
rc |= dprintf(fd, "<form action=\"%s\" method=get>"
"<input type=submit value=\"&rarr;\">", id);
rc |= write_zet_link(fd, id, title);
rc |= write_buf(fd, "</form>\n");
return rc;
}
static int write_topbar(int fd, enum page page, const char *id, const char *title) { static int write_topbar(int fd, enum page page, const char *id, const char *title) {
int rc = write_buf(fd, int rc = write_buf(fd,
"<table style=\"width:100%; border-collapse:collapse\"><tr>" "<table style=\"width:100%; border-collapse:collapse\"><tr>"
@ -604,7 +613,7 @@ static int dpi_serve_zet_search(int fd, char *qs) {
return 0; return 0;
} }
rc = write_buf(fd, "<li>"); rc = write_buf(fd, "<li>");
rc |= write_zet_link(fd, id, title); rc |= write_zet_link_btn(fd, id, title);
rc |= write_buf(fd, "</li>"); rc |= write_buf(fd, "</li>");
if (rc < 0) { warnx("dprintf/write_html/write_buf"); close(fd); return 0; } if (rc < 0) { warnx("dprintf/write_html/write_buf"); close(fd); return 0; }
} }

Loading…
Cancel
Save