diff --git a/css/swad21.72.1.css b/css/swad21.73.css similarity index 99% rename from css/swad21.72.1.css rename to css/swad21.73.css index 599a7f35..70f9ea29 100644 --- a/css/swad21.72.1.css +++ b/css/swad21.73.css @@ -1327,7 +1327,7 @@ a:hover /* Default ==> underlined */ { width:40px; height:40px; - margin:1px 4px 1px 0; + margin:2px 4px 2px 0; vertical-align:middle; } @@ -2371,7 +2371,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} .FORM_IN_BLUE {color:#4d88a1; font-size:13pt;} .FORM_IN_YELLOW {color:#7c4d2a; font-size:13pt;} .FORM_IN_PINK {color:#4d88a1; font-size:13pt;} -.FORM_IN_DARK {color:#c0e0ff; font-size:13pt;} +.FORM_IN_DARK {color:#a6c4d0; font-size:13pt;} /* Outside white box */ .FORM_OUT_WHITE {color:#4d88a1; font-size:13pt;} @@ -2380,7 +2380,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} .FORM_OUT_BLUE {color:#4d88a1; font-size:13pt;} .FORM_OUT_YELLOW {color:#7c4d2a; font-size:13pt;} .FORM_OUT_PINK {color:#63474e; font-size:13pt;} -.FORM_OUT_DARK {color:#c0e0ff; font-size:13pt;} +.FORM_OUT_DARK {color:#a6c4d0; font-size:13pt;} /****************************** Placing of objects ***************************/ .LT {text-align:left; vertical-align:top; } /* Left Top */ @@ -2720,13 +2720,11 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} /******************************** Class photo ********************************/ .CLASSPHOTO_TITLE { - color:#404040; font-family:Georgia,"DejaVu LGC Serif","Bitstream Vera Serif",serif; font-size:13pt; } .CLASSPHOTO { - color:#404040; font-size:10pt; line-height:110%; white-space:nowrap; @@ -2741,6 +2739,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} text-overflow:ellipsis; margin:0 auto; } +.CLASSPHOTO_WHITE {color:#404040;} +.CLASSPHOTO_GREY {color:#404040;} +.CLASSPHOTO_PURPLE {color:#404040;} +.CLASSPHOTO_BLUE {color:#404040;} +.CLASSPHOTO_YELLOW {color:#404040;} +.CLASSPHOTO_PINK {color:#404040;} +.CLASSPHOTO_DARK {color:#d0d0d0;} /************************** Left column menu *********************************/ .LINK_TITLE, .MFU_TITLE {color:#4D88A1;} diff --git a/icon/edmodo64x64.png b/icon/edmodo64x64.png index 0dd5d305..13798940 100644 Binary files a/icon/edmodo64x64.png and b/icon/edmodo64x64.png differ diff --git a/icon/first-day-of-week-0.png b/icon/first-day-of-week-0.png index 383a5824..25fc8502 100644 Binary files a/icon/first-day-of-week-0.png and b/icon/first-day-of-week-0.png differ diff --git a/icon/first-day-of-week-6.png b/icon/first-day-of-week-6.png index a3cee65e..b47cf2a2 100644 Binary files a/icon/first-day-of-week-6.png and b/icon/first-day-of-week-6.png differ diff --git a/icon/gnusocial64x64.png b/icon/gnusocial64x64.png index e5be22c7..64be2e01 100644 Binary files a/icon/gnusocial64x64.png and b/icon/gnusocial64x64.png differ diff --git a/icon/identica64x64.png b/icon/identica64x64.png index 70aef0fe..42284b71 100644 Binary files a/icon/identica64x64.png and b/icon/identica64x64.png differ diff --git a/icon/orcid64x64.png b/icon/orcid64x64.png index 91986363..cd64876f 100644 Binary files a/icon/orcid64x64.png and b/icon/orcid64x64.png differ diff --git a/icon/paperli64x64.png b/icon/paperli64x64.png index 6148f201..8dcb85ed 100644 Binary files a/icon/paperli64x64.png and b/icon/paperli64x64.png differ diff --git a/icon/researcherid64x64.png b/icon/researcherid64x64.png index 2d82db70..d0783842 100644 Binary files a/icon/researcherid64x64.png and b/icon/researcherid64x64.png differ diff --git a/icon/scoopit64x64.png b/icon/scoopit64x64.png index 45a5f35d..e9ff8ae6 100644 Binary files a/icon/scoopit64x64.png and b/icon/scoopit64x64.png differ diff --git a/icon/storify64x64.png b/icon/storify64x64.png index 3460f3b7..28414308 100644 Binary files a/icon/storify64x64.png and b/icon/storify64x64.png differ diff --git a/swad_MFU.c b/swad_MFU.c index 6aca9acc..450cd2d6 100644 --- a/swad_MFU.c +++ b/swad_MFU.c @@ -180,6 +180,7 @@ void MFU_ShowMyMFUActions (void) void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) { extern const char *Hlp_ANALYTICS_Frequent; + extern const char *Ico_ClassColor[Ico_NUM_COLORS][The_NUM_THEMES]; extern const char *The_ClassFormLinkInBoxNoWrap[The_NUM_THEMES]; extern const char *Txt_My_frequent_actions; extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; @@ -220,7 +221,8 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) Frm_BeginForm (Action); HTM_BUTTON_SUBMIT_Begin (TabMenuStr,The_ClassFormLinkInBoxNoWrap[Gbl.Prefs.Theme],NULL); HTM_IMG (Gbl.Prefs.URLIconSet,Act_GetIcon (Action),MenuStr, - NULL); + "class=\"%s\"", + Ico_ClassColor[Ico_BLACK][Gbl.Prefs.Theme]); HTM_TxtF (" %s",TabMenuStr); HTM_BUTTON_End (); Frm_EndForm (); diff --git a/swad_calendar.c b/swad_calendar.c index 90caf271..077c24a7 100644 --- a/swad_calendar.c +++ b/swad_calendar.c @@ -133,7 +133,7 @@ void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action, if (FuncParams) // Extra parameters depending on the action FuncParams (Args); snprintf (Icon,sizeof (Icon),"first-day-of-week-%u.png",FirstDayOfWeek); - Ico_PutSettingIconLink (Icon,Ico_UNCHANGED, + Ico_PutSettingIconLink (Icon,Ico_BLACK, Str_BuildString (Txt_First_day_of_the_week_X, Txt_DAYS_SMALL[FirstDayOfWeek])); Str_FreeStrings (); diff --git a/swad_changelog.h b/swad_changelog.h index f9c40c0e..276cc686 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -602,10 +602,23 @@ TODO: FIX BUG, URGENT! En las fechas como par TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. */ -#define Log_PLATFORM_VERSION "SWAD 21.72.1 (2021-12-22)" -#define CSS_FILE "swad21.72.1.css" +#define Log_PLATFORM_VERSION "SWAD 21.73 (2021-12-23)" +#define CSS_FILE "swad21.73.css" #define JS_FILE "swad21.67.4.js" /* + Version 21.73: Dec 23, 2021 Working on design of dark theme. (322591 lines) +Copy the following icons to icon public directory: +sudo cp icon/first-day-of-week-0.png /var/www/html/swad/icon/ +sudo cp icon/first-day-of-week-6.png /var/www/html/swad/icon/ +sudo cp icon/edmodo64x64.png /var/www/html/swad/icon/ +sudo cp icon/gnusocial64x64.png /var/www/html/swad/icon/ +sudo cp icon/identica64x64.png /var/www/html/swad/icon/ +sudo cp icon/orcid64x64.png /var/www/html/swad/icon/ +sudo cp icon/paperli64x64.png /var/www/html/swad/icon/ +sudo cp icon/researcherid64x64.png /var/www/html/swad/icon/ +sudo cp icon/scoopit64x64.png /var/www/html/swad/icon/ +sudo cp icon/storify64x64.png /var/www/html/swad/icon/ + Version 21.72.1: Dec 22, 2021 Working on design of dark theme. (322622 lines) Version 21.72: Dec 21, 2021 Working on design of dark theme. (322560 lines) Copy the following icons to icon public directory: diff --git a/swad_figure.c b/swad_figure.c index 005837ef..2e97a483 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -211,7 +211,6 @@ static void Fig_GetAndShowNumUsrsPerIconSet (void); static void Fig_GetAndShowNumUsrsPerMenu (void); static void Fig_GetAndShowNumUsrsPerTheme (void); static void Fig_GetAndShowNumUsrsPerSideColumns (void); -static void Fig_GetAndShowNumUsrsPerPhotoShape (void); /*****************************************************************************/ /************************** Show use of the platform *************************/ @@ -4042,85 +4041,3 @@ static void Fig_GetAndShowNumUsrsPerSideColumns (void) /***** End table and box *****/ Box_BoxTableEnd (); } - -/*****************************************************************************/ -/****** Get and show number of users who have chosen a user photo shape ******/ -/*****************************************************************************/ - -static void Fig_GetAndShowNumUsrsPerPhotoShape (void) - { - extern const char *Hlp_ANALYTICS_Figures_user_photos; - extern const char *The_ClassDat[The_NUM_THEMES]; - extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES]; - extern const char *Txt_User_photos; - extern const char *Txt_Number_of_users; - extern const char *Txt_PERCENT_of_users; - extern const char *Txt_PHOTO_SHAPES[Pho_NUM_SHAPES]; - static const char *ClassPhoto[Pho_NUM_SHAPES] = - { - [Pho_SHAPE_CIRCLE ] = "PHOTOC15x20B", - [Pho_SHAPE_ELLIPSE ] = "PHOTOE15x20B", - [Pho_SHAPE_OVAL ] = "PHOTOO15x20B", - [Pho_SHAPE_RECTANGLE] = "PHOTOR15x20B", - }; - Pho_Shape_t Shape; - char *SubQuery; - unsigned NumUsrs[Pho_NUM_SHAPES]; - unsigned NumUsrsTotal = 0; - - /***** Begin box and table *****/ - Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_PHOTO_SHAPES], - NULL,NULL, - Hlp_ANALYTICS_Figures_user_photos,Box_NOT_CLOSABLE,2); - - /***** Heading row *****/ - HTM_TR_Begin (NULL); - HTM_TH (1,1,Txt_User_photos ,"CM"); - HTM_TH (1,1,Txt_Number_of_users ,"RM"); - HTM_TH (1,1,Txt_PERCENT_of_users,"RM"); - HTM_TR_End (); - - /***** For each user photo shape... *****/ - for (Shape = (Pho_Shape_t) 0; - Shape <= (Pho_Shape_t) (Pho_NUM_SHAPES - 1); - Shape++) - { - /* Get the number of users who have chosen this layout of columns from database */ - if (asprintf (&SubQuery,"usr_data.PhotoShape=%u", - (unsigned) Shape) < 0) - Err_NotEnoughMemoryExit (); - NumUsrs[Shape] = Usr_DB_GetNumUsrsWhoChoseAnOption (SubQuery); - free (SubQuery); - - /* Update total number of users */ - NumUsrsTotal += NumUsrs[Shape]; - } - - /***** Write number of users who have chosen this user photo shape *****/ - for (Shape = (Pho_Shape_t) 0; - Shape <= (Pho_Shape_t) (Pho_NUM_SHAPES - 1); - Shape++) - { - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"CM\""); - HTM_IMG (Cfg_URL_ICON_PUBLIC,"user.svg",Txt_PHOTO_SHAPES[Shape], - "class=\"%s\"",ClassPhoto[Shape]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]); - HTM_Unsigned (NumUsrs[Shape]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]); - HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Shape] * 100.0 / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); - - HTM_TR_End (); - } - - /***** End table and box *****/ - Box_BoxTableEnd (); - } diff --git a/swad_icon.c b/swad_icon.c index 49071f0e..2c3a1e2b 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -64,6 +64,49 @@ const char *Ico_IconSetNames[Ico_NUM_ICON_SETS] = [Ico_ICON_SET_NUVOLA ] = "Nuvola", }; +const char *Ico_ClassColor[Ico_NUM_COLORS][The_NUM_THEMES] = + { + [Ico_UNCHANGED][The_THEME_WHITE ] = "", + [Ico_UNCHANGED][The_THEME_GREY ] = "", + [Ico_UNCHANGED][The_THEME_PURPLE] = "", + [Ico_UNCHANGED][The_THEME_BLUE ] = "", + [Ico_UNCHANGED][The_THEME_YELLOW] = "", + [Ico_UNCHANGED][The_THEME_PINK ] = "", + [Ico_UNCHANGED][The_THEME_DARK ] = "", + + [Ico_BLACK ][The_THEME_WHITE ] = "BLACK_ICO_WHITE", + [Ico_BLACK ][The_THEME_GREY ] = "BLACK_ICO_GREY", + [Ico_BLACK ][The_THEME_PURPLE] = "BLACK_ICO_PURPLE", + [Ico_BLACK ][The_THEME_BLUE ] = "BLACK_ICO_BLUE", + [Ico_BLACK ][The_THEME_YELLOW] = "BLACK_ICO_YELLOW", + [Ico_BLACK ][The_THEME_PINK ] = "BLACK_ICO_PINK", + [Ico_BLACK ][The_THEME_DARK ] = "BLACK_ICO_DARK", + + [Ico_GREEN ][The_THEME_WHITE ] = "GREEN_ICO_WHITE", + [Ico_GREEN ][The_THEME_GREY ] = "GREEN_ICO_GREY", + [Ico_GREEN ][The_THEME_PURPLE] = "GREEN_ICO_PURPLE", + [Ico_GREEN ][The_THEME_BLUE ] = "GREEN_ICO_BLUE", + [Ico_GREEN ][The_THEME_YELLOW] = "GREEN_ICO_YELLOW", + [Ico_GREEN ][The_THEME_PINK ] = "GREEN_ICO_PINK", + [Ico_GREEN ][The_THEME_DARK ] = "GREEN_ICO_DARK", + + [Ico_RED ][The_THEME_WHITE ] = "RED_ICO_WHITE", + [Ico_RED ][The_THEME_GREY ] = "RED_ICO_GREY", + [Ico_RED ][The_THEME_PURPLE] = "RED_ICO_PURPLE", + [Ico_RED ][The_THEME_BLUE ] = "RED_ICO_BLUE", + [Ico_RED ][The_THEME_YELLOW] = "RED_ICO_YELLOW", + [Ico_RED ][The_THEME_PINK ] = "RED_ICO_PINK", + [Ico_RED ][The_THEME_DARK ] = "RED_ICO_DARK", + + [Ico_WHITE ][The_THEME_WHITE ] = "WHITE_ICO_WHITE", + [Ico_WHITE ][The_THEME_GREY ] = "WHITE_ICO_GREY", + [Ico_WHITE ][The_THEME_PURPLE] = "WHITE_ICO_PURPLE", + [Ico_WHITE ][The_THEME_BLUE ] = "WHITE_ICO_BLUE", + [Ico_WHITE ][The_THEME_YELLOW] = "WHITE_ICO_YELLOW", + [Ico_WHITE ][The_THEME_PINK ] = "WHITE_ICO_PINK", + [Ico_WHITE ][The_THEME_DARK ] = "WHITE_ICO_DARK", + }; + /*****************************************************************************/ /***************************** Private prototypes ****************************/ /*****************************************************************************/ @@ -343,7 +386,8 @@ void Ico_PutContextualIconToCreateInFolder (Act_Action_t NextAction, Lay_PutContextualLinkOnlyIcon (NextAction,NULL, FuncParams,Args, Open ? "folder-open-yellow-plus.png" : - "folder-yellow-plus.png",Ico_UNCHANGED, + "folder-yellow-plus.png", + Ico_UNCHANGED, Txt_Upload_file_or_create_folder); } @@ -386,19 +430,11 @@ void Ico_PutContextualIconToZIP (Act_Action_t NextAction, void Ico_PutDivIcon (const char *DivClass,const char *Icon,Ico_Color_t Color,const char *Title) { - static const char *ClassIco[The_NUM_THEMES] = - { - [The_THEME_WHITE ] = "CONTEXT_ICO_16x16 BLACK_ICO_WHITE", - [The_THEME_GREY ] = "CONTEXT_ICO_16x16 BLACK_ICO_GREY", - [The_THEME_PURPLE] = "CONTEXT_ICO_16x16 BLACK_ICO_PURPLE", - [The_THEME_BLUE ] = "CONTEXT_ICO_16x16 BLACK_ICO_BLUE", - [The_THEME_YELLOW] = "CONTEXT_ICO_16x16 BLACK_ICO_YELLOW", - [The_THEME_PINK ] = "CONTEXT_ICO_16x16 BLACK_ICO_PINK", - [The_THEME_DARK ] = "CONTEXT_ICO_16x16 BLACK_ICO_DARK", - }; - HTM_DIV_Begin ("class=\"%s\"",DivClass); - Ico_PutIcon (Icon,Color,Title,ClassIco[Gbl.Prefs.Theme]); + Ico_PutIcon (Icon,Color,Title, + Str_BuildString ("CONTEXT_ICO_16x16 %s", + Ico_ClassColor[Color][Gbl.Prefs.Theme])); + Str_FreeStrings (); HTM_DIV_End (); } @@ -408,50 +444,10 @@ void Ico_PutDivIcon (const char *DivClass,const char *Icon,Ico_Color_t Color,con void Ico_PutIconLink (const char *Icon,Ico_Color_t Color,const char *Title) { - static const char *ClassIco[Ico_NUM_COLORS][The_NUM_THEMES] = - { - [Ico_UNCHANGED][The_THEME_WHITE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - [Ico_UNCHANGED][The_THEME_GREY ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - [Ico_UNCHANGED][The_THEME_PURPLE] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - [Ico_UNCHANGED][The_THEME_BLUE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - [Ico_UNCHANGED][The_THEME_YELLOW] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - [Ico_UNCHANGED][The_THEME_PINK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - [Ico_UNCHANGED][The_THEME_DARK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16", - - [Ico_BLACK ][The_THEME_WHITE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_WHITE", - [Ico_BLACK ][The_THEME_GREY ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_GREY", - [Ico_BLACK ][The_THEME_PURPLE] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_PURPLE", - [Ico_BLACK ][The_THEME_BLUE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_BLUE", - [Ico_BLACK ][The_THEME_YELLOW] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_YELLOW", - [Ico_BLACK ][The_THEME_PINK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_PINK", - [Ico_BLACK ][The_THEME_DARK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 BLACK_ICO_DARK", - - [Ico_GREEN ][The_THEME_WHITE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_WHITE", - [Ico_GREEN ][The_THEME_GREY ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_GREY", - [Ico_GREEN ][The_THEME_PURPLE] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_PURPLE", - [Ico_GREEN ][The_THEME_BLUE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_BLUE", - [Ico_GREEN ][The_THEME_YELLOW] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_YELLOW", - [Ico_GREEN ][The_THEME_PINK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_PINK", - [Ico_GREEN ][The_THEME_DARK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 GREEN_ICO_DARK", - - [Ico_RED ][The_THEME_WHITE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_WHITE", - [Ico_RED ][The_THEME_GREY ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_GREY", - [Ico_RED ][The_THEME_PURPLE] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_PURPLE", - [Ico_RED ][The_THEME_BLUE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_BLUE", - [Ico_RED ][The_THEME_YELLOW] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_YELLOW", - [Ico_RED ][The_THEME_PINK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_PINK", - [Ico_RED ][The_THEME_DARK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 RED_ICO_DARK", - - [Ico_WHITE ][The_THEME_WHITE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_WHITE", - [Ico_WHITE ][The_THEME_GREY ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_GREY", - [Ico_WHITE ][The_THEME_PURPLE] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_PURPLE", - [Ico_WHITE ][The_THEME_BLUE ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_BLUE", - [Ico_WHITE ][The_THEME_YELLOW] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_YELLOW", - [Ico_WHITE ][The_THEME_PINK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_PINK", - [Ico_WHITE ][The_THEME_DARK ] = "CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 WHITE_ICO_DARK", - }; - - HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,Icon,Title,ClassIco[Color][Gbl.Prefs.Theme]); + HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,Icon,Title, + Str_BuildString ("CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16 %s", + Ico_ClassColor[Color][Gbl.Prefs.Theme])); + Str_FreeStrings (); } /*****************************************************************************/ @@ -460,20 +456,12 @@ void Ico_PutIconLink (const char *Icon,Ico_Color_t Color,const char *Title) void Ico_PutIconTextLink (const char *Icon,Ico_Color_t Color,const char *Text) { - static const char *ClassIco[The_NUM_THEMES] = - { - [The_THEME_WHITE ] = "CONTEXT_ICO_x16 BLACK_ICO_WHITE", - [The_THEME_GREY ] = "CONTEXT_ICO_x16 BLACK_ICO_GREY", - [The_THEME_PURPLE] = "CONTEXT_ICO_x16 BLACK_ICO_PURPLE", - [The_THEME_BLUE ] = "CONTEXT_ICO_x16 BLACK_ICO_BLUE", - [The_THEME_YELLOW] = "CONTEXT_ICO_x16 BLACK_ICO_YELLOW", - [The_THEME_PINK ] = "CONTEXT_ICO_x16 BLACK_ICO_PINK", - [The_THEME_DARK ] = "CONTEXT_ICO_x16 BLACK_ICO_DARK", - }; - /***** Print icon and optional text *****/ HTM_DIV_Begin ("class=\"CONTEXT_OPT ICO_HIGHLIGHT\""); - Ico_PutIcon (Icon,Color,Text,ClassIco[Gbl.Prefs.Theme]); + Ico_PutIcon (Icon,Color,Text, + Str_BuildString ("CONTEXT_ICO_x16 %s", + Ico_ClassColor[Color][Gbl.Prefs.Theme])); + Str_FreeStrings (); HTM_TxtF (" %s",Text); HTM_DIV_End (); } @@ -484,50 +472,10 @@ void Ico_PutIconTextLink (const char *Icon,Ico_Color_t Color,const char *Text) void Ico_PutSettingIconLink (const char *Icon,Ico_Color_t Color,const char *Title) { - static const char *ClassIco[Ico_NUM_COLORS][The_NUM_THEMES] = - { - [Ico_UNCHANGED][The_THEME_WHITE ] = "ICO_HIGHLIGHT ICOx20", - [Ico_UNCHANGED][The_THEME_GREY ] = "ICO_HIGHLIGHT ICOx20", - [Ico_UNCHANGED][The_THEME_PURPLE] = "ICO_HIGHLIGHT ICOx20", - [Ico_UNCHANGED][The_THEME_BLUE ] = "ICO_HIGHLIGHT ICOx20", - [Ico_UNCHANGED][The_THEME_YELLOW] = "ICO_HIGHLIGHT ICOx20", - [Ico_UNCHANGED][The_THEME_PINK ] = "ICO_HIGHLIGHT ICOx20", - [Ico_UNCHANGED][The_THEME_DARK ] = "ICO_HIGHLIGHT ICOx20", - - [Ico_BLACK ][The_THEME_WHITE ] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_WHITE", - [Ico_BLACK ][The_THEME_GREY ] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_GREY", - [Ico_BLACK ][The_THEME_PURPLE] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_PURPLE", - [Ico_BLACK ][The_THEME_BLUE ] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_BLUE", - [Ico_BLACK ][The_THEME_YELLOW] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_YELLOW", - [Ico_BLACK ][The_THEME_PINK ] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_PINK", - [Ico_BLACK ][The_THEME_DARK ] = "ICO_HIGHLIGHT ICOx20 BLACK_ICO_DARK", - - [Ico_GREEN ][The_THEME_WHITE ] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_WHITE", - [Ico_GREEN ][The_THEME_GREY ] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_GREY", - [Ico_GREEN ][The_THEME_PURPLE] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_PURPLE", - [Ico_GREEN ][The_THEME_BLUE ] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_BLUE", - [Ico_GREEN ][The_THEME_YELLOW] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_YELLOW", - [Ico_GREEN ][The_THEME_PINK ] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_PINK", - [Ico_GREEN ][The_THEME_DARK ] = "ICO_HIGHLIGHT ICOx20 GREEN_ICO_DARK", - - [Ico_RED ][The_THEME_WHITE ] = "ICO_HIGHLIGHT ICOx20 RED_ICO_WHITE", - [Ico_RED ][The_THEME_GREY ] = "ICO_HIGHLIGHT ICOx20 RED_ICO_GREY", - [Ico_RED ][The_THEME_PURPLE] = "ICO_HIGHLIGHT ICOx20 RED_ICO_PURPLE", - [Ico_RED ][The_THEME_BLUE ] = "ICO_HIGHLIGHT ICOx20 RED_ICO_BLUE", - [Ico_RED ][The_THEME_YELLOW] = "ICO_HIGHLIGHT ICOx20 RED_ICO_YELLOW", - [Ico_RED ][The_THEME_PINK ] = "ICO_HIGHLIGHT ICOx20 RED_ICO_PINK", - [Ico_RED ][The_THEME_DARK ] = "ICO_HIGHLIGHT ICOx20 RED_ICO_DARK", - - [Ico_WHITE ][The_THEME_WHITE ] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_WHITE", - [Ico_WHITE ][The_THEME_GREY ] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_GREY", - [Ico_WHITE ][The_THEME_PURPLE] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_PURPLE", - [Ico_WHITE ][The_THEME_BLUE ] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_BLUE", - [Ico_WHITE ][The_THEME_YELLOW] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_YELLOW", - [Ico_WHITE ][The_THEME_PINK ] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_PINK", - [Ico_WHITE ][The_THEME_DARK ] = "ICO_HIGHLIGHT ICOx20 WHITE_ICO_DARK", - }; - - HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,Icon,Title,ClassIco[Color][Gbl.Prefs.Theme]); + HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,Icon,Title, + Str_BuildString ("ICO_HIGHLIGHT ICOx20 %s", + Ico_ClassColor[Color][Gbl.Prefs.Theme])); + Str_FreeStrings (); } /*****************************************************************************/ @@ -550,55 +498,10 @@ void Ico_PutIconOff (const char *Icon,Ico_Color_t Color,const char *Title) void Ico_PutIcon (const char *Icon,Ico_Color_t Color,const char *Title,const char *Class) { - static const char *ClassColor[Ico_NUM_COLORS][The_NUM_THEMES] = - { - [Ico_UNCHANGED][The_THEME_WHITE ] = NULL, - [Ico_UNCHANGED][The_THEME_GREY ] = NULL, - [Ico_UNCHANGED][The_THEME_PURPLE] = NULL, - [Ico_UNCHANGED][The_THEME_BLUE ] = NULL, - [Ico_UNCHANGED][The_THEME_YELLOW] = NULL, - [Ico_UNCHANGED][The_THEME_PINK ] = NULL, - [Ico_UNCHANGED][The_THEME_DARK ] = NULL, - - [Ico_BLACK ][The_THEME_WHITE ] = "BLACK_ICO_WHITE", - [Ico_BLACK ][The_THEME_GREY ] = "BLACK_ICO_GREY", - [Ico_BLACK ][The_THEME_PURPLE] = "BLACK_ICO_PURPLE", - [Ico_BLACK ][The_THEME_BLUE ] = "BLACK_ICO_BLUE", - [Ico_BLACK ][The_THEME_YELLOW] = "BLACK_ICO_YELLOW", - [Ico_BLACK ][The_THEME_PINK ] = "BLACK_ICO_PINK", - [Ico_BLACK ][The_THEME_DARK ] = "BLACK_ICO_DARK", - - [Ico_GREEN ][The_THEME_WHITE ] = "GREEN_ICO_WHITE", - [Ico_GREEN ][The_THEME_GREY ] = "GREEN_ICO_GREY", - [Ico_GREEN ][The_THEME_PURPLE] = "GREEN_ICO_PURPLE", - [Ico_GREEN ][The_THEME_BLUE ] = "GREEN_ICO_BLUE", - [Ico_GREEN ][The_THEME_YELLOW] = "GREEN_ICO_YELLOW", - [Ico_GREEN ][The_THEME_PINK ] = "GREEN_ICO_PINK", - [Ico_GREEN ][The_THEME_DARK ] = "GREEN_ICO_DARK", - - [Ico_RED ][The_THEME_WHITE ] = "RED_ICO_WHITE", - [Ico_RED ][The_THEME_GREY ] = "RED_ICO_GREY", - [Ico_RED ][The_THEME_PURPLE] = "RED_ICO_PURPLE", - [Ico_RED ][The_THEME_BLUE ] = "RED_ICO_BLUE", - [Ico_RED ][The_THEME_YELLOW] = "RED_ICO_YELLOW", - [Ico_RED ][The_THEME_PINK ] = "RED_ICO_PINK", - [Ico_RED ][The_THEME_DARK ] = "RED_ICO_DARK", - - [Ico_WHITE ][The_THEME_WHITE ] = "WHITE_ICO_WHITE", - [Ico_WHITE ][The_THEME_GREY ] = "WHITE_ICO_GREY", - [Ico_WHITE ][The_THEME_PURPLE] = "WHITE_ICO_PURPLE", - [Ico_WHITE ][The_THEME_BLUE ] = "WHITE_ICO_BLUE", - [Ico_WHITE ][The_THEME_YELLOW] = "WHITE_ICO_YELLOW", - [Ico_WHITE ][The_THEME_PINK ] = "WHITE_ICO_PINK", - [Ico_WHITE ][The_THEME_DARK ] = "WHITE_ICO_DARK", - }; - const char *CC = ClassColor[Color][Gbl.Prefs.Theme]; + const char *CC = Ico_ClassColor[Color][Gbl.Prefs.Theme]; HTM_IMG (Cfg_URL_ICON_PUBLIC,Icon,Title, - "class=\"%s%s%s\"", - Class, - CC ? " " : "", - CC ? CC : ""); + "class=\"%s%s%s\"",Class,CC[0] ? " " : "",CC); } /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index 1ebc407b..8c378831 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1454,6 +1454,7 @@ static void Lay_WriteFootFromHTMLFile (void) void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, long InsCod,long DegCod,long CrsCod) { + extern const char *The_ClassPhoto[The_NUM_THEMES]; struct Hie_Hierarchy Hie; /***** Get data of institution *****/ @@ -1486,12 +1487,14 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, HTM_TD_End (); /***** Second column: class photo title *****/ - HTM_TD_Begin ("class=\"CLASSPHOTO_TITLE CM\""); + HTM_TD_Begin ("class=\"CLASSPHOTO_TITLE %s CM\"", + The_ClassPhoto[Gbl.Prefs.Theme]); if (InsCod > 0) { if (!PrintView) - HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"CLASSPHOTO_TITLE\"", - Hie.Ins.WWW); + HTM_A_Begin ("href=\"%s\" target=\"_blank\"" + " class=\"CLASSPHOTO_TITLE %s\"", + Hie.Ins.WWW,The_ClassPhoto[Gbl.Prefs.Theme]); HTM_Txt (Hie.Ins.FullName); if (!PrintView) HTM_A_End (); @@ -1501,8 +1504,9 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, if (Hie.Ins.InsCod > 0) HTM_Txt (" - "); if (!PrintView) - HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"CLASSPHOTO_TITLE\"", - Hie.Deg.WWW); + HTM_A_Begin ("href=\"%s\" target=\"_blank\"" + " class=\"CLASSPHOTO_TITLE %s\"", + Hie.Deg.WWW,The_ClassPhoto[Gbl.Prefs.Theme]); HTM_Txt (Hie.Deg.FullName); if (!PrintView) HTM_A_End (); @@ -1524,8 +1528,9 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, if (DegCod > 0) { if (!PrintView) - HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"CLASSPHOTO_TITLE\"", - Hie.Deg.WWW); + HTM_A_Begin ("href=\"%s\" target=\"_blank\"" + " class=\"CLASSPHOTO_TITLE %s\"", + Hie.Deg.WWW,The_ClassPhoto[Gbl.Prefs.Theme]); Lgo_DrawLogo (HieLvl_DEG,Hie.Deg.DegCod,Hie.Deg.ShrtName,40,NULL,true); if (!PrintView) HTM_A_End (); diff --git a/swad_menu.c b/swad_menu.c index 109af9ee..b68dc854 100644 --- a/swad_menu.c +++ b/swad_menu.c @@ -324,7 +324,7 @@ void Mnu_PutIconsToSelectMenu (void) HTM_DIV_Begin ("class=\"PREF_OFF\""); Frm_BeginForm (ActChgMnu); Par_PutHiddenParamUnsigned (NULL,"Menu",(unsigned) Menu); - Ico_PutSettingIconLink (Mnu_MenuIcons[Menu],Ico_UNCHANGED, + Ico_PutSettingIconLink (Mnu_MenuIcons[Menu],Ico_BLACK, Txt_MENU_NAMES[Menu]); Frm_EndForm (); HTM_DIV_End (); diff --git a/swad_network.c b/swad_network.c index 19af12ac..38cc5468 100644 --- a/swad_network.c +++ b/swad_network.c @@ -231,12 +231,10 @@ void Net_ShowFormMyWebsAndSocialNets (void) HTM_TD_Begin ("class=\"REC_C1_BOT LM\""); HTM_LABEL_Begin ("for=\"%s\" class=\"%s\"", StrName,The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_IMG (Cfg_URL_ICON_PUBLIC, - Net_WebsAndSocialNetworksIcons[NumURL], - Net_WebsAndSocialNetworksTitle[NumURL], - "class=\"CONTEXT_ICO_16x16\"" - " style=\"margin-right:6px;\""); - HTM_TxtColon (Net_WebsAndSocialNetworksTitle[NumURL]); + Ico_PutIcon (Net_WebsAndSocialNetworksIcons[NumURL],Ico_BLACK, + Net_WebsAndSocialNetworksTitle[NumURL], + "CONTEXT_OPT CONTEXT_ICO_16x16"); + HTM_TxtF (" %s:",Net_WebsAndSocialNetworksTitle[NumURL]); HTM_LABEL_End (); HTM_TD_End (); diff --git a/swad_photo.c b/swad_photo.c index 254a105a..cbda9cd1 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -2115,6 +2115,7 @@ static void Pho_GetMaxStdsPerDegree (struct Pho_DegPhotos *DegPhotos) static void Pho_ShowOrPrintClassPhotoDegrees (struct Pho_DegPhotos *DegPhotos, Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) { + extern const char *The_ClassPhoto[The_NUM_THEMES]; MYSQL_RES *mysql_res; unsigned long NumDeg; unsigned long NumDegs; @@ -2157,7 +2158,8 @@ static void Pho_ShowOrPrintClassPhotoDegrees (struct Pho_DegPhotos *DegPhotos, } /***** Show average photo of students belonging to this degree *****/ - HTM_TD_Begin ("class=\"CLASSPHOTO CM\""); + HTM_TD_Begin ("class=\"CLASSPHOTO %s CM\"", + The_ClassPhoto[Gbl.Prefs.Theme]); Pho_ShowDegreeAvgPhotoAndStat (&Deg,DegPhotos, SeeOrPrint, Usr_SEX_ALL, @@ -2192,6 +2194,7 @@ static void Pho_ShowOrPrintListDegrees (struct Pho_DegPhotos *DegPhotos, Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) { extern const char *The_ClassDat[The_NUM_THEMES]; + extern const char *The_ClassPhoto[The_NUM_THEMES]; extern const char *Txt_No_INDEX; extern const char *Txt_Degree; extern const char *Txt_SEX_PLURAL_Abc[Usr_NUM_SEXS]; @@ -2273,7 +2276,8 @@ static void Pho_ShowOrPrintListDegrees (struct Pho_DegPhotos *DegPhotos, { /***** Show average photo of students belonging to this degree *****/ Pho_GetNumStdsInDegree (Deg.DegCod,Sex,&NumStds,&NumStdsWithPhoto); - HTM_TD_Begin ("class=\"CLASSPHOTO RM %s\"", + HTM_TD_Begin ("class=\"CLASSPHOTO %s RM %s\"", + The_ClassPhoto[Gbl.Prefs.Theme], Gbl.ColorRows[Gbl.RowEvenOdd]); if (Gbl.Usrs.Listing.WithPhotos) Pho_ShowDegreeAvgPhotoAndStat (&Deg,DegPhotos, @@ -2360,6 +2364,7 @@ static void Pho_ShowDegreeAvgPhotoAndStat (const struct Deg_Degree *Deg, { extern const char *Usr_StringsSexDB[Usr_NUM_SEXS]; extern const char *The_ClassDatStrong[The_NUM_THEMES]; + extern const char *The_ClassPhoto[The_NUM_THEMES]; extern const char *Txt_students_ABBREVIATION; extern const char *Txt_SEX_PLURAL_abc[Usr_NUM_SEXS]; extern const char *Txt_photos; @@ -2453,7 +2458,8 @@ static void Pho_ShowDegreeAvgPhotoAndStat (const struct Deg_Degree *Deg, PhotoWidth,PhotoHeight); /***** Caption *****/ - HTM_DIV_Begin ("class=\"CLASSPHOTO_CAPTION\""); + HTM_DIV_Begin ("class=\"CLASSPHOTO_CAPTION %s\"", + The_ClassPhoto[Gbl.Prefs.Theme]); HTM_Txt (Deg->ShrtName); HTM_BR (); HTM_TxtF ("%d %s",NumStds,Txt_students_ABBREVIATION); diff --git a/swad_photo_shape.c b/swad_photo_shape.c index 7b3d3457..0d97966a 100644 --- a/swad_photo_shape.c +++ b/swad_photo_shape.c @@ -25,7 +25,9 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ +#define _GNU_SOURCE // For asprintf #include // For NULL +#include // For asprintf #include "swad_action.h" #include "swad_config.h" @@ -54,6 +56,7 @@ static void Pho_PutIconsPhotoShape (__attribute__((unused)) void *Args); void Pho_PutIconsToSelectPhotoShape (void) { extern const char *Hlp_PROFILE_Settings_user_photos; + extern const char *Ico_ClassColor[Ico_NUM_COLORS][The_NUM_THEMES]; extern const char *The_ClassPrefOn[The_NUM_THEMES]; extern const char *Txt_User_photos; extern const char *Txt_PHOTO_SHAPES[Pho_NUM_SHAPES]; @@ -81,7 +84,12 @@ void Pho_PutIconsToSelectPhotoShape (void) HTM_DIV_Begin ("class=\"PREF_OFF\""); Frm_BeginForm (ActChgUsrPho); Par_PutHiddenParamUnsigned (NULL,"PhotoShape",Shape); - HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user.svg",Txt_PHOTO_SHAPES[Shape],ClassPhoto[Shape]); + HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user.svg", + Txt_PHOTO_SHAPES[Shape], + Str_BuildString ("%s %s", + ClassPhoto[Shape], + Ico_ClassColor[Ico_BLACK][Gbl.Prefs.Theme])); + Str_FreeStrings (); Frm_EndForm (); HTM_DIV_End (); } @@ -143,3 +151,88 @@ Pho_Shape_t Pho_GetShapeFromStr (const char *Str) return Pho_SHAPE_DEFAULT; } + +/*****************************************************************************/ +/****** Get and show number of users who have chosen a user photo shape ******/ +/*****************************************************************************/ + +void Fig_GetAndShowNumUsrsPerPhotoShape (void) + { + extern const char *Hlp_ANALYTICS_Figures_user_photos; + extern const char *Ico_ClassColor[Ico_NUM_COLORS][The_NUM_THEMES]; + extern const char *The_ClassDat[The_NUM_THEMES]; + extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES]; + extern const char *Txt_User_photos; + extern const char *Txt_Number_of_users; + extern const char *Txt_PERCENT_of_users; + extern const char *Txt_PHOTO_SHAPES[Pho_NUM_SHAPES]; + static const char *ClassPhoto[Pho_NUM_SHAPES] = + { + [Pho_SHAPE_CIRCLE ] = "PHOTOC15x20B", + [Pho_SHAPE_ELLIPSE ] = "PHOTOE15x20B", + [Pho_SHAPE_OVAL ] = "PHOTOO15x20B", + [Pho_SHAPE_RECTANGLE] = "PHOTOR15x20B", + }; + Pho_Shape_t Shape; + char *SubQuery; + unsigned NumUsrs[Pho_NUM_SHAPES]; + unsigned NumUsrsTotal = 0; + + /***** Begin box and table *****/ + Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_PHOTO_SHAPES], + NULL,NULL, + Hlp_ANALYTICS_Figures_user_photos,Box_NOT_CLOSABLE,2); + + /***** Heading row *****/ + HTM_TR_Begin (NULL); + HTM_TH (1,1,Txt_User_photos ,"CM"); + HTM_TH (1,1,Txt_Number_of_users ,"RM"); + HTM_TH (1,1,Txt_PERCENT_of_users,"RM"); + HTM_TR_End (); + + /***** For each user photo shape... *****/ + for (Shape = (Pho_Shape_t) 0; + Shape <= (Pho_Shape_t) (Pho_NUM_SHAPES - 1); + Shape++) + { + /* Get the number of users who have chosen this layout of columns from database */ + if (asprintf (&SubQuery,"usr_data.PhotoShape=%u", + (unsigned) Shape) < 0) + Err_NotEnoughMemoryExit (); + NumUsrs[Shape] = Usr_DB_GetNumUsrsWhoChoseAnOption (SubQuery); + free (SubQuery); + + /* Update total number of users */ + NumUsrsTotal += NumUsrs[Shape]; + } + + /***** Write number of users who have chosen this user photo shape *****/ + for (Shape = (Pho_Shape_t) 0; + Shape <= (Pho_Shape_t) (Pho_NUM_SHAPES - 1); + Shape++) + { + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"CM\""); + HTM_IMG (Cfg_URL_ICON_PUBLIC,"user.svg",Txt_PHOTO_SHAPES[Shape], + "class=\"%s %s\"", + ClassPhoto[Shape], + Ico_ClassColor[Ico_BLACK][Gbl.Prefs.Theme]); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]); + HTM_Unsigned (NumUsrs[Shape]); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassDat[Gbl.Prefs.Theme]); + HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Shape] * 100.0 / + (double) NumUsrsTotal : + 0.0); + HTM_TD_End (); + + HTM_TR_End (); + } + + /***** End table and box *****/ + Box_BoxTableEnd (); + } diff --git a/swad_photo_shape.h b/swad_photo_shape.h index f882e01b..2458d3c7 100644 --- a/swad_photo_shape.h +++ b/swad_photo_shape.h @@ -48,4 +48,6 @@ void Pho_ChangePhotoShape (void); Pho_Shape_t Pho_GetParamPhotoShape (void); Pho_Shape_t Pho_GetShapeFromStr (const char *Str); +void Fig_GetAndShowNumUsrsPerPhotoShape (void); + #endif diff --git a/swad_theme.c b/swad_theme.c index fde749c7..f40ae504 100644 --- a/swad_theme.c +++ b/swad_theme.c @@ -444,6 +444,17 @@ const char *The_TmlTxtColor[The_NUM_THEMES] = [The_THEME_DARK ] = "Tml_TXT_DARK", }; +const char *The_ClassPhoto[The_NUM_THEMES] = + { + [The_THEME_WHITE ] = "CLASSPHOTO_WHITE", + [The_THEME_GREY ] = "CLASSPHOTO_GREY", + [The_THEME_PURPLE] = "CLASSPHOTO_PURPLE", + [The_THEME_BLUE ] = "CLASSPHOTO_BLUE", + [The_THEME_YELLOW] = "CLASSPHOTO_YELLOW", + [The_THEME_PINK ] = "CLASSPHOTO_PINK", + [The_THEME_DARK ] = "CLASSPHOTO_DARK", + }; + /*****************************************************************************/ /****************************** Private prototypes ***************************/ /*****************************************************************************/ diff --git a/swad_timetable.c b/swad_timetable.c index 778119a0..e5bc7e26 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -212,10 +212,12 @@ static void Tmt_FreeTimeTable (void) static void Tmt_ShowTimeTableGrpsSelected (void) { + extern const char *The_ClassPhoto[The_NUM_THEMES]; extern const char *Txt_Groups_OF_A_USER; extern const char *Txt_All_groups; - HTM_DIV_Begin ("class=\"CLASSPHOTO_TITLE CM\""); + HTM_DIV_Begin ("class=\"CLASSPHOTO_TITLE %s CM\"", + The_ClassPhoto[Gbl.Prefs.Theme]); switch (Gbl.Crs.Grps.WhichGrps) { diff --git a/swad_user.c b/swad_user.c index ab2457a0..9c433234 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6118,6 +6118,7 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, struct SelectedUsrs *SelectedUsrs, bool PutCheckBoxToSelectUsr) { + extern const char *The_ClassPhoto[The_NUM_THEMES]; static const char *ClassPhoto[Usr_NUM_CLASS_PHOTO_TYPE][Pho_NUM_SHAPES] = { [Usr_CLASS_PHOTO_SEL ][Pho_SHAPE_CIRCLE ] = "PHOTOC21x28", @@ -6168,12 +6169,14 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) { UsrIsTheMsgSender = true; - HTM_TD_Begin ("class=\"CLASSPHOTO CB LIGHT_GREEN\""); + HTM_TD_Begin ("class=\"CLASSPHOTO %s CB LIGHT_GREEN\"", + The_ClassPhoto[Gbl.Prefs.Theme]); } else { UsrIsTheMsgSender = false; - HTM_TD_Begin ("class=\"CLASSPHOTO CB\""); + HTM_TD_Begin ("class=\"CLASSPHOTO %s CB\"", + The_ClassPhoto[Gbl.Prefs.Theme]); } /***** Checkbox to select this user *****/ @@ -6187,7 +6190,8 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, false); /***** Photo foot *****/ - HTM_DIV_Begin ("class=\"CLASSPHOTO_CAPTION\""); + HTM_DIV_Begin ("class=\"CLASSPHOTO_CAPTION %s\"", + The_ClassPhoto[Gbl.Prefs.Theme]); /* Name */ if (UsrDat.FrstName[0])