From 6347c3305092ae574fa7d9b0f444247a509abb3b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 30 Apr 2020 17:48:47 -0400 Subject: Add -S for subscribe link These base* variables are badly named... --- html.c | 68 +++++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 28 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 3cc740c..24cdf1a 100644 --- a/html.c +++ b/html.c @@ -109,31 +109,31 @@ static char *htmlMbox(const char *messageID) { return templateURL("../" PATH_MESSAGE, vars); } +static int +htmlNavItem(FILE *file, const char *name, const char *base, const char *url) { + const char *template = TEMPLATE( +
  • [name]
  • + ); + struct Variable vars[] = { + { "name", name }, + { "base", base }, + { "url", url }, + {0}, + }; + return templateRender(file, template, vars, escapeXML); +} + int htmlMessageNav(FILE *file, const struct Envelope *envelope) { int error = templateRender(file, TEMPLATE(), NULL, NULL); @@ -505,26 +505,38 @@ int htmlIndexHead(FILE *file) { return templateRender(file, template, vars, escapeXML); } +static int htmlIndexNav(FILE *file) { + int error = 0 + || templateRender(file, TEMPLATE(), NULL, NULL); +} + int htmlIndexOpen(FILE *file) { - const char *template = TEMPLATE( + const char *head = TEMPLATE(

    [title]

    - -
    -
    -
      ); struct Variable vars[] = { { "title", baseTitle }, - { "addr", baseAddress }, {0}, }; - return templateRender(file, template, vars, escapeXML); + const char *tail = TEMPLATE( + +
      +
        + ); + return 0 + || templateRender(file, head, vars, escapeXML) + || htmlIndexNav(file) + || templateRender(file, tail, NULL, NULL); } static char *htmlIndexURL(const struct Envelope *envelope) { -- cgit 1.4.1