From 3f57540e545759fb0bd385bc3aaf0ca9b08c76e1 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 29 Jan 2003 16:34:35 +0000 Subject: [PATCH] More CSS stuff SVN revision: 346 --- elogd.c | 203 +++++++++++++++++++++++++++----------------------------- 1 file changed, 99 insertions(+), 104 deletions(-) diff --git a/elogd.c b/elogd.c index fba77a8d..11941627 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 2.136 2003/01/29 16:34:35 midas + More CSS stuff + Revision 2.135 2003/01/29 12:05:15 midas CSS half finished @@ -3846,14 +3849,11 @@ char str[1000]; rsprintf("\n"); - rsprintf("", - gt("Border width"), gt("Frame color")); - rsprintf("
\n", gt("Frame color")); + rsprintf("
\n\n"); - rsprintf("\n", - gt("Title bgcolor"), gt("Title fontcolor")); + rsprintf("\n"); - rsprintf("\n"); - rsprintf("
ELog Electronic Logbook Upgrade Information
ELog Electronic Logbook Upgrade Information

\n"); + rsprintf("

\n"); rsprintf("You probably use an elogd.cfg configuration file for a ELOG version\n"); rsprintf("1.1.x, since it contains a \"Types = ...\" entry. From version\n"); @@ -3876,8 +3876,7 @@ char str[1000]; rsprintf("http://midas.psi.ch/elog/config.html\">http://midas.psi.ch/elog/config.html\n"); rsprintf(".\n"); - rsprintf("
\n\n"); + rsprintf("\n\n"); rsprintf("
\n"); rsprintf("
\n"); @@ -4059,7 +4058,8 @@ LBLIST clb, flb, nlb, lbl; strcpy(sclass, "gtab"); } - rsprintf(" ", sclass, sclass, ref); + // rsprintf(" ", sclass, sclass, ref); + rsprintf(" ", sclass, ref); strlcpy(str, clb[i].name, sizeof(str)); @@ -4793,17 +4793,16 @@ time_t now; /*---- entry form ----*/ - /* overall table for message giving blue frame */ - rsprintf("\n", - gt("Categories border"), gt("Categories cellpadding"), gt("Frame color")); + /* table for two-column items */ + rsprintf("", colspan, ref); } else { - rsprintf("
"); /* print required message if one of the attributes has it set */ for (i= 0 ; i < lbs->n_attr ; i++) { if (attr_flags[i] & AF_REQUIRED) { - rsprintf("\n", - gt("Categories bgcolor1"), loc("Fields marked with"), loc("are required")); + rsprintf("\n", + loc("Fields marked with"), loc("are required")); break; } } @@ -4834,9 +4833,6 @@ time_t now; } else strcpy(str, date); - - rsprintf("\n\n", - gt("Categories bgcolor1"), loc("Entry date"), gt("Categories bgcolor2"), str); } else { @@ -4844,11 +4840,11 @@ time_t now; strftime(str, sizeof(str), format, localtime(&now)); else strcpy(str, ctime(&now)); - - rsprintf("\n\n", - gt("Categories bgcolor1"), loc("Entry date"), gt("Categories bgcolor2"), str); } + rsprintf("", loc("Entry date")); + rsprintf("\n", str); + /* display attributes */ for (index = 0 ; index < lbs->n_attr ; index++) { @@ -4879,14 +4875,14 @@ time_t now; } /* display text box */ - rsprintf("", gt("Categories bgcolor1"), attr_list[index], star); + rsprintf("", attr_list[index], star); /* if attribute cannot be changed, just display text */ if ((attr_flags[index] & AF_LOCKED) || (bedit && (attr_flags[index] & AF_FIXED_EDIT)) || (message_id && !bedit && (attr_flags[index] & AF_FIXED_REPLY))) { - rsprintf("\n", - gt("Categories bgcolor2"), NAME_LENGTH, attr_list[index], attrib[index]); + rsprintf("\n", + NAME_LENGTH, attr_list[index], attrib[index]); } else { if (equal_ustring(attr_options[index][0], "boolean")) { /* display checkbox */ - rsprintf("\n\n"); - /* overall table for message giving blue frame */ - rsprintf("\n"); - rsprintf("
%s * %s
%s * %s
%s:%s
%s:%s
%s:%s
%s%s:
%s%s:\n", gt("Categories bgcolor2")); + rsprintf("\n"); rsputs2(attrib[index]); if (attr_flags[index] & AF_MULTI) @@ -4927,23 +4923,23 @@ time_t now; { if (attr_options[index][0][0] == 0) { - rsprintf("
\n", - gt("Categories bgcolor2"), attr_list[index]); + rsprintf("\n", + attr_list[index]); } else { if (attr_flags[index] & AF_MULTI) { /* display multiple check boxes */ - rsprintf("\n", gt("Categories bgcolor2")); + rsprintf("\n"); for (i=0 ; i\n", gt("Categories bgcolor2")); + rsprintf("\n"); for (i=0 ; i\n", gt("Categories bgcolor2")); + rsprintf("\n"); for (i=0 ; i
\n"); + rsprintf("
\n"); if (getcfg(lbs->name, "Message comment", comment) && !bedit && !message_id) { @@ -5303,17 +5298,9 @@ char str[256], mode[256]; /*---- entry form ----*/ - rsprintf("
\n"); + rsprintf("
\n"); - /* overall table for message giving blue frame */ - /* - rsprintf("
\n", - gt("Categories border"), gt("Categories cellpadding"), gt("Frame color")); - - rsprintf("\n"); + rsprintf("\n", loc("Show attachments")); - } + rsprintf("%s
\n", loc("Show attachments")); - rsprintf("\n", loc("Printable output")); - - rsprintf("\n", loc("Sort in reverse order")); + rsprintf("%s
\n", loc("Sort in reverse order")); else - rsprintf("%s\n", loc("Sort in reverse order")); + rsprintf("%s
\n", loc("Sort in reverse order")); /* count logbooks */ for (i=0 ; ; i++) @@ -5367,21 +5350,25 @@ char str[256], mode[256]; if (i > 2) { if (!getcfg(lbs->name, "Search all logbooks", str) || atoi(str) == 1) - { - rsprintf("\n", loc("Search all logbooks")); - } + rsprintf("%s
\n", loc("Search all logbooks")); } - rsprintf("", gt("Categories bgcolor1"), loc("Start date")); - rsprintf("\n"); + + + rsprintf("
", gt("Categories bgcolor2")); - */ - - rsprintf("Mode:  "); + rsprintf("%s:  ", loc("Mode")); if (!getcfg(lbs->name, "Display mode", mode)) strcpy(mode, "Full"); @@ -5338,21 +5325,17 @@ char str[256], mode[256]; rsprintf("
%s:
", loc("Options")); + if (!getcfg(lbs->name, "Number attachments", str) || atoi(str) > 0) - { - rsprintf("
", gt("Categories bgcolor2")); - rsprintf("%s
", gt("Categories bgcolor2")); - rsprintf("%s
", gt("Categories bgcolor2")); + rsprintf("%s
\n", loc("Printable output")); if (getcfg(lbs->name, "Reverse sort", str) && atoi(str) == 1) - rsprintf("%s
", gt("Categories bgcolor2")); - rsprintf("%s
", gt("Categories bgcolor2")); rsprintf(loc("Display")); if (!getcfg(lbs->name, "Entries per page", str)) strcpy(str, "20"); rsprintf(" ", str); rsprintf(loc("entries per page")); - rsprintf("
%s:
%s:
", loc("Filters")); + + /* table for two-column items */ + rsprintf("\n"); + + rsprintf("", loc("Start date")); + rsprintf("\n"); - rsprintf("", gt("Categories bgcolor1"), loc("End date")); - rsprintf("", loc("End date")); + rsprintf("", gt("Categories bgcolor1"), attr_list[i]); - rsprintf("", attr_list[i]); + rsprintf("", gt("Categories bgcolor1"), loc("Text")); - rsprintf("", loc("Text")); + rsprintf("\n", loc("(case insensitive substring)")); } @@ -5486,18 +5485,13 @@ char str[256]; /*---- menu buttons ----*/ rsprintf("\n\n"); /*---- entry form ----*/ - /* overall table for message giving blue frame */ - rsprintf("\n"); + rsprintf("\n"); /*---- menu buttons ----*/ - rsprintf("\n\n"); - rsprintf("
%s:\n"); rsprintf(" %s: ", loc("Year")); + + rsprintf("  /  %s: ", loc("Show last")); + + rsprintf(" \n"); + rsprintf("
%s:
%s:
%s:", gt("Categories bgcolor2")); + rsprintf("
%s:"); if (attr_options[i][0][0] == 0) { rsprintf("\n", attr_list[i]); @@ -5454,9 +5454,8 @@ char str[256], mode[256]; if (!getcfg(lbs->name, "Show text", str) || atoi(str) == 1) { - rsprintf("
%s:\n", - gt("Categories bgcolor2")); + rsprintf("
%s:\n"); rsprintf("%s
\n"); - rsprintf("\n", loc("Save")); rsprintf("\n", loc("Cancel")); rsprintf("
\n", - gt("Categories border"), gt("Categories cellpadding"), gt("Frame color")); - - rsprintf("
", gt("Categories bgcolor2")); + rsprintf("
\n"); fh = open(config_file, O_RDONLY | O_BINARY); if (fh < 0) @@ -5532,20 +5526,17 @@ char str[256]; /* put link for config page */ rsprintf("Syntax Help"); - rsprintf("
\n", - gt("Menu1 cellpadding"), gt("Frame color")); - - rsprintf("
\n", gt("Menu1 Align"), gt("Menu1 BGColor")); + rsprintf("
\n"); rsprintf("\n", loc("Save")); rsprintf("\n", loc("Cancel")); - rsprintf("
\n\n"); + rsprintf("
\n\n"); + rsprintf("
\n\n"); rsprintf("\r\n"); } @@ -5962,9 +5953,10 @@ int i; rsprintf("
\n", - gt("Categories border"), gt("Categories cellpadding"), gt("Frame color")); + + /* table for two-column items */ + rsprintf("\n"); + rsprintf("
"); + rsprintf("\n"); /*---- if admin user, show user list ----*/ @@ -5972,8 +5964,8 @@ int i; strstr(str, getparam("unm")) != 0) { rsprintf("\n"); - rsprintf("\n", gt("Categories bgcolor1"), loc("Select user")); - rsprintf("\n", loc("Select user")); + rsprintf("\n", gt("Categories bgcolor1"), loc("Login name")); + rsprintf("\n", loc("Login name")); if (get_user_line(lbs->name, user, password, full_name, user_email, email_notify) != 1) sprintf(str, loc("User [%s] has been deleted"), user); else strcpy(str, user); - rsprintf("\n", - gt("Categories bgcolor2"), str); + rsprintf("\n", str); - rsprintf("\n", gt("Categories bgcolor1"), loc("Full name")); + rsprintf("\n", loc("Full name")); rsprintf("\n", gt("Categories bgcolor2"), full_name); - rsprintf("\n", gt("Categories bgcolor1")); - rsprintf("\n"); + rsprintf("\n"); - rsprintf("
%s:
%s:
%s:
%s:
%s:
%s:
Email:    \n", - gt("Categories bgcolor2"), user_email); + rsprintf("
Email:    \n", + user_email); rsprintf("%s:\n", loc("Automatic email notifications")); @@ -6020,9 +6011,10 @@ int i; else rsprintf("
", gt("Categories bgcolor2")); - rsprintf("\n", loc("Change password")); + rsprintf("
\n"); + rsprintf("\n", loc("Change password")); rsprintf("\n", loc("Remove user")); if (getcfg(lbs->name, "Admin user", str) && @@ -6034,8 +6026,6 @@ int i; /* hidden field for password */ rsprintf("\n", password); - rsprintf("
\n\n"); rsprintf("\r\n"); } @@ -6500,7 +6490,9 @@ FILE *f; rsprintf("
\n", sclass, (*n_display)++, message_id); - rsprintf("", ref); + + if (equal_ustring(mode, "Threaded")) + rsprintf("", ref); for (index=0 ; index\n"); + if (equal_ustring(mode, "Threaded")) + rsprintf("\n"); } if (equal_ustring(mode, "Threaded") && expand > 1) @@ -6765,7 +6758,7 @@ FILE *f; { strcpy(str, attachment[index]); str[13] = 0; - sprintf(ref, "../%s/%s/%s", lbs->name_enc, str, attachment[index]+14); + sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[index]+14); url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */ for (i=0 ; i<(int)strlen(attachment[index]) ; i++) @@ -6774,7 +6767,7 @@ FILE *f; if (!show_attachments) { - rsprintf("%s     ", + rsprintf("%s     ", ref, attachment[index]+14); } else @@ -6784,14 +6777,14 @@ FILE *f; strstr(str, ".JPEG") || strstr(str, ".PNG")) { - rsprintf("
%s %d: %s\n", + rsprintf("
%s %d: %s\n", colspan, loc("Attachment"), index+1, ref, attachment[index]+14); if (show_attachments) rsprintf("
%s %d: %s\n", + rsprintf("
%s %d: %s\n", colspan, loc("Attachment"), index+1, ref, attachment[index]+14); if ((strstr(str, ".TXT") || @@ -7423,6 +7416,7 @@ LOGBOOK *lbs_cur; /* default mode */ strcpy(mode, "Summary"); + show_attachments = FALSE; /* for page display, get mode from config file */ if (past_n || last_n || page_n) @@ -7431,7 +7425,6 @@ LOGBOOK *lbs_cur; strcpy(mode, str); if (*getparam("mode")) strcpy(mode, getparam("mode")); - show_attachments = FALSE; } else { @@ -7439,10 +7432,12 @@ LOGBOOK *lbs_cur; strcpy(mode, getparam("mode")); if (mode[0] == 0) strcpy(mode, "Full"); - - show_attachments = (*getparam("attach") > 0); } + /* supersede mode if in parameter */ + if (*getparam("attach")) + show_attachments = (*getparam("attach") > 0); + threaded = equal_ustring(mode, "threaded"); /*---- convert dates to ltime ----*/