First step:
authorThierry Pasqualier <thierry@uncensored.citadel.org>
Wed, 23 May 2007 06:15:49 +0000 (06:15 +0000)
committerThierry Pasqualier <thierry@uncensored.citadel.org>
Wed, 23 May 2007 06:15:49 +0000 (06:15 +0000)
* Separation of various part of the summary
* Users list in iconsbar

webcit/iconbar.c
webcit/static/trailing.html
webcit/static/webcit.css
webcit/summary.c
webcit/webcit.c
webcit/webcit.h

index b1c175eecc81cd1e815e6f3bae63e1e037c6614e..271a84ee79e7c9029fbcf3eed787e8b28b91b60a 100644 (file)
@@ -244,7 +244,10 @@ void do_iconbar(void) {
                if (ib_displayas != IB_PICONLY) {
                        wprintf(_("Who is online?"));
                }
-               wprintf("</a></li>\n");
+                
+               wprintf("</a>\n");
+               wprintf("<ul id=\"wholist\">");
+               wprintf("</ul></li>\n");
        }
 
        if (ib_chat) {
index 38acbdf19f663ebec7c56b9fbd34a13796eaa118..5935680cc7e4385c42e5cddb71ed5f7f5cfdc9a7 100644 (file)
@@ -1,5 +1,6 @@
 <! start trailing.html>
 <script type="text/javascript">
+ new Ajax.PeriodicalUpdater('wholist', 'wholist_section',{ method: 'get', frequency: 60 }  );
  Rounded("div.box", "small transparent top bottom");
  Rounded("form.box", "small transparent top bottom");
 </script>
index 95e80dc88ade2352795326899f55b43590b90b36..9b57c1f4ae951487ee347ea12ff1bcd3497ce4e7 100644 (file)
@@ -1019,3 +1019,21 @@ div.auto_complete ul strong.highlight {
        background-color: #ffd;
         color: #000;
 }
+
+
+
+#wholist {
+       border: 0;
+}
+
+#wholist li {
+       color: black;
+        text-align: left;
+        list-style: none;
+       border: 0;
+        margin: 0;
+        padding: 2px;
+        white-space: nowrap;
+}
+
+
index 95fa8a8a418cb025b28c005b696eb40cade0af43..30b168c3e6d5e94b8534713c0223a254dbb2d341 100644 (file)
@@ -47,8 +47,6 @@ void new_messages_section(void) {
        int number_of_rooms_to_check;
        char *rooms_to_check = "Mail|Lobby";
 
-       svprintf("BOXTITLE", WCS_STRING, _("Messages"));
-       do_template("beginbox");
 
        number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
        if (number_of_rooms_to_check == 0) return;
@@ -72,7 +70,6 @@ void new_messages_section(void) {
                }
        }
        wprintf("</table>\n");
-       do_template("endbox");
 
 }
 
@@ -84,16 +81,16 @@ void wholist_section(void) {
        char buf[SIZ];
        char user[SIZ];
 
-       svprintf("BOXTITLE", WCS_STRING, _("Who's&nbsp;online&nbsp;now"));
-       do_template("beginbox");
        serv_puts("RWHO");
        serv_getln(buf, sizeof buf);
        if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                extract_token(user, buf, 1, '|', sizeof user);
-               escputs(user);
-               wprintf("<br />\n");
+                wprintf("<li><a href=\"showuser?who=");
+                urlescputs(user);
+                wprintf("\">");
+                escputs(user);
+                wprintf("</a></li>");
        }
-       do_template("endbox");
 }
 
 
@@ -106,8 +103,6 @@ void tasks_section(void) {
        int i;
 #endif
 
-       svprintf("BOXTITLE", WCS_STRING, _("Tasks"));
-       do_template("beginbox");
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
        gotoroom("_TASKS_");
        if (WC->wc_view != VIEW_TASKS) {
@@ -135,7 +130,6 @@ void tasks_section(void) {
        wprintf(_("(This server does not support task lists)"));
        wprintf("</i>\n");
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
-       do_template("endbox");
 }
 
 
@@ -148,8 +142,6 @@ void calendar_section(void) {
        int i;
 #endif
 
-       svprintf("BOXTITLE", WCS_STRING, _("Today&nbsp;on&nbsp;your&nbsp;calendar"));
-       do_template("beginbox");
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
        gotoroom("_CALENDAR_");
        if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
@@ -176,7 +168,6 @@ void calendar_section(void) {
        wprintf(_("(This server does not support calendars)"));
        wprintf("</i>\n");
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
-       do_template("endbox");
 }
 
 /**
@@ -185,9 +176,6 @@ void calendar_section(void) {
 void server_info_section(void) {
        char message[512];
 
-       svprintf("BOXTITLE", WCS_STRING, _("About&nbsp;this&nbsp;server"));
-       do_template("beginbox");
-
        snprintf(message, sizeof message,
                _("You are connected to %s, running %s with %s, and located in %s.  Your system administrator is %s."),
                serv_info.serv_humannode,
@@ -196,12 +184,14 @@ void server_info_section(void) {
                serv_info.serv_bbs_city,
                serv_info.serv_sysadm);
        escputs(message);
-       do_template("endbox");
 }
 
 /**
  * \brief summary of inner div????
  */
+
+
+
 void summary_inner_div(void) {
        /**
         * Now let's do three columns of crap.  All portals and all groupware
@@ -218,28 +208,76 @@ void summary_inner_div(void) {
         * Column One
         */
        wprintf("<td width=33%%>");
-       wholist_section();
+       wprintf("<div class=\"box\">"); 
+       wprintf("<div class=\"boxlabel\">");    
+       wprintf(_("Messages"));
+       wprintf("</div><div class=\"boxcontent\">");    
+       wprintf("<div id=\"msg_inner\">");      
+       new_messages_section();
+       wprintf("</div></div></div>");
+       wprintf("</td>");
 
        /**
-        * Column Two
+        * Column Two 
         */
-       wprintf("</td><td width=33%%>");
-       server_info_section();
-       wprintf("<br />");
+       wprintf("<td width=33%%>");
+       wprintf("<div class=\"box\">"); 
+       wprintf("<div class=\"boxlabel\">");    
+       wprintf(_("Tasks"));
+       wprintf("</div><div class=\"boxcontent\">");    
+       wprintf("<div id=\"tasks_inner\">");    
        tasks_section();
+       wprintf("</div></div></div>");
+       wprintf("</td>");
 
        /**
         * Column Three
         */
-       wprintf("</td><td width=33%%>");
-       new_messages_section();
-       wprintf("<br />");
+       wprintf("<td width=33%%>");
+       wprintf("<div class=\"box\">"); 
+       wprintf("<div class=\"boxlabel\">");    
+       wprintf(_("Today&nbsp;on&nbsp;your&nbsp;calendar"));
+       wprintf("</div><div class=\"boxcontent\">");    
+       wprintf("<div id=\"calendar_inner\">"); 
        calendar_section();
+       wprintf("</div></div></div>");
+       wprintf("</td>");
+
+       wprintf("</tr><tr valign=top>");
+       wprintf("<td colspan=3><br/></td>");
+       wprintf("</tr><tr valign=top>");
+
+       /**
+        * Row Two - Column One
+        */
+       wprintf("<td colspan=2>");
+       wprintf("<div class=\"box\">"); 
+       wprintf("<div class=\"boxlabel\">");    
+       wprintf(_("Who's&nbsp;online&nbsp;now"));
+       wprintf("</div><div class=\"boxcontent\">");    
+       wprintf("<div id=\"who_inner\">");      
+       who_inner_div(); 
+       wprintf("</div></div></div>");
+       wprintf("</td>");
+
+       /**
+        * Row Two - Column Two
+        */
+       wprintf("<td width=33%%>");
+       wprintf("<div class=\"box\">"); 
+       wprintf("<div class=\"boxlabel\">");    
+       wprintf(_("About&nbsp;this&nbsp;server"));
+       wprintf("</div><div class=\"boxcontent\">");    
+       wprintf("<div id=\"info_inner\">");     
+       server_info_section();
+       wprintf("</div></div></div>");
+       wprintf("</td>");
+
 
        /**
         * End of columns
         */
-       wprintf("</td></tr></table>");
+       wprintf("</tr></table>");
 }
 
 
@@ -275,8 +313,14 @@ void summary(void) {
 
        wprintf(
                "<script type=\"text/javascript\">                                      "
-               " new Ajax.PeriodicalUpdater('content', 'summary_inner_div',            "
+               " new Ajax.PeriodicalUpdater('msg_inner', 'new_messages_html',          "
                "                            { method: 'get', frequency: 60 }  );       "
+               " new Ajax.PeriodicalUpdater('tasks_inner', 'tasks_inner_html',         "
+               "                            { method: 'get', frequency: 120 }  );      "
+               " new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html',           "
+               "                            { method: 'get', frequency: 90 }  );       "
+               " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html',             "
+               "                            { method: 'get', frequency: 30 }  );       "
                "</script>                                                              \n"
        );
 
index 1efd44c92e41b138b398adf96bd2fe5eaf4ab5aa..36e1da392e62f62ad1613c2542e1942458ca9fe6 100644 (file)
@@ -1388,6 +1388,22 @@ void session_loop(struct httprequest *req)
                begin_ajax_response();
                who_inner_div();
                end_ajax_response();
+       } else if (!strcasecmp(action, "wholist_section")) {
+               begin_ajax_response();
+               wholist_section();
+               end_ajax_response();
+       } else if (!strcasecmp(action, "new_messages_html")) {
+               begin_ajax_response();
+               new_messages_section();
+               end_ajax_response();
+       } else if (!strcasecmp(action, "tasks_inner_html")) {
+               begin_ajax_response();
+               tasks_section();
+               end_ajax_response();
+       } else if (!strcasecmp(action, "calendar_inner_html")) {
+               begin_ajax_response();
+               calendar_section();
+               end_ajax_response();
        } else if (!strcasecmp(action, "iconbar_ajax_menu")) {
                begin_ajax_response();
                do_iconbar();
index da0a6c450e384adb5a12a30d07317095b1368241..4196fb58705dd2940eebedba713bccd7a0547944 100644 (file)
@@ -126,7 +126,7 @@ extern locale_t wc_locales[];
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
 #define CLIENT_VERSION         710             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    710             /* min required Citadel ver. */
+#define MINIMUM_CIT_VERSION    700             /* min required Citadel ver. */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define LB                     (1)             /* Internal escape chars */
@@ -455,6 +455,10 @@ void serv_getln(char *strbuf, int bufsize);
 void serv_puts(char *string);
 void who(void);
 void who_inner_div(void);
+void wholist_section(void);
+void tasks_section(void);
+void calendar_section(void);
+void new_messages_section(void);
 void fmout(char *align);
 void pullquote_fmout(void);
 void wDumpContent(int);