Version 21.86.5: Mar 26, 2022 Working on design of dark theme.

This commit is contained in:
acanas 2022-03-26 21:08:25 +01:00
parent ed7ca2489e
commit e9faa5080d
10 changed files with 122 additions and 111 deletions

View File

@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
TODO: Attach pdf files in multimedia.
*/
#define Log_PLATFORM_VERSION "SWAD 21.86.4 (2022-03-25)"
#define Log_PLATFORM_VERSION "SWAD 21.86.5 (2022-03-25)"
#define CSS_FILE "swad21.85.1.css"
#define JS_FILE "swad21.78.2.js"
/*
Version 21.86.5: Mar 26, 2022 Working on design of dark theme. (323750 lines)
Version 21.86.4: Mar 26, 2022 Working on design of dark theme. (323737 lines)
Version 21.86.3: Mar 25, 2022 Working on design of dark theme. (323709 lines)
Version 21.86.2: Mar 25, 2022 Working on design of dark theme. (323687 lines)

View File

@ -270,16 +270,17 @@ static void Rep_PutLinkToMyUsageReport (struct Rep_Report *Report)
static void Rep_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC)
{
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_User[Usr_NUM_SEXS];
extern const char *Txt_Date;
HTM_DIV_Begin ("class=\"TITLE_REPORT %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"TITLE_REPORT DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
/***** User *****/
HTM_TxtColonNBSP (Txt_User[Gbl.Usrs.Me.UsrDat.Sex]);
HTM_SPAN_Begin ("class=\"%s BOLD\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_SPAN_Begin ("class=\"DAT_STRONG_%s BOLD\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Gbl.Usrs.Me.UsrDat.FullName);
HTM_SPAN_End ();
@ -288,7 +289,8 @@ static void Rep_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC)
{
HTM_BR ();
HTM_TxtColonNBSP (Txt_Date);
HTM_SPAN_Begin ("class=\"%s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_SPAN_Begin ("class=\"DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%s %s UTC",CurrentTimeUTC->StrDate,
CurrentTimeUTC->StrTime);
HTM_SPAN_End ();

View File

@ -258,7 +258,7 @@ static void SysCfg_Map (void)
static void SysCfg_Platform (void)
{
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Platform;
/***** Institution *****/
@ -268,7 +268,7 @@ static void SysCfg_Platform (void)
Frm_LabelColumn ("RT",NULL,Txt_Platform);
/* Data */
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Cfg_PLATFORM_SHORT_NAME);
HTM_TD_End ();

View File

@ -303,7 +303,6 @@ void Tst_ReceiveTestDraft (void)
void Tst_AssessTest (void)
{
extern const char *Hlp_ASSESSMENT_Tests;
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Result;
extern const char *Txt_Test_No_X_that_you_make_in_this_course;
@ -374,7 +373,8 @@ void Tst_AssessTest (void)
/***** Write total score and grade *****/
if (TstVis_IsVisibleTotalScore (TstCfg_GetConfigVisibility ()))
{
HTM_DIV_Begin ("class=\"CM %s BOLD\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"CM DAT_STRONG_%s BOLD\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColonNBSP (Txt_Score);
HTM_Double2Decimals (Print.Score);
HTM_BR ();
@ -748,8 +748,7 @@ static unsigned Tst_GetParamNumQsts (void)
void Tst_GetAndShowTestsStats (void)
{
extern const char *Hlp_ANALYTICS_Figures_tests;
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES];
extern const char *Txt_Type_of_BR_answers;
extern const char *Txt_Number_of_BR_courses_BR_with_test_BR_questions;
@ -793,15 +792,15 @@ void Tst_GetAndShowTestsStats (void)
/***** Write stats *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"%s LM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_TST_STR_ANSWER_TYPES[AnsType]);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Stats.NumCoursesWithQuestions);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%u (%.1lf%%)",
Stats.NumCoursesWithPluggableQuestions,
Stats.NumCoursesWithQuestions ? (double) Stats.NumCoursesWithPluggableQuestions * 100.0 /
@ -809,27 +808,27 @@ void Tst_GetAndShowTestsStats (void)
0.0);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Stats.NumQsts);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgQstsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_UnsignedLong (Stats.NumHits);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgHitsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgHitsPerQuestion);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgScorePerQuestion);
HTM_TD_End ();
@ -842,15 +841,18 @@ void Tst_GetAndShowTestsStats (void)
/***** Write stats *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"LM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_Total);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Stats.NumCoursesWithQuestions);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%u (%.1f%%)",
Stats.NumCoursesWithPluggableQuestions,
Stats.NumCoursesWithQuestions ? (double) Stats.NumCoursesWithPluggableQuestions * 100.0 /
@ -858,27 +860,33 @@ void Tst_GetAndShowTestsStats (void)
0.0);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Stats.NumQsts);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgQstsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_UnsignedLong (Stats.NumHits);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgHitsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgHitsPerQuestion);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Stats.AvgScorePerQuestion);
HTM_TD_End ();

View File

@ -2105,7 +2105,7 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe,
struct TstPrn_NumQuestions *NumTotalQsts,
double TotalScore)
{
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Visible_tests;
bool ICanViewTotalScore;
@ -2135,40 +2135,41 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe,
HTM_TR_Begin (NULL);
/***** Row title *****/
HTM_TD_Begin ("colspan=\"2\" class=\"RM %s LINE_TOP LINE_BOTTOM %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("colspan=\"2\""
" class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
HTM_TxtColonNBSP (Txt_Visible_tests);
HTM_Unsigned (NumPrints);
HTM_TD_End ();
/***** Write total number of questions *****/
HTM_TD_Begin ("class=\"RM %s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
if (NumPrints)
HTM_Unsigned (NumTotalQsts->All);
HTM_TD_End ();
/***** Write total number of non-blank answers *****/
HTM_TD_Begin ("class=\"RM %s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
if (NumPrints)
HTM_Unsigned (NumTotalQsts->NotBlank);
HTM_TD_End ();
/***** Write total number of blank answers *****/
HTM_TD_Begin ("class=\"RM %s LINE_TOP LINE_BOTTOM %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
if (NumPrints)
HTM_Unsigned (NumTotalQsts->All - NumTotalQsts->NotBlank);
HTM_TD_End ();
/***** Write total score *****/
HTM_TD_Begin ("class=\"RM %s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
if (ICanViewTotalScore)
{
@ -2179,8 +2180,8 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe,
HTM_TD_End ();
/***** Write average score per question *****/
HTM_TD_Begin ("class=\"RM %s LINE_TOP LINE_BOTTOM %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
if (ICanViewTotalScore)
HTM_Double2Decimals (NumTotalQsts->All ? TotalScore / (double) NumTotalQsts->All :
@ -2188,16 +2189,16 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe,
HTM_TD_End ();
/***** Write grade over Tst_SCORE_MAX *****/
HTM_TD_Begin ("class=\"RM %s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
if (ICanViewTotalScore)
TstPrn_ComputeAndShowGrade (NumTotalQsts->All,TotalScore,Tst_SCORE_MAX);
HTM_TD_End ();
/***** Last cell *****/
HTM_TD_Begin ("class=\"%s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_ClassDatStrong[Gbl.Prefs.Theme],
HTM_TD_Begin ("class=\"DAT_STRONG_%s LINE_TOP LINE_BOTTOM LINE_LEFT %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
HTM_TD_End ();
@ -2212,8 +2213,7 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe,
void TstPrn_ShowOnePrint (void)
{
extern const char *Hlp_ASSESSMENT_Tests_results;
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Result;
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
@ -2277,11 +2277,12 @@ void TstPrn_ShowOnePrint (void)
/* User */
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs][Gbl.Usrs.Other.UsrDat.Sex]);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
ID_WriteUsrIDs (&Gbl.Usrs.Other.UsrDat,NULL);
HTM_TxtF (" %s",Gbl.Usrs.Other.UsrDat.Surname1);
if (Gbl.Usrs.Other.UsrDat.Surname2[0])
@ -2306,12 +2307,13 @@ void TstPrn_ShowOnePrint (void)
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_START_END_TIME[StartEndTime]);
HTM_TD_End ();
HTM_TD_Begin ("id=\"%s\" class=\"%s LB\"",
Id,The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("id=\"%s\" class=\"LB DAT_%s\"",
Id,The_Colors[Gbl.Prefs.Theme]);
Dat_WriteLocalDateHMSFromUTC (Id,Print.TimeUTC[StartEndTime],
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
true,true,true,0x7);
@ -2325,11 +2327,13 @@ void TstPrn_ShowOnePrint (void)
/***** Number of questions *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_Questions);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Print.NumQsts.All);
HTM_TD_End ();
@ -2338,11 +2342,13 @@ void TstPrn_ShowOnePrint (void)
/***** Number of answers *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_Answers);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Print.NumQsts.NotBlank);
HTM_TD_End ();
@ -2351,11 +2357,13 @@ void TstPrn_ShowOnePrint (void)
/***** Score *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_Score);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
if (ICanView.Score)
{
HTM_STRONG_Begin ();
@ -2373,11 +2381,13 @@ void TstPrn_ShowOnePrint (void)
/***** Grade *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_Grade);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
if (ICanView.Score)
{
HTM_STRONG_Begin ();
@ -2393,11 +2403,13 @@ void TstPrn_ShowOnePrint (void)
/***** Tags present in this test *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RT %s\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RT DAT_STRONG_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColon (Txt_Tags);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB %s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LB DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
TstPrn_ShowTagsPresentInAPrint (Print.PrnCod);
HTM_TD_End ();

View File

@ -199,17 +199,6 @@ const char *The_ClassDat[The_NUM_THEMES] =
[The_THEME_DARK ] = "DAT_DARK",
};
const char *The_ClassDatStrong[The_NUM_THEMES] =
{
[The_THEME_WHITE ] = "DAT_STRONG_WHITE",
[The_THEME_GREY ] = "DAT_STRONG_GREY",
[The_THEME_PURPLE] = "DAT_STRONG_PURPLE",
[The_THEME_BLUE ] = "DAT_STRONG_BLUE",
[The_THEME_YELLOW] = "DAT_STRONG_YELLOW",
[The_THEME_PINK ] = "DAT_STRONG_PINK",
[The_THEME_DARK ] = "DAT_STRONG_DARK",
};
const char *The_ClassInput[The_NUM_THEMES] =
{
[The_THEME_WHITE ] = "INPUT_WHITE",

View File

@ -545,8 +545,7 @@ void Tml_WriteDateTime (time_t TimeUTC)
void Tml_GetAndShowTimelineActivityStats (void)
{
extern const char *Hlp_ANALYTICS_Figures_timeline;
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES];
extern const char *Txt_Type;
extern const char *Txt_Number_of_posts;
@ -611,25 +610,25 @@ void Tml_GetAndShowTimelineActivityStats (void)
/***** Write number of timeline notes and number of users *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"%s LM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_TIMELINE_NOTE[NoteType]);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (NumNotes);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (NumUsrs);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (NumUsrs ? (double) NumNotes /
(double) NumUsrs :
0.0);
@ -666,25 +665,30 @@ void Tml_GetAndShowTimelineActivityStats (void)
/* Write totals */
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"LM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_Total);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (NumNotes);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (NumUsrs);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM %s LINE_TOP\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (NumUsrs ? (double) NumNotes / (double) NumUsrs :
0.0);
HTM_TD_End ();

View File

@ -316,15 +316,15 @@ void TmlNot_ShowAuthorPhoto (struct UsrData *UsrDat,bool FormUnique)
static void TmlNot_WriteAuthorTimeAndContent (const struct TmlNot_Note *Not,
const struct UsrData *UsrDat)
{
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
char *Class;
/***** Begin top container *****/
HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\"");
/***** Write author's full name *****/
if (asprintf (&Class,"Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH BT_LINK %s BOLD",
The_ClassDatStrong[Gbl.Prefs.Theme]) < 0)
if (asprintf (&Class,"Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH BT_LINK DAT_STRONG_%s BOLD",
The_Colors[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
TmlNot_WriteAuthorName (UsrDat,Class);
free (Class);
@ -344,7 +344,7 @@ static void TmlNot_WriteAuthorTimeAndContent (const struct TmlNot_Note *Not,
/*****************************************************************************/
void TmlNot_WriteAuthorName (const struct UsrData *UsrDat,
const char *Class)
const char *Class)
{
extern const char *Txt_My_public_profile;
extern const char *Txt_Another_user_s_profile;

View File

@ -172,7 +172,7 @@ void TmlPst_PutPhotoAndFormToWriteNewPost (struct Tml_Timeline *Timeline)
static void TmlPst_PutFormToWriteNewPost (struct Tml_Timeline *Timeline)
{
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *The_ClassInput[The_NUM_THEMES];
extern const char *Txt_New_TIMELINE_post;
char *Class;
@ -181,8 +181,8 @@ static void TmlPst_PutFormToWriteNewPost (struct Tml_Timeline *Timeline)
HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\"");
/***** Author name *****/
if (asprintf (&Class,"Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH BT_LINK %s BOLD",
The_ClassDatStrong[Gbl.Prefs.Theme]) < 0)
if (asprintf (&Class,"Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH BT_LINK DAT_STRONG_%s BOLD",
The_Colors[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
TmlNot_WriteAuthorName (&Gbl.Usrs.Me.UsrDat,Class);
free (Class);

View File

@ -2044,8 +2044,7 @@ void Usr_ShowFormsLogoutAndRole (void)
{
extern const char *Hlp_PROFILE_Session_role;
extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *The_ClassInput[The_NUM_THEMES];
extern const char *Txt_Session;
extern const char *Txt_Role;
@ -2068,11 +2067,12 @@ void Usr_ShowFormsLogoutAndRole (void)
/***** Put a form to change my role *****/
if (Rol_GetNumAvailableRoles () == 1)
{
HTM_SPAN_Begin ("class=\"%s\"",The_ClassDat[Gbl.Prefs.Theme]);
HTM_SPAN_Begin ("class=\"DAT_%s\"",The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColonNBSP (Txt_Role);
HTM_SPAN_End ();
HTM_SPAN_Begin ("class=\"%s BOLD\"",The_ClassDatStrong[Gbl.Prefs.Theme]);
HTM_SPAN_Begin ("class=\"DAT_STRONG_%s BOLD\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Me.Role.Logged][Gbl.Usrs.Me.UsrDat.Sex]);
HTM_SPAN_End ();
}
@ -6600,54 +6600,49 @@ void Usr_GetAndShowUsersStats (void)
static void Usr_GetAndShowNumUsrsInCrss (Rol_Role_t Role)
{
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Total;
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
long Cod = Sco_GetCurrentCod ();
char *Class;
const char *Class;
unsigned Roles;
/***** Initializations depending on role *****/
if (Role == Rol_UNK)
{
if (asprintf (&Class,"RB %s LINE_TOP",The_ClassDatStrong[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
Class = "RB LINE_TOP DAT_STRONG";
Roles = (1 << Rol_STD) |
(1 << Rol_NET) |
(1 << Rol_TCH);
}
else
{
if (asprintf (&Class,"RB %s",The_ClassDat[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
Class = "RB DAT";
Roles = (1 << Role);
}
/***** Write the total number of users *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"%s\"",Class);
HTM_TD_Begin ("class=\"%s_%s\"",Class,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt ((Role == Rol_UNK) ? Txt_Total :
Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]);
HTM_TD_End ();
/* Number of users in courses */
HTM_TD_Begin ("class=\"%s\"",Class);
HTM_TD_Begin ("class=\"%s_%s\"",Class,The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (Enr_GetCachedNumUsrsInCrss (Gbl.Scope.Current,Cod,Roles));
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s\"",Class);
HTM_TD_Begin ("class=\"%s_%s\"",Class,The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Enr_GetCachedAverageNumCrssPerUsr (Gbl.Scope.Current,Cod,Role));
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s\"",Class);
HTM_TD_Begin ("class=\"%s_%s\"",Class,The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Enr_GetCachedAverageNumUsrsPerCrs (Gbl.Scope.Current,Cod,Role));
HTM_TD_End ();
HTM_TR_End ();
free (Class);
}
/*****************************************************************************/