From 8881cab8696b2b9b1079164be4bd34c715fa18db Mon Sep 17 00:00:00 2001 From: Thierry Pasqualier Date: Wed, 23 May 2007 06:15:49 +0000 Subject: [PATCH] First step: * Separation of various part of the summary * Users list in iconsbar --- webcit/iconbar.c | 5 +- webcit/static/trailing.html | 1 + webcit/static/webcit.css | 18 +++++++ webcit/summary.c | 100 ++++++++++++++++++++++++++---------- webcit/webcit.c | 16 ++++++ webcit/webcit.h | 6 ++- 6 files changed, 116 insertions(+), 30 deletions(-) diff --git a/webcit/iconbar.c b/webcit/iconbar.c index b1c175eec..271a84ee7 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -244,7 +244,10 @@ void do_iconbar(void) { if (ib_displayas != IB_PICONLY) { wprintf(_("Who is online?")); } - wprintf("\n"); + + wprintf("\n"); + wprintf("\n"); } if (ib_chat) { diff --git a/webcit/static/trailing.html b/webcit/static/trailing.html index 38acbdf19..5935680cc 100644 --- a/webcit/static/trailing.html +++ b/webcit/static/trailing.html @@ -1,5 +1,6 @@ diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 95e80dc88..9b57c1f4a 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -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; +} + + diff --git a/webcit/summary.c b/webcit/summary.c index 95fa8a8a4..30b168c3e 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -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("\n"); - do_template("endbox"); } @@ -84,16 +81,16 @@ void wholist_section(void) { char buf[SIZ]; char user[SIZ]; - svprintf("BOXTITLE", WCS_STRING, _("Who's online 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("
\n"); + wprintf("
  • "); + escputs(user); + wprintf("
  • "); } - 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("\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 on your 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("\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 this 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(""); - wholist_section(); + wprintf("
    "); + wprintf("
    "); + wprintf(_("Messages")); + wprintf("
    "); + wprintf("
    "); + new_messages_section(); + wprintf("
    "); + wprintf(""); /** - * Column Two + * Column Two */ - wprintf(""); - server_info_section(); - wprintf("
    "); + wprintf(""); + wprintf("
    "); + wprintf("
    "); + wprintf(_("Tasks")); + wprintf("
    "); + wprintf("
    "); tasks_section(); + wprintf("
    "); + wprintf(""); /** * Column Three */ - wprintf(""); - new_messages_section(); - wprintf("
    "); + wprintf(""); + wprintf("
    "); + wprintf("
    "); + wprintf(_("Today on your calendar")); + wprintf("
    "); + wprintf("
    "); calendar_section(); + wprintf("
    "); + wprintf(""); + + wprintf(""); + wprintf("
    "); + wprintf(""); + + /** + * Row Two - Column One + */ + wprintf(""); + wprintf("
    "); + wprintf("
    "); + wprintf(_("Who's online now")); + wprintf("
    "); + wprintf("
    "); + who_inner_div(); + wprintf("
    "); + wprintf(""); + + /** + * Row Two - Column Two + */ + wprintf(""); + wprintf("
    "); + wprintf("
    "); + wprintf(_("About this server")); + wprintf("
    "); + wprintf("
    "); + server_info_section(); + wprintf("
    "); + wprintf(""); + /** * End of columns */ - wprintf(""); + wprintf(""); } @@ -275,8 +313,14 @@ void summary(void) { wprintf( " \n" ); diff --git a/webcit/webcit.c b/webcit/webcit.c index 1efd44c92..36e1da392 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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(); diff --git a/webcit/webcit.h b/webcit/webcit.h index da0a6c450..4196fb587 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -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); -- 2.30.2