Used altern table to display remote POP3 accounts and RSS feeds in room
authorThierry Pasqualier <thierry@uncensored.citadel.org>
Fri, 2 Nov 2007 21:29:11 +0000 (21:29 +0000)
committerThierry Pasqualier <thierry@uncensored.citadel.org>
Fri, 2 Nov 2007 21:29:11 +0000 (21:29 +0000)
configuration:  Remote retrieval tab

webcit/roomops.c
webcit/static/webcit.css

index 453e7e8c361069c1efb0191f831ed08b17704099..bb93656890486281a97a19bfb9631cd9d03cf588 100644 (file)
@@ -1033,6 +1033,7 @@ void display_editroom(void)
        int floorvalue = 0;
        char pop3_host[128];
        char pop3_user[32];
+       int bg = 0;
 
        tab = bstr("tab");
        if (IsEmptyStr(tab)) tab = "admin";
@@ -1770,23 +1771,29 @@ void display_editroom(void)
                wprintf(_("Retrieve messages from these remote POP3 accounts and store them in this room:"));
                wprintf("</i><br />\n");
 
-               wprintf("<table border=0 cellpadding=5><tr class=\"tab_cell\"><td>");
+               wprintf("<table class=\"altern\" border=0 cellpadding=5>"
+                       "<tr class=\"even\"><th>");
                wprintf(_("Remote host"));
-               wprintf("</td><td>");
+               wprintf("</th><th>");
                wprintf(_("User name"));
-               wprintf("</td><td>");
+               wprintf("</th><th>");
                wprintf(_("Password"));
-               wprintf("</td><td>");
+               wprintf("</th><th>");
                wprintf(_("Keep messages on server?"));
-               wprintf("</td><td> </td></tr>");
+               wprintf("</th><th> </th></tr>");
 
                serv_puts("GNET");
                serv_getln(buf, sizeof buf);
+               bg = 1;
                if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        extract_token(cmd, buf, 0, '|', sizeof cmd);
                        if (!strcasecmp(cmd, "pop3client")) {
                                safestrncpy(recp, &buf[11], sizeof recp);
-                               wprintf("<tr>");
+
+                                bg = 1 - bg;
+                                wprintf("<tr class=\"%s\">",
+                                        (bg ? "even" : "odd")
+                                );
 
                                wprintf("<td>");
                                extract_token(pop3_host, buf, 1, '|', sizeof pop3_host);
@@ -1802,12 +1809,12 @@ void display_editroom(void)
 
                                wprintf("<td>%s</td>", extract_int(buf, 4) ? _("Yes") : _("No"));
 
-                               wprintf("<td>");
+                               wprintf("<td class=\"button_link\">");
                                wprintf(" <a href=\"netedit&cmd=remove&tab=feeds&line=pop3client|");
                                urlescputs(recp);
                                wprintf("\">");
                                wprintf(_("(remove)"));
-                               wprintf("</A></td>");
+                               wprintf("</a></td>");
                        
                                wprintf("</tr>");
                        }
@@ -1815,8 +1822,8 @@ void display_editroom(void)
 
                wprintf("<form method=\"POST\" action=\"netedit\">\n"
                        "<tr>"
-                       "<input type=\"hidden\" NAME=\"tab\" VALUE=\"feeds\">"
-                       "<input type=\"hidden\" NAME=\"prefix\" VALUE=\"pop3client|\">\n");
+                       "<input type=\"hidden\" name=\"tab\" value=\"feeds\">"
+                       "<input type=\"hidden\" name=\"prefix\" value=\"pop3client|\">\n");
                wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
                wprintf("<td>");
                wprintf("<input type=\"text\" id=\"add_as_pop3host\" NAME=\"line_pop3host\">\n");
@@ -1841,31 +1848,37 @@ void display_editroom(void)
                wprintf(_("Fetch the following RSS feeds and store them in this room:"));
                wprintf("</i><br />\n");
 
-               wprintf("<table border=0 cellpadding=5><tr class=\"tab_cell\"><td>");
+               wprintf("<table class=\"altern\" border=0 cellpadding=5>"
+                       "<tr class=\"even\"><th>");
                wprintf("<img src=\"static/rss_16x.png\" width=\"16\" height=\"16\" alt=\" \"> ");
                wprintf(_("Feed URL"));
-               wprintf("</td><td>");
-               wprintf("</td></tr>");
+               wprintf("</th><th>");
+               wprintf("</th></tr>");
 
                serv_puts("GNET");
                serv_getln(buf, sizeof buf);
+               bg = 1;
                if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        extract_token(cmd, buf, 0, '|', sizeof cmd);
                        if (!strcasecmp(cmd, "rssclient")) {
                                safestrncpy(recp, &buf[10], sizeof recp);
-                               wprintf("<tr>");
+
+                                bg = 1 - bg;
+                                wprintf("<tr class=\"%s\">",
+                                        (bg ? "even" : "odd")
+                                );
 
                                wprintf("<td>");
                                extract_token(pop3_host, buf, 1, '|', sizeof pop3_host);
                                escputs(pop3_host);
                                wprintf("</td>");
 
-                               wprintf("<td>");
+                               wprintf("<td class=\"button_link\">");
                                wprintf(" <a href=\"netedit&cmd=remove&tab=feeds&line=rssclient|");
                                urlescputs(recp);
                                wprintf("\">");
                                wprintf(_("(remove)"));
-                               wprintf("</A></td>");
+                               wprintf("</a></td>");
                        
                                wprintf("</tr>");
                        }
@@ -1873,15 +1886,15 @@ void display_editroom(void)
 
                wprintf("<form method=\"POST\" action=\"netedit\">\n"
                        "<tr>"
-                       "<input type=\"hidden\" NAME=\"tab\" VALUE=\"feeds\">"
-                       "<input type=\"hidden\" NAME=\"prefix\" VALUE=\"rssclient|\">\n");
+                       "<input type=\"hidden\" name=\"tab\" value=\"feeds\">"
+                       "<input type=\"hidden\" name=\"prefix\" value=\"rssclient|\">\n");
                wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
                wprintf("<td>");
-               wprintf("<input type=\"text\" id=\"add_as_pop3host\" SIZE=\"72\" "
-                       "MAXLENGTH=\"256\" NAME=\"line_pop3host\">\n");
+               wprintf("<input type=\"text\" id=\"add_as_pop3host\" size=\"72\" "
+                       "maxlength=\"256\" name=\"line_pop3host\">\n");
                wprintf("</td>");
                wprintf("<td>");
-               wprintf("<input type=\"submit\" NAME=\"add_button\" VALUE=\"%s\">", _("Add"));
+               wprintf("<input type=\"submit\" name=\"add_button\" value=\"%s\">", _("Add"));
                wprintf("</td></tr>");
                wprintf("</form></table>\n");
 
index eac437a9d031695ed65aea9083c9956e31d1268f..13f2b60b7837f634201cb12816970b710eed0564 100644 (file)
@@ -48,11 +48,11 @@ body {
        cursor: help;
 }
 
-input, select, #login_form #uname, #login_form #pname, #wholist li.activeuser a, .room_actions form select, .room_actions li.search input, .address_book_popup_title {
+.button_link a, input, select, #login_form #uname, #login_form #pname, #wholist li.activeuser a, .room_actions form select, .room_actions li.search input, .address_book_popup_title {
        background-color: #fbf4ca;
 }
 
-input, select, #login_form #uname, #login_form #pname, .room_actions form select, .room_actions li.search input, .address_book_popup_title {
+.button_link a, input, select, #login_form #uname, #login_form #pname, .room_actions form select, .room_actions li.search input, .address_book_popup_title {
        border: 1px solid #999;
        color: #333;
 }
@@ -440,7 +440,7 @@ a:visited { color: purple; }
        color: #FFF;
 }
 
-.button_link a, .msgbuttons a, input#delbutton,.attachfile, .logbuttons input,.buttons input, .send_edit_msg input {
+.msgbuttons a, input#delbutton,.attachfile, .logbuttons input,.buttons input, .send_edit_msg input {
        background-color: transparent;
        border: 2px groove #CCC;
        color: #333;
@@ -448,6 +448,11 @@ a:visited { color: purple; }
        cursor: pointer;
 }
 
+.button_link a {
+       color: #333;
+       cursor: pointer;
+}
+
 /* Layout */
 
 * html {
@@ -603,7 +608,7 @@ body, #global {
 
 #login_screen #login_form {
        padding: 10px;
-       width: 320px;
+       width: 330px;
 }
 
 #login_form input, #login_form label, #login_form select {
@@ -821,7 +826,7 @@ html>body #button li a {
        padding: 0;
 }
 
-.button_link a, .msgbuttons a {
+.button_link a, .msgbuttons a, .logbutton {
        margin: 0 3px 0 3px;
        padding: 2px;
 }
@@ -1093,7 +1098,7 @@ table.advanced {
 
 .logbuttons, .buttons {
        margin: 2px auto 2px auto;
-       width: 95%;
+       width: 96%;
        text-align: center;
 }