X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsummary.c;h=faa4f45b2d82b02e59316919d1d2e7247ce4dc88;hb=HEAD;hp=1c784861192130e41af52ed0024aa99d4c1c8d85;hpb=f7c7f356784c08b353785ac0b66d2ac3bd1ed251;p=citadel.git diff --git a/webcit/summary.c b/webcit/summary.c index 1c7848611..5dbe60435 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -1,10 +1,21 @@ /* - * $Id$ - * * Displays the "Summary Page" + * + * Copyright (c) 1996-2021 by the citadel.org team + * + * This program is open source software. You can redistribute it and/or + * modify it under the terms of the GNU General Public License, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "webcit.h" +#include "calendar.h" + +extern int calendar_summary_view(void); /* * Display today's date in a friendly format @@ -12,53 +23,27 @@ void output_date(void) { struct tm tm; time_t now; - - static char *wdays[7]; - static char *months[12]; - - wdays[0] = _("Sunday"); - wdays[1] = _("Monday"); - wdays[2] = _("Tuesday"); - wdays[3] = _("Wednesday"); - wdays[4] = _("Thursday"); - wdays[5] = _("Friday"); - wdays[6] = _("Saturday"); - - months[0] = _("January"); - months[1] = _("February"); - months[2] = _("March"); - months[3] = _("April"); - months[4] = _("May"); - months[5] = _("June"); - months[6] = _("July"); - months[7] = _("August"); - months[8] = _("September"); - months[9] = _("October"); - months[10] = _("November"); - months[12] = _("December"); + char buf[128]; time(&now); localtime_r(&now, &tm); - wprintf("%s, %s %d, %d", - wdays[tm.tm_wday], - months[tm.tm_mon], - tm.tm_mday, - tm.tm_year + 1900 - ); + wc_strftime(buf, 32, "%A, %x", &tm); + wc_printf("%s", buf); } +void tmplput_output_date(StrBuf *Target, WCTemplputParams *TP) +{ + struct tm tm; + time_t now; + char buf[128]; + size_t n; + time(&now); + localtime_r(&now, &tm); - -/* - * Dummy section - */ -void dummy_section(void) { - svprintf("BOXTITLE", WCS_STRING, "(dummy section)"); - do_template("beginbox"); - wprintf(_("(nothing)")); - do_template("endbox"); + n = wc_strftime(buf, 32, "%A, %x", &tm); + StrBufAppendBufPlain(Target, buf, n, 0); } @@ -72,13 +57,11 @@ 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; - wprintf("
"); + wc_printf("\">"); escputs(room); - wprintf(" | %d/%d | \n", + wc_printf("%d/%d | \n", extract_int(&buf[4], 1), extract_int(&buf[4], 2) ); } } - wprintf("
"); - wholist_section(); - - /* - * Column Two - */ - wprintf(" | ");
- server_info_section();
- wprintf(" "); - tasks_section(); +void display_summary_page(void) +{ + output_headers(1, 1, 1, 0, 0, 0); + do_template("summary_page"); + wDumpContent(1); +} - /* - * Column Three - */ - wprintf(" | ");
- new_messages_section();
- wprintf(" "); - calendar_section(); - /* - * End of columns - */ - wprintf(" |