From 6a8b7c5c4f01df5678732e1a08e0fd9fe85b5c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 4 Sep 2015 19:26:08 +0200 Subject: [PATCH] Version 14.126 --- css/swad_desktop.css | 16 +++++- css/swad_mobile.css | 16 +++++- swad_centre.c | 16 +++--- swad_changelog.h | 3 +- swad_chat.c | 10 ++-- swad_country.c | 23 +++----- swad_course.c | 16 +++--- swad_degree.c | 25 ++++----- swad_file_browser.c | 21 ++++---- swad_group.c | 52 +++++++++--------- swad_indicator.c | 4 +- swad_info.c | 12 ++--- swad_institution.c | 16 +++--- swad_layout.c | 3 +- swad_layout.h | 11 ---- swad_message.c | 4 +- swad_tab.c | 4 +- swad_theme.c | 16 +++--- swad_user.c | 125 +++++++++++++++++-------------------------- 19 files changed, 175 insertions(+), 218 deletions(-) diff --git a/css/swad_desktop.css b/css/swad_desktop.css index 1a2ff153..228d6ecf 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -836,10 +836,22 @@ a:hover img.CENTRE_PHOTO_SHOW .RIGHT_MIDDLE {text-align:right; vertical-align:middle;} .RIGHT_BOTTOM {text-align:right; vertical-align:bottom;} -/************************** Lists with alternating colors ********************/ +/***************** Colors used in headers, backgrounds, etc. *****************/ .COLOR0 {background-color:#F4F2EA;} .COLOR1 {background-color:#FBFAF7;} -.VERY_LIGHT_BLUE {background-color:#DDECF1;} +.LIGHT_GREEN {background-color:#C0FF40;} +.LIGHT_BLUE {background-color:#DDECF1;} +.VERY_LIGHT_BLUE {background-color:#EAF3F6;} + +.TAB_ON_WHITE {background-color:#F7F6F5;} +.TAB_ON_GREY {background-color:#F7F6F5;} +.TAB_ON_BLUE {background-color:#E8F3F6;} +.TAB_ON_YELLOW {background-color:#FFF2BD;} + +.TAB_OFF_WHITE {background-color:#D4D4D4;} +.TAB_OFF_GREY {background-color:#D4D4D4;} +.TAB_OFF_BLUE {background-color:#CAE1E8;} +.TAB_OFF_YELLOW {background-color:#FADE94;} /********************************* Course info *******************************/ #crs_info diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 23b3dcd9..5351d09c 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -645,10 +645,22 @@ a:hover img.CENTRE_PHOTO_SHOW .RIGHT_MIDDLE {text-align:right; vertical-align:middle;} .RIGHT_BOTTOM {text-align:right; vertical-align:bottom;} -/************************** Lists with alternating colors ********************/ +/***************** Colors used in headers, backgrounds, etc. *****************/ .COLOR0 {background-color:#F4F2EA;} .COLOR1 {background-color:#FBFAF7;} -.VERY_LIGHT_BLUE {background-color:#DDECF1;} +.LIGHT_GREEN {background-color:#C0FF40;} +.LIGHT_BLUE {background-color:#DDECF1;} +.VERY_LIGHT_BLUE {background-color:#EAF3F6;} + +.TAB_ON_WHITE {background-color:#F7F6F5;} +.TAB_ON_GREY {background-color:#F7F6F5;} +.TAB_ON_BLUE {background-color:#E8F3F6;} +.TAB_ON_YELLOW {background-color:#FFF2BD;} + +.TAB_OFF_WHITE {background-color:#D4D4D4;} +.TAB_OFF_GREY {background-color:#D4D4D4;} +.TAB_OFF_BLUE {background-color:#CAE1E8;} +.TAB_OFF_YELLOW {background-color:#FADE94;} /********************************* Course info *******************************/ #crs_info diff --git a/swad_centre.c b/swad_centre.c index 6dbbed9e..373685f1 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -108,7 +108,7 @@ void Ctr_SeeCtrWithPendingDegs (void) unsigned NumCtrs; unsigned NumCtr; struct Centre Ctr; - char BgColor[32]; + const char *BgColor; /***** Get centres with pending degrees *****/ switch (Gbl.Usrs.Me.LoggedRole) @@ -161,10 +161,8 @@ void Ctr_SeeCtrWithPendingDegs (void) /* Get centre code (row[0]) */ Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]); - if (Ctr.CtrCod == Gbl.CurrentCtr.Ctr.CtrCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Ctr.CtrCod == Gbl.CurrentCtr.Ctr.CtrCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /* Get data of centre */ Ctr_GetDataOfCentreByCod (&Ctr); @@ -577,7 +575,7 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) extern const char *Txt_CENTRE_STATUS[Ctr_NUM_STATUS_TXT]; struct Place Plc; const char *TxtClass; - char BgColor[32]; + const char *BgColor; Crs_StatusTxt_t StatusTxt; /***** Get data of place of this centre *****/ @@ -586,10 +584,8 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) TxtClass = (Ctr->Status & Ctr_STATUS_BIT_PENDING) ? "DAT_LIGHT" : "DAT"; - if (Ctr->CtrCod == Gbl.CurrentCtr.Ctr.CtrCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Ctr->CtrCod == Gbl.CurrentCtr.Ctr.CtrCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /***** Number of centre in this list *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_changelog.h b/swad_changelog.h index e5a21e6c..76266fbd 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.125.3 (2015/09/04)" +#define Log_PLATFORM_VERSION "SWAD 14.126 (2015/09/04)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 14.126: Sep 04, 2015 Changes in styles. (184213 lines) Version 14.125.3: Sep 04, 2015 Changes in styles. (184263 lines) Version 14.125.2: Sep 04, 2015 Changes in styles. (184344 lines) Version 14.125.1: Sep 03, 2015 Changes in styles. (184399 lines) diff --git a/swad_chat.c b/swad_chat.c index b9665470..af436b9c 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -256,17 +256,15 @@ void Cht_ShowListOfChatRoomsWithUsrs (void) /***** Table start *****/ Lay_StartRoundFrameTable (NULL,2,Txt_Rooms_with_users); fprintf (Gbl.F.Out,"" - "" + "" "%s" "" - "" + "" "%s" "" "", - VERY_LIGHT_BLUE,Txt_CHAT_Room_code, - VERY_LIGHT_BLUE,Txt_No_of_users); + Txt_CHAT_Room_code, + Txt_No_of_users); /***** Loop over chat rooms *****/ for (NumRow = 0; diff --git a/swad_country.c b/swad_country.c index 4c49314f..fd56c984 100644 --- a/swad_country.c +++ b/swad_country.c @@ -94,7 +94,7 @@ void Cty_SeeCtyWithPendingInss (void) unsigned NumCtys; unsigned NumCty; struct Country Cty; - char BgColor[32]; + const char *BgColor; /***** Get countries with pending institutions *****/ switch (Gbl.Usrs.Me.LoggedRole) @@ -139,10 +139,8 @@ void Cty_SeeCtyWithPendingInss (void) /* Get country code (row[0]) */ Cty.CtyCod = Str_ConvertStrCodToLongCod (row[0]); - if (Cty.CtyCod == Gbl.CurrentCty.Cty.CtyCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Cty.CtyCod == Gbl.CurrentCty.Cty.CtyCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /* Get data of country */ Cty_GetDataOfCountryByCod (&Cty); @@ -485,7 +483,7 @@ void Cty_ListCountries2 (void) unsigned NumInssWithCountry = 0; unsigned NumUsrsInOtherCtys; unsigned NumInssInOtherCtys; - char BgColor[32]; + const char *BgColor; /***** Put link (form) to edit countries *****/ if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) @@ -531,10 +529,8 @@ void Cty_ListCountries2 (void) NumCty < Gbl.Ctys.Num; NumCty++) { - if (Gbl.Ctys.Lst[NumCty].CtyCod == Gbl.CurrentCty.Cty.CtyCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Gbl.Ctys.Lst[NumCty].CtyCod == Gbl.CurrentCty.Cty.CtyCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /***** Country map (and link to WWW if exists) *****/ fprintf (Gbl.F.Out,"" @@ -720,7 +716,6 @@ void Cty_WriteScriptGoogleGeochart (void) extern const char *Txt_Country_NO_HTML; extern const char *Txt_Users_NO_HTML; extern const char *Txt_Institutions_NO_HTML; - extern const char *The_TabOnBgColors[The_NUM_THEMES]; unsigned NumCty; unsigned NumUsrsWithCountry = 0; unsigned NumCtysWithUsrs = 0; @@ -760,15 +755,13 @@ void Cty_WriteScriptGoogleGeochart (void) " var options = {\n" " width:500,\n" " height:300,\n" - " backgroundColor:'%s',\n" + " backgroundColor:'white',\n" " datalessRegionColor:'white',\n" - " colorAxis:{colors:['%s','black'],minValue:0,maxValue:%u}};\n" + " colorAxis:{colors:['black','black'],minValue:0,maxValue:%u}};\n" " var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));\n" " chart.draw(data, options);\n" " };\n" "\n", - The_TabOnBgColors[Gbl.Prefs.Theme], - The_TabOnBgColors[Gbl.Prefs.Theme], NumCtysWithUsrs ? (unsigned) pow (10.0,ceil (log10 (2.0 * (double) NumUsrsWithCountry / (double) NumCtysWithUsrs))) : 0); // colorAxis.maxValue = 2*Average_number_of_users diff --git a/swad_course.c b/swad_course.c index 0f9be243..7591b757 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1265,7 +1265,7 @@ static void Crs_ListCoursesForSeeing (void) unsigned Year; unsigned NumCrs; const char *TxtClass; - char BgColor[32]; + const char *BgColor; Crs_StatusTxt_t StatusTxt; /***** Write heading *****/ @@ -1288,10 +1288,8 @@ static void Crs_ListCoursesForSeeing (void) { TxtClass = (Crs->Status & Crs_STATUS_BIT_PENDING) ? "DAT_LIGHT" : "DAT"; - if (Crs->CrsCod == Gbl.CurrentCrs.Crs.CrsCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Crs->CrsCod == Gbl.CurrentCrs.Crs.CrsCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /* Put green tip if course has users */ fprintf (Gbl.F.Out,"" @@ -3259,7 +3257,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA unsigned NumTchs; const char *Style; const char *StyleNoBR; - char BgColor[32]; + const char *BgColor; bool Accepted; /* @@ -3296,10 +3294,8 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA Style = "DAT"; StyleNoBR = "DAT_NOBR"; } - if (CrsCod == Gbl.CurrentCrs.Crs.CrsCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (CrsCod == Gbl.CurrentCrs.Crs.CrsCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /***** Start row *****/ fprintf (Gbl.F.Out,""); diff --git a/swad_degree.c b/swad_degree.c index 469af1db..62ddb174 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -157,7 +157,7 @@ void Deg_SeeDegWithPendingCrss (void) unsigned NumDegs; unsigned NumDeg; struct Degree Deg; - char BgColor[32]; + const char *BgColor; /***** Get degrees with pending courses *****/ switch (Gbl.Usrs.Me.LoggedRole) @@ -211,10 +211,8 @@ void Deg_SeeDegWithPendingCrss (void) /* Get degree code (row[0]) */ Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]); - if (Deg.DegCod == Gbl.CurrentDeg.Deg.DegCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Deg.DegCod == Gbl.CurrentDeg.Deg.DegCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /* Get data of degree */ Deg_GetDataOfDegreeByCod (&Deg); @@ -1065,7 +1063,7 @@ static void Deg_ListDegreeTypesForSeeing (void) extern const char *Txt_Direct_authentication_allowed; extern const char *Txt_Direct_authentication_not_allowed; unsigned NumDegTyp; - char BgColor[32]; + const char *BgColor; Lay_StartRoundFrameTable (NULL,2,Txt_Types_of_degree); @@ -1077,10 +1075,9 @@ static void Deg_ListDegreeTypesForSeeing (void) NumDegTyp < Gbl.Degs.DegTypes.Num; NumDegTyp++) { - if (Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod == Gbl.CurrentDegTyp.DegTyp.DegTypCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod == + Gbl.CurrentDegTyp.DegTyp.DegTypCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /* Put green tip if degree type has degrees */ fprintf (Gbl.F.Out,"" @@ -1242,7 +1239,7 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg) extern const char *Txt_DEGREE_STATUS[Deg_NUM_STATUS_TXT]; struct DegreeType DegTyp; const char *TxtClass; - char BgColor[32]; + const char *BgColor; Crs_StatusTxt_t StatusTxt; /***** Get data of type of degree of this degree *****/ @@ -1252,10 +1249,8 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg) TxtClass = (Deg->Status & Deg_STATUS_BIT_PENDING) ? "DAT_LIGHT" : "DAT"; - if (Deg->DegCod == Gbl.CurrentDeg.Deg.DegCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Deg->DegCod == Gbl.CurrentDeg.Deg.DegCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /***** Put green tip if degree has courses *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_file_browser.c b/swad_file_browser.c index 7550debe..fa91a616 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -5552,11 +5552,11 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic,Brw_FileType_t FileT if (FileType == Brw_IS_FOLDER) { /***** Start of cell *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out," LIGHT_GREEN"); + fprintf (Gbl.F.Out,"\" style=\"width:99%%;\">"); /***** Form to rename folder *****/ if (Gbl.FileBrowser.ICanEditFileOrFolder) // Can I rename this folder? @@ -5613,11 +5613,11 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic,Brw_FileType_t FileT } else // File or link { - fprintf (Gbl.F.Out," "); + fprintf (Gbl.F.Out," LIGHT_GREEN"); + fprintf (Gbl.F.Out,"\" style=\"width:99%%;\"> "); Act_FormStart (Brw_ActDowFile[Gbl.FileBrowser.Type]); switch (Gbl.FileBrowser.Type) @@ -10934,7 +10934,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) const char *CtrShortName; const char *DegShortName; const char *CrsShortName; - char BgColor[32]; + const char *BgColor; const char *Title; char PathUntilFileName[PATH_MAX+1]; char FileName[NAME_MAX+1]; @@ -10978,10 +10978,9 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) GrpCod = Str_ConvertStrCodToLongCod (row[10]); /***** Set row color *****/ - if (CrsCod > 0 && CrsCod == Gbl.CurrentCrs.Crs.CrsCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (CrsCod > 0 && + CrsCod == Gbl.CurrentCrs.Crs.CrsCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /***** Write number of document in this search *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_group.c b/swad_group.c index 11c752e4..16b0bdb5 100644 --- a/swad_group.c +++ b/swad_group.c @@ -1478,10 +1478,10 @@ void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrS /* Put checkbox to select the group */ fprintf (Gbl.F.Out,"" - "" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "GrpCod); if (Cod > 0) // Cod == -1L means new assignment or survey @@ -1664,10 +1664,10 @@ static unsigned Grp_ListGrpsForChange (struct GroupType *GrpTyp) /* Put icon to select the group */ fprintf (Gbl.F.Out,"" - "" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "" - "" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "GrpTypCod,Grp->GrpCod); if (UsrBelongsToThisGroup) @@ -1828,10 +1828,10 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp) /* Put checkbox to select the group */ fprintf (Gbl.F.Out,"" - "" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "GrpCod); if (Gbl.Usrs.ClassPhoto.AllGroups) @@ -1959,10 +1959,10 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight) sprintf (Gbl.Title,Grp->Open ? Txt_Group_X_open : Txt_Group_X_closed, Grp->GrpName); - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\" style=\"width:12px;\">" "\"%s\"" @@ -1973,10 +1973,10 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight) Gbl.Title,Gbl.Title); /***** Group name *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "%s " "", Grp->GrpName); @@ -1984,26 +1984,26 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight) /***** Max. number of students in this group *****/ fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">"); Grp_WriteMaxStdsGrp (Grp->MaxStudents); fprintf (Gbl.F.Out," " ""); /***** Current number of students in this group *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "%d" "", Grp->NumStudents); /***** Vacants in this group *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">"); if (Grp->MaxStudents > Grp_MAX_STUDENTS_IN_A_GROUP) fprintf (Gbl.F.Out,"-"); else diff --git a/swad_indicator.c b/swad_indicator.c index 94b5fbdb..d0435eee 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -542,9 +542,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat /***** Table start *****/ fprintf (Gbl.F.Out,""); + " style=\"margin:0 auto; border-spacing:1px;\">"); /***** Write table heading *****/ switch (IndicatorsLayout) diff --git a/swad_info.c b/swad_info.c index 6d1fc28e..d850fe0a 100644 --- a/swad_info.c +++ b/swad_info.c @@ -937,10 +937,10 @@ void Inf_FormsToSelSendInfo (void) { /* Select info source */ fprintf (Gbl.F.Out,"" - "" diff --git a/swad_layout.c b/swad_layout.c index 5968744c..7b161088 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -274,8 +274,7 @@ void Lay_WriteStartOfPage (void) } fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">"); Act_FormStart (Inf_ActionsSelecInfoSrc[InfoType]); fprintf (Gbl.F.Out,""); /* Form for this info source */ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out," LIGHT_BLUE"); + fprintf (Gbl.F.Out,"\">" "%s
", Txt_INFO_SRC_FULL_TEXT[InfoSrc]); if (Txt_INFO_SRC_HELP[InfoSrc]) diff --git a/swad_institution.c b/swad_institution.c index 43ccab20..3bf7e255 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -98,7 +98,7 @@ void Ins_SeeInsWithPendingCtrs (void) unsigned NumInss; unsigned NumIns; struct Institution Ins; - char BgColor[32]; + const char *BgColor; /***** Get institutions with pending centres *****/ switch (Gbl.Usrs.Me.LoggedRole) @@ -151,10 +151,8 @@ void Ins_SeeInsWithPendingCtrs (void) /* Get institution code (row[0]) */ Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]); - if (Ins.InsCod == Gbl.CurrentIns.Ins.InsCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Ins.InsCod == Gbl.CurrentIns.Ins.InsCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /* Get data of institution */ Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA); @@ -510,15 +508,13 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu extern const char *Txt_Go_to_X; extern const char *Txt_INSTITUTION_STATUS[Ins_NUM_STATUS_TXT]; const char *TxtClass; - char BgColor[32]; + const char *BgColor; Crs_StatusTxt_t StatusTxt; TxtClass = (Ins->Status & Ins_STATUS_BIT_PENDING) ? "DAT_LIGHT" : "DAT"; - if (Ins->InsCod == Gbl.CurrentIns.Ins.InsCod) - strcpy (BgColor,"VERY_LIGHT_BLUE"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = (Ins->InsCod == Gbl.CurrentIns.Ins.InsCod) ? "LIGHT_BLUE" : + Gbl.ColorRows[Gbl.RowEvenOdd]; /***** Number of institution in this list *****/ fprintf (Gbl.F.Out,"
" - "
" + "
" "" "", ColspanCentralPart, diff --git a/swad_layout.h b/swad_layout.h index b12983d8..5e3f63bd 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -33,17 +33,6 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -// Colors used in headers, backgrounds, etc. -#define YELLOW_BACKGROUND_MSG "#FFFDB9" -#define DARK_GRAY "#404040" -#define DARK_BLUE "#8CBCCE" -#define MEDIUM_BLUE "#AFD1DD" -#define LIGHT_BLUE "#C0DAE4" -#define VERY_LIGHT_BLUE "#DDECF1" -#define LIGHTEST_BLUE "#EAF3F6" -#define LIGHT_GREEN "#C0FF40" -#define LIGHTEST_GREEN "#F5FFD7" - #define Lay_MAX_BYTES_ALERT (16*1024) // Max. size for alert message // Important: the size of alert message must be enough large to store the longest message. diff --git a/swad_message.c b/swad_message.c index 5ed4a82c..5122e13e 100644 --- a/swad_message.c +++ b/swad_message.c @@ -384,9 +384,7 @@ void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (bool IsReply) /***** Textarea with users' @nicknames, e-mails or IDs *****/ fprintf (Gbl.F.Out,"" - ""); /***** Checkbox to select user *****/ - UsrIsTheMsgSender = PutCheckBoxToSelectUsr && - (UsrDat->UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); - if (UsrIsTheMsgSender) - strcpy (BgColor,"LIGHT_GREEN"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); // Two colors are used alternatively to better distinguish the rows + BgColor = UsrIsTheMsgSender ? "LIGHT_GREEN" : + Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows if (PutCheckBoxToSelectUsr) { fprintf (Gbl.F.Out,"" - "", - VERY_LIGHT_BLUE); + ""); /* Columns for the data */ for (NumCol = 0; NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR; NumCol++) if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,Usr_UsrDatMainFieldNames[NumCol]); + Usr_UsrDatMainFieldNames[NumCol]); /* End row */ fprintf (Gbl.F.Out,""); @@ -5098,22 +5089,19 @@ static void Usr_ListMainDataStds (bool PutCheckBoxToSelectUsr) /* First column used for selection */ if (PutCheckBoxToSelectUsr) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE); + ""); /* Columns for the data */ for (NumCol = 0; NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR; NumCol++) if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,Usr_UsrDatMainFieldNames[NumCol]); + Usr_UsrDatMainFieldNames[NumCol]); /* End row */ fprintf (Gbl.F.Out,""); @@ -5172,22 +5160,19 @@ static void Usr_ListMainDataTchs (bool PutCheckBoxToSelectUsr) /* First column used for selection */ if (PutCheckBoxToSelectUsr) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE); + ""); /* Columns for the data */ for (NumCol = 0; NumCol < NumColumns; NumCol++) if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,Usr_UsrDatMainFieldNames[NumCol]); + Usr_UsrDatMainFieldNames[NumCol]); /* End row */ fprintf (Gbl.F.Out,""); @@ -5290,11 +5275,10 @@ void Usr_ListAllDataGsts (void) 1); NumCol < NumColumnsCommonCard; NumCol++) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,FieldNames[NumCol]); + FieldNames[NumCol]); /* End row */ fprintf (Gbl.F.Out,""); @@ -5437,11 +5421,10 @@ void Usr_ListAllDataStds (void) 1); NumCol < NumColumnsCommonCard; NumCol++) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,FieldNames[NumCol]); + FieldNames[NumCol]); /* 2. Columns for the groups */ if (Gbl.Scope.Current == Sco_SCOPE_CRS) @@ -5451,11 +5434,10 @@ void Usr_ListAllDataStds (void) NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num; NumGrpTyp++) if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) // If current course tiene groups of este type - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,Txt_Group, + Txt_Group, Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName); if (Gbl.CurrentCrs.Records.LstFields.Num) @@ -5464,28 +5446,25 @@ void Usr_ListAllDataStds (void) for (NumField = 0; NumField < Gbl.CurrentCrs.Records.LstFields.Num; NumField++) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name); + Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name); + /* 4. Visibility type for the record fields that depend on the course, in other row */ fprintf (Gbl.F.Out,""); for (NumCol = 0; NumCol < NumColumnsCardAndGroups; NumCol++) if (NumCol != 1 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want it in listing - fprintf (Gbl.F.Out,"", - LIGHTEST_BLUE); + fprintf (Gbl.F.Out,""); for (NumField = 0; NumField < Gbl.CurrentCrs.Records.LstFields.Num; NumField++) - fprintf (Gbl.F.Out,"", - LIGHTEST_BLUE, Txt_RECORD_FIELD_VISIBILITY_RECORD[Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Visibility]); } } @@ -5548,21 +5527,20 @@ void Usr_ListUsrsForSelection (Rol_Role_t Role) /***** Heading row with column names *****/ /* Start row and first column used for selection */ fprintf (Gbl.F.Out,"" - "", - VERY_LIGHT_BLUE); + ""); + /* Columns for the data */ for (NumCol = 0; NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR; NumCol++) if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,Usr_UsrDatMainFieldNames[NumCol]); + Usr_UsrDatMainFieldNames[NumCol]); + /* End row */ fprintf (Gbl.F.Out,""); @@ -5672,11 +5650,10 @@ void Usr_ListAllDataTchs (void) 1); NumCol < NumColumns; NumCol++) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,FieldNames[NumCol]); + FieldNames[NumCol]); /* End row */ fprintf (Gbl.F.Out,""); @@ -5763,12 +5740,11 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role,const char *UsrQuery) for (NumCol = 0; NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR; NumCol++) - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE, Usr_UsrDatMainFieldNames[NumCol]); + /* End row */ fprintf (Gbl.F.Out,""); @@ -5904,11 +5880,10 @@ void Usr_ListDataAdms (void) NumCol < NumColumns; NumCol++) if (NumCol != 1 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column - fprintf (Gbl.F.Out,"", - VERY_LIGHT_BLUE,FieldNames[NumCol]); + FieldNames[NumCol]); /* End row */ fprintf (Gbl.F.Out,""); @@ -6939,16 +6914,16 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); /***** Begin user's cell *****/ - fprintf (Gbl.F.Out,"
%s:", diff --git a/swad_tab.c b/swad_tab.c index 7087f198..cb06b0fa 100644 --- a/swad_tab.c +++ b/swad_tab.c @@ -146,7 +146,7 @@ static void Tab_DrawTabsDeskTop (void) if (ICanViewTab || NumTab > TabCrs) // Don't show the first hidden tabs { /* Form, icon (at top) and text (at bottom) of the tab */ - fprintf (Gbl.F.Out,"
  • ", + fprintf (Gbl.F.Out,"
  • ", NumTab == Gbl.CurrentTab ? "TAB_ON" : "TAB_OFF", NumTab == Gbl.CurrentTab ? The_TabOnBgColors[Gbl.Prefs.Theme] : @@ -315,7 +315,7 @@ void Tab_DrawBreadcrumb (void) extern const char *The_TabOnBgColors[The_NUM_THEMES]; extern const char *The_ClassTabOn[The_NUM_THEMES]; - fprintf (Gbl.F.Out,"
    ", + fprintf (Gbl.F.Out,"
    ", The_TabOnBgColors[Gbl.Prefs.Theme]); /***** Home *****/ diff --git a/swad_theme.c b/swad_theme.c index d6fa87bd..63de1810 100644 --- a/swad_theme.c +++ b/swad_theme.c @@ -67,17 +67,17 @@ const char *The_ThemeNames[The_NUM_THEMES] = const char *The_TabOnBgColors[The_NUM_THEMES] = { - "#F7F6F5", - "#F7F6F5", - "#E8F3F6", - "#FFF2BD", + "TAB_ON_WHITE", + "TAB_ON_GREY", + "TAB_ON_BLUE", + "TAB_ON_YELLOW", }; const char *The_TabOffBgColors[The_NUM_THEMES] = { - "#D4D4D4", - "#D4D4D4", - "#CAE1E8", - "#FADE94", + "TAB_OFF_WHITE", + "TAB_OFF_GREY", + "TAB_OFF_BLUE", + "TAB_OFF_YELLOW", }; const char *The_ClassSeparator[The_NUM_THEMES] = diff --git a/swad_user.c b/swad_user.c index ce0246e7..de1d2aaf 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2677,7 +2677,7 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe { extern const char *Txt_Enrollment_confirmed; extern const char *Txt_Enrollment_not_confirmed; - char BgColor[32]; + const char *BgColor; char PhotoURL[PATH_MAX+1]; bool ShowPhoto; bool UsrIsTheMsgSender = false; @@ -2694,10 +2694,8 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe if (PutCheckBoxToSelectUsr) UsrIsTheMsgSender = (UsrDat->UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); // Two colors are used alternatively to better distinguish the rows - if (UsrIsTheMsgSender) - strcpy (BgColor,"LIGHT_GREEN"); - else - sprintf (BgColor,"COLOR%u",Gbl.RowEvenOdd); + BgColor = UsrIsTheMsgSender ? "LIGHT_GREEN" : + Gbl.ColorRows[Gbl.RowEvenOdd]; if (PutCheckBoxToSelectUsr) { fprintf (Gbl.F.Out,"
  • ",BgColor); @@ -2993,11 +2991,12 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool { extern const char *Txt_Enrollment_confirmed; extern const char *Txt_Enrollment_not_confirmed; - char BgColor[32]; + const char *BgColor; char PhotoURL[PATH_MAX+1]; bool ShowPhoto; - bool UsrIsTheMsgSender; - char MailLink[7+Usr_MAX_BYTES_USR_EMAIL+1]; // mailto:mail_address + bool UsrIsTheMsgSender = PutCheckBoxToSelectUsr && + (UsrDat->UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); + char MailLink[7+Usr_MAX_BYTES_USR_EMAIL+1]; // mailto:mail_address struct Institution Ins; bool ShowEmail = UsrDat->Accepted || Gbl.Usrs.Me.LoggedRole == Rol_DEG_ADM || @@ -3007,12 +3006,8 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool fprintf (Gbl.F.Out,"
    ",BgColor); @@ -4870,9 +4865,8 @@ void Usr_PutCheckboxToSelectAllTheUsers (Rol_Role_t Role) Usr_Sex_t Sex; fprintf (Gbl.F.Out,"
    ", - Usr_GetColumnsForSelectUsrs (),VERY_LIGHT_BLUE); + "", + Usr_GetColumnsForSelectUsrs ()); if (Role == Rol_STUDENT) { fprintf (Gbl.F.Out,""); @@ -5012,22 +5006,19 @@ static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr) /* First column used for selection */ if (PutCheckBoxToSelectUsr) - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" " " - "" + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" " " - "" + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" " " - "" + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" "%s " "" + fprintf (Gbl.F.Out,"" "%s %s " "" + fprintf (Gbl.F.Out,"" "%s " "
    " - "" + "" + fprintf (Gbl.F.Out,"" "(%s) " "
    " + "" " " - "" + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" "%s " "
    " + fprintf (Gbl.F.Out,"" "%s " "
    "); + fprintf (Gbl.F.Out,"\">"); /***** Checkbox to select this user *****/ if (PutCheckBoxToSelectUsr)