]> code.citadel.org Git - citadel.git/commitdiff
* Made the header-bar buttons more visible
authorArt Cancro <ajc@citadel.org>
Sun, 19 Mar 2000 22:49:09 +0000 (22:49 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 19 Mar 2000 22:49:09 +0000 (22:49 +0000)
* Added a "reply" header-bar button
* Move "Subject:" lines into the header-bar
* Padded the header-bars by one pixel (nicer looking)
* Changed message date/time output format

webcit/ChangeLog
webcit/messages.c
webcit/static/menubar.html
webcit/tools.c
webcit/webcit.c
webcit/webcit.h

index 5dbaf463dbea59792f6a6b1988de93a649e60288..a42cf9778569df26131896432e706514de705cad 100644 (file)
@@ -1,4 +1,11 @@
 $Log$
+Revision 211.5  2000/03/19 22:49:03  ajc
+* Made the header-bar buttons more visible
+* Added a "reply" header-bar button
+* Move "Subject:" lines into the header-bar
+* Padded the header-bars by one pixel (nicer looking)
+* Changed message date/time output format
+
 Revision 211.4  2000/03/19 19:49:31  ajc
 * Added support for unix domain sockets
 
@@ -385,3 +392,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 128c1c1145362036b1c7242d6d409e3e2a3a96c5..7fae2ee80a8e3aa16a7f92f767bb739c16bcaceb 100644 (file)
@@ -11,7 +11,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
-#include <sys/time.h>
 #include <limits.h>
 #include <netinet/in.h>
 #include <netdb.h>
@@ -89,12 +88,19 @@ char *oper;
        char buf[256];
        char m_subject[256];
        char from[256];
-       long now;
-       struct tm *tm;
+       char node[256];
+       char rfca[256];
+       char reply_to[512];
+       char now[256];
        int format_type = 0;
        int nhdr = 0;
        int bq = 0;
 
+       strcpy(from, "");
+       strcpy(node, "");
+       strcpy(rfca, "");
+       strcpy(reply_to, "");
+
        sprintf(buf, "MSG0 %ld", msgnum);
        serv_puts(buf);
        serv_gets(buf);
@@ -102,11 +108,10 @@ char *oper;
                wprintf("<STRONG>ERROR:</STRONG> %s<BR>\n", &buf[4]);
                return;
        }
-       wprintf("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=000077><TR><TD>\n");
+       wprintf("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=1 BGCOLOR=000077><TR><TD>\n");
        wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\" SIZE=+1 COLOR=\"FFFF00\"> ");
        strcpy(m_subject, "");
 
-       strcpy(WC->reply_to, "nobody...xxxxx");
        while (serv_gets(buf), strncasecmp(buf, "text", 4)) {
                if (!strncasecmp(buf, "nhdr=yes", 8))
                        nhdr = 1;
@@ -115,11 +120,11 @@ char *oper;
                if (!strncasecmp(buf, "type=", 5))
                        format_type = atoi(&buf[5]);
                if (!strncasecmp(buf, "from=", 5)) {
-                       wprintf("from %s ", &buf[5]);
                        strcpy(from, &buf[5]);
+                       wprintf("from ");
+                       escputs(from);
+                       wprintf(" ");
                }
-               if (!strncasecmp(buf, "path=", 5))
-                       strcpy(WC->reply_to, &buf[5]);
                if (!strncasecmp(buf, "subj=", 5))
                        strcpy(m_subject, &buf[5]);
                if ((!strncasecmp(buf, "hnod=", 5))
@@ -128,29 +133,42 @@ char *oper;
                if ((!strncasecmp(buf, "room=", 5))
                    && (strcasecmp(&buf[5], WC->wc_roomname)))
                        wprintf("in %s> ", &buf[5]);
+               if (!strncasecmp(buf, "rfca=", 5)) {
+                       strcpy(rfca, &buf[5]);
+                       wprintf("&lt;");
+                       escputs(rfca);
+                       wprintf("&gt; ");
+               }
 
                if (!strncasecmp(buf, "node=", 5)) {
-                       if ((WC->room_flags & QR_NETWORK)
+                       if ( ((WC->room_flags & QR_NETWORK)
                        || ((strcasecmp(&buf[5], serv_info.serv_nodename)
-                       && (strcasecmp(&buf[5], serv_info.serv_fqdn))))) {
+                       && (strcasecmp(&buf[5], serv_info.serv_fqdn)))))
+                       && (strlen(rfca)==0)
+                       ) {
                                wprintf("@%s ", &buf[5]);
                        }
-                       if ((!strcasecmp(&buf[5], serv_info.serv_nodename))
-                       || (!strcasecmp(&buf[5], serv_info.serv_fqdn))) {
-                               strcpy(WC->reply_to, from);
-                       } else if (haschar(&buf[5], '.') == 0) {
-                               sprintf(WC->reply_to, "%s @ %s", from, &buf[5]);
-                       }
                }
                if (!strncasecmp(buf, "rcpt=", 5))
                        wprintf("to %s ", &buf[5]);
                if (!strncasecmp(buf, "time=", 5)) {
-                       now = atol(&buf[5]);
-                       tm = (struct tm *) localtime(&now);
-                       strcpy(buf, (char *) asctime(tm));
-                       buf[strlen(buf) - 1] = 0;
-                       strcpy(&buf[16], &buf[19]);
-                       wprintf("%s ", &buf[4]);
+                       fmt_date(now, atol(&buf[5]));
+                       wprintf("%s ", now);
+               }
+       }
+
+
+       /* Generate a reply-to address */
+       if (strlen(rfca) > 0) {
+               strcpy(reply_to, rfca);
+       }
+       else {
+               if (strlen(node) > 0) {
+                       snprintf(reply_to, sizeof(reply_to), "%s @ %s",
+                               from, node);
+               }
+               else {
+                       snprintf(reply_to, sizeof(reply_to), "%s", from);
                }
        }
 
@@ -158,26 +176,45 @@ char *oper;
                wprintf("****");
        wprintf("</FONT></TD>");
 
+       /* begin right-hand toolbar */
+       wprintf("<TD ALIGN=RIGHT>\n"
+               "<TABLE BORDER=0><TR>\n");
+
+       wprintf("<TD BGCOLOR=\"AAAADD\">"
+               "<A HREF=\"/display_enter?recp=");
+       urlescputs(reply_to);
+       wprintf("\">Reply</A>"
+               "</TD>\n", msgnum);
+
        if (WC->is_room_aide) {
-               wprintf("<TD ALIGN=RIGHT NOWRAP><FONT FACE=\"Arial,Helvetica,sans-serif\" COLOR=\"FFFF00\"><B>");
+               wprintf("<TD BGCOLOR=\"AAAADD\">"
+                       "<A HREF=\"/confirm_move_msg"
+                       "&msgid=%ld"
+                       "\">Move</A>"
+                       "</TD>\n", msgnum);
+
+               wprintf("<TD BGCOLOR=\"AAAADD\">"
+                       "<A HREF=\"/confirm_delete_msg"
+                       "&msgid=%ld"
+                       "\">Del</A>"
+                       "</TD>\n", msgnum);
 
-               wprintf("<A HREF=\"/confirm_move_msg");
-               wprintf("&msgid=%ld", msgnum);
-               wprintf("\">Move</A>");
+       }
 
-               wprintf("&nbsp;&nbsp;");
+       wprintf("</TR></TABLE>\n"
+               "</TD>\n");
 
-               wprintf("<A HREF=\"/confirm_delete_msg");
-               wprintf("&msgid=%ld", msgnum);
-               wprintf("\">Del</A>");
+       /* end right-hand toolbar */
 
-               wprintf("</B></FONT></TD>");
-       }
-       wprintf("</TR></TABLE>\n");
 
        if (strlen(m_subject) > 0) {
-               wprintf("Subject: %s<BR>\n", m_subject);
+               wprintf("<TR><TD><FONT COLOR=\"FFFFFF\">"
+                       "Subject: %s</FONT>"
+                       "</TD><TD>&nbsp;</TD></TR>\n", m_subject);
        }
+
+       wprintf("</TR></TABLE>\n");
+
        if (format_type == 0) {
                fmout(NULL);
        } else {
@@ -412,7 +449,6 @@ DONE:       wDumpContent(1);
 
 
 
-
 /*
  * Confirm deletion of a message
  */
index c568a013198f9ce3f4e7a96442f4c473afae3a54..5c934edcdb51b653e4cd44db43781fc747b515a9 100644 (file)
@@ -74,7 +74,7 @@
 <A HREF="http://uncnsrd.mt-kisco.ny.us/citadel" TARGET="aboutcit"
        onMouseOver="window.status='Find out more about Citadel/UX'; return true;"><FONT 
 SIZE=-1 COLOR="#000000">
-P O W E R E D&nbsp;&nbsp;B Y<BR></FONT>
-<IMG SRC="/static/citadel-logo.jpg" WIDTH=75 HEIGHT=76 BORDER=0 ALT="Citadel/UX"></A>
+POWERED BY<BR></FONT>
+<IMG SRC="/static/citadel-logo.jpg" WIDTH=75 HEIGHT=76 BORDER=0 ALT="CITADEL/UX"></A>
 
 </CENTER>
index 3754ac4df8af7f0a2fe074f2492408706e0d27c9..9216105fc4269073e708964272a1f91532bab2c9 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdarg.h>
 #include <pthread.h>
 #include <signal.h>
+#include <sys/time.h>
 #include "webcit.h"
 
 
@@ -130,3 +131,28 @@ char ch;
                        ++b;
        return (b);
 }
+
+
+/*
+ * Format a date/time stamp for output 
+ */
+void fmt_date(char *buf, time_t thetime) {
+       struct tm *tm;
+
+       char *ascmonths[] = {
+               "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+               "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+       };
+
+       strcpy(buf, "");
+       tm = localtime(&thetime);
+
+       sprintf(buf, "%s %d %d %2d:%02d%s",
+               ascmonths[tm->tm_mon],
+               tm->tm_mday,
+               tm->tm_year + 1900,
+               ( (tm->tm_hour > 12) ? (tm->tm_hour - 12) : (tm->tm_hour) ),
+               tm->tm_min,
+               ( (tm->tm_hour > 12) ? "pm" : "am" )
+       );
+}
index fae5530f0c0d51c12148ed35c2ec524f2d16762f..fa50cc04618bfa4cd7cad560b0d96d75e2cd1b3d 100644 (file)
@@ -332,7 +332,7 @@ void output_headers(int print_standard_html_head)
        if (print_standard_html_head == 1) {
                wprintf("<A NAME=\"TheTop\"></A>"
                        "<TABLE border=0 width=100%>"
-                       "<TR VALIGN=TOP><TD>");
+                       "<TR VALIGN=TOP><TD VALIGN=LEFT CELLPADDING=0>");
 
                display_menubar(0);
 
index b2f6da004b19effa37a7631b0c3086d37b59e11b..d986ae60f4912ecd56337899768fec8f6b318f37 100644 (file)
@@ -254,3 +254,4 @@ void mime_parser(char *content,
                    char *cbencoding,
                    void *cbcontent,                                                                char *cbtype,                                                                   size_t cblength)
 );
+void fmt_date(char *buf, time_t thetime);