]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* Begin migration to the new "rounded boxes" look
[citadel.git] / webcit / messages.c
index 4bd8b0940e6ebc4f43f4d73f9bb24469694a5464..d053a4be6660b2f4e884a875ba3c7083185e4150 100644 (file)
@@ -400,6 +400,10 @@ void read_message(long msgnum) {
 
        wprintf("</TR></TABLE>\n");
 
+       /* Begin body */
+       wprintf("<TABLE BORDER=0 WIDTH=100%% BGCOLOR=#FFFFFF "
+               "CELLPADDING=0 CELLSPACING=0><TR><TD>");
+
        /* 
         * Learn the content type
         */
@@ -407,7 +411,7 @@ void read_message(long msgnum) {
        while (serv_gets(buf), (strlen(buf) > 0)) {
                if (!strcmp(buf, "000")) {
                        wprintf("<I>unexpected end of message</I><BR><BR>\n");
-                       return;
+                       goto ENDBODY;
                }
                if (!strncasecmp(buf, "Content-type: ", 14)) {
                        safestrncpy(mime_content_type, &buf[14],
@@ -495,6 +499,8 @@ void read_message(long msgnum) {
                part_source = NULL;
        }
 
+ENDBODY:
+       wprintf("</TD></TR></TABLE>\n");
 }
 
 
@@ -1115,7 +1121,6 @@ void display_enter(void)
 {
        char buf[SIZ];
        long now;
-       struct tm *tm;
        struct wc_attachment *att;
 
        output_headers(1);
@@ -1137,19 +1142,19 @@ void display_enter(void)
        }
 
        now = time(NULL);
-       tm = (struct tm *) localtime(&now);
-       strcpy(buf, (char *) asctime(tm));
-       buf[strlen(buf) - 1] = 0;
-       strcpy(&buf[16], &buf[19]);
-       wprintf("</CENTER><FONT COLOR=\"#440000\">\n"
-               "<IMG SRC=\"static/enter.gif\" ALIGN=MIDDLE ALT=\" \" "
-               "onLoad=\"document.enterform.msgtext.focus();\" >");
-       wprintf("<B> %s ", &buf[4]);
-       wprintf("from %s ", WC->wc_username);
-       if (strlen(bstr("recp")) > 0)
-               wprintf("to %s ", bstr("recp"));
-       wprintf("in %s&gt; ", WC->wc_roomname);
-       wprintf("</B></FONT><BR><CENTER>\n");
+       fmt_date(buf, now);
+       strcat(&buf[strlen(buf)], " <I>from</I> ");
+       stresc(&buf[strlen(buf)], WC->wc_username, 1);
+       if (strlen(bstr("recp")) > 0) {
+               strcat(&buf[strlen(buf)], " <I>to</I> ");
+               stresc(&buf[strlen(buf)], bstr("recp"), 1);
+       }
+       strcat(&buf[strlen(buf)], " <I>in</I> ");
+       stresc(&buf[strlen(buf)], WC->wc_roomname, 1);
+       svprintf("BOXTITLE", WCS_STRING, buf);
+       do_template("beginbox");
+
+       wprintf("<CENTER>\n");
 
        wprintf("<FORM ENCTYPE=\"multipart/form-data\" "
                "METHOD=\"POST\" ACTION=\"/post\" "
@@ -1158,6 +1163,8 @@ void display_enter(void)
                bstr("recp"));
        wprintf("<INPUT TYPE=\"hidden\" NAME=\"postseq\" VALUE=\"%ld\">\n",
                now);
+       wprintf("<IMG SRC=\"static/enter.gif\" ALIGN=MIDDLE ALT=\" \" "
+               "onLoad=\"document.enterform.msgtext.focus();\" >");
        wprintf("<FONT SIZE=-1>Subject (optional):</FONT>"
                "<INPUT TYPE=\"text\" NAME=\"subject\" VALUE=\"");
        escputs(bstr("subject"));
@@ -1166,7 +1173,7 @@ void display_enter(void)
                "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save message\">"
                "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
 
-       wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft ROWS=30 COLS=80 "
+       wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft ROWS=25 COLS=80 "
                "WIDTH=80>");
        escputs(bstr("msgtext"));
        wprintf("</TEXTAREA><BR>\n");
@@ -1186,8 +1193,8 @@ void display_enter(void)
                "<input type=\"submit\" name=\"attach\" value=\"Add\">\n");
 
        wprintf("</FORM></CENTER>\n");
+       do_template("endbox");
 DONE:  wDumpContent(1);
-       wprintf("</FONT>");
 }