From cd6922371f5987f007e132b535b6e206c13eff4c Mon Sep 17 00:00:00 2001 From: Luedeke Andreas Date: Mon, 19 Feb 2018 13:21:51 +0100 Subject: [PATCH] - add "Email CSS URL" : use public copy of CSS for emails - bugfix: replace hard-coded reference of "New" to loc("New") - add "Subscription columns" : format list of logbooks for subscriptions in columns --- src/elogd.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 01e02db0..60d44a0f 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -7633,7 +7633,14 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, rsprintf("%s\n", title); /* Cascading Style Sheet */ - if (absolute_link) + if (absolute_link) { + if (lbs != NULL && getcfg(lbs->name, "Email CSS URL", str, sizeof(str))) + strlcpy(css_base, str, sizeof(css_base)); + else if (lbs == NULL && getcfg("global", "Email CSS URL", str, sizeof(str))) + strlcpy(css_base, str, sizeof(css_base)); + if (css_base[0] == 0) + compose_base_url(lbs, css_base, sizeof(css_base), FALSE); + } else compose_base_url(lbs, css_base, sizeof(css_base), FALSE); else css_base[0] = 0; @@ -9572,8 +9579,8 @@ int check_drafts(LOGBOOK * lbs) } rsprintf(""); - rsprintf("\n", loc("Create new entry"), - "?cmd=New&ignore=1"); + rsprintf("\n", loc("Create new entry"), + loc("New")); rsprintf("\n\n"); rsprintf("\n"); @@ -13777,7 +13784,7 @@ int ascii_compare2(const void *s1, const void *s2) void show_config_page(LOGBOOK * lbs) { char str[256], user[80], password[80], full_name[256], user_email[256], logbook[256], auth[32], **user_list; - int i, n, inactive; + int i, j, n, cols, inactive; BOOL email_notify[1000], sort_email; if (lbs) @@ -13970,6 +13977,10 @@ void show_config_page(LOGBOOK * lbs) } if (n > 0) { + if (getcfg(lbs->name, "Subscription columns", str, sizeof(str))) + cols = atoi(str); + else + cols = 1; rsprintf("%s:\n", loc("Subscribe to logbooks")); @@ -13978,7 +13989,8 @@ void show_config_page(LOGBOOK * lbs) rsprintf("\n"); - for (i = 0; lb_list[i].name[0]; i++) { + for (j = i = 0; lb_list[i].name[0]; i++) { + if (j==0) rsprintf(""); if (!getcfg_topgroup() || strieq(getcfg_topgroup(), lb_list[i].top_group)) { @@ -13988,15 +14000,18 @@ void show_config_page(LOGBOOK * lbs) /* check if emails are enabled for this logbook */ if (!getcfg(lb_list[i].name, "Suppress email to users", str, sizeof(str)) || atoi(str) == 0) { if (email_notify[i]) - rsprintf("\n", i, + rsprintf("\n", i, lb_list[i].name); + j++; } } } + if ((j%cols)==0) rsprintf("\n"); } + rsprintf("
\n", i, i); else - rsprintf("\n", i, i); - rsprintf("
\n", i, lb_list[i].name); + rsprintf("
\n", i, i); + rsprintf("
\n"); } if (n > 2) {