diff --git a/css/swad21.70.1.css b/css/swad21.70.1.css index 7866d72e8..17de3bd8d 100644 --- a/css/swad21.70.1.css +++ b/css/swad21.70.1.css @@ -1850,10 +1850,17 @@ a:hover img.CENTER_PHOTO_SHOW box-sizing:border-box; margin:8px auto; padding:12px; - background-color:#fff8e5; border-radius:2px; box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 2px 1px -2px rgba(0,0,0,0.2), 0 1px 5px 0 rgba(0,0,0,0.12); } +.ALERT_BG_WHITE {background-color:#fff8e5;} +.ALERT_BG_GREY {background-color:#fff8e5;} +.ALERT_BG_PURPLE {background-color:#fff8e5;} +.ALERT_BG_BLUE {background-color:#fff8e5;} +.ALERT_BG_YELLOW {background-color:#fff8e5;} +.ALERT_BG_PINK {background-color:#fff8e5;} +.ALERT_BG_DARK {background-color:#a0a0a0;} + .ALERT_CLOSE { float:right; diff --git a/swad_alert.c b/swad_alert.c index 341b82d0d..7466f55c2 100644 --- a/swad_alert.c +++ b/swad_alert.c @@ -359,6 +359,7 @@ void Ale_ShowAlertAndButton1 (Ale_AlertType_t AlertType,const char *fmt,...) static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Txt) { + extern const char *The_ClassAlertBackground[The_NUM_THEMES]; extern const char *Txt_Close; char IdAlert[Frm_MAX_BYTES_ID + 1]; static const bool AlertClosable[Ale_NUM_ALERT_TYPES] = @@ -386,7 +387,7 @@ static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Tx if (!Gbl.Layout.HTMLStartWritten) Lay_WriteStartOfPage (); - /***** Begin box *****/ + /***** Begin container *****/ if (AlertClosable[AlertType]) { /* Create unique id for alert */ @@ -395,27 +396,30 @@ static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Tx } else HTM_DIV_Begin ("class=\"CM\""); - HTM_DIV_Begin ("class=\"ALERT\""); - /***** Icon to close the alert *****/ - if (AlertClosable[AlertType]) - { - HTM_DIV_Begin ("class=\"ALERT_CLOSE\""); - HTM_A_Begin ("href=\"\" onclick=\"toggleDisplay('%s');return false;\" /", - IdAlert); - Ico_PutIcon ("times.svg",Txt_Close,"ICO16x16"); - HTM_A_End (); + /***** Begin box *****/ + HTM_DIV_Begin ("class=\"ALERT %s\"", + The_ClassAlertBackground[Gbl.Prefs.Theme]); + + /***** Icon to close the alert *****/ + if (AlertClosable[AlertType]) + { + HTM_DIV_Begin ("class=\"ALERT_CLOSE\""); + HTM_A_Begin ("href=\"\" onclick=\"toggleDisplay('%s');return false;\" /", + IdAlert); + Ico_PutIcon ("times.svg",Txt_Close,"ICO16x16"); + HTM_A_End (); + HTM_DIV_End (); + } + + /***** Write message *****/ + if (AlertType == Ale_NONE) + HTM_DIV_Begin ("class=\"ALERT_TXT\""); + else + HTM_DIV_Begin ("class=\"ALERT_TXT\" style=\"background-image:url('%s/%s');\"", + Cfg_URL_ICON_PUBLIC,Ale_AlertIcons[AlertType]); + HTM_Txt (Txt); HTM_DIV_End (); - } - - /***** Write message *****/ - if (AlertType == Ale_NONE) - HTM_DIV_Begin ("class=\"ALERT_TXT\""); - else - HTM_DIV_Begin ("class=\"ALERT_TXT\" style=\"background-image:url('%s/%s');\"", - Cfg_URL_ICON_PUBLIC,Ale_AlertIcons[AlertType]); - HTM_Txt (Txt); - HTM_DIV_End (); } /*****************************************************************************/ @@ -426,28 +430,30 @@ void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const c void (*FuncParams) (void *Args),void *Args, Btn_Button_t Button,const char *TxtButton) { - /***** Optional button *****/ - if (NextAction != ActUnk && - Button != Btn_NO_BUTTON && - TxtButton) - if (TxtButton[0]) - { - /* Begin form */ - Frm_BeginFormAnchorOnSubmit (NextAction,Anchor,OnSubmit); - if (FuncParams) - { - FuncParams (Args); - } + /***** Optional button *****/ + if (NextAction != ActUnk && + Button != Btn_NO_BUTTON && + TxtButton) + if (TxtButton[0]) + { + /* Begin form */ + Frm_BeginFormAnchorOnSubmit (NextAction,Anchor,OnSubmit); + if (FuncParams) + { + FuncParams (Args); + } - /* Put button */ - Btn_PutButton (Button,TxtButton); + /* Put button */ + Btn_PutButton (Button,TxtButton); - /* End form */ - Frm_EndForm (); - } + /* End form */ + Frm_EndForm (); + } - /***** End box *****/ - HTM_DIV_End (); + /***** End box *****/ + HTM_DIV_End (); + + /***** End container *****/ HTM_DIV_End (); } diff --git a/swad_changelog.h b/swad_changelog.h index 46cfafbbc..68f30b3d4 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -602,7 +602,7 @@ 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.70.4 (2021-12-18)" +#define Log_PLATFORM_VERSION "SWAD 21.70.6 (2021-12-20)" #define CSS_FILE "swad21.70.1.css" #define JS_FILE "swad21.67.4.js" /* diff --git a/swad_theme.c b/swad_theme.c index b5298763d..6e0b0ba37 100644 --- a/swad_theme.c +++ b/swad_theme.c @@ -393,6 +393,17 @@ const char *The_ClassFrameTitleColor[The_NUM_THEMES] = [The_THEME_DARK ] = "FRAME_TITLE_DARK", }; +const char *The_ClassAlertBackground[The_NUM_THEMES] = + { + [The_THEME_WHITE ] = "ALERT_BG_WHITE", + [The_THEME_GREY ] = "ALERT_BG_GREY", + [The_THEME_PURPLE] = "ALERT_BG_PURPLE", + [The_THEME_BLUE ] = "ALERT_BG_BLUE", + [The_THEME_YELLOW] = "ALERT_BG_YELLOW", + [The_THEME_PINK ] = "ALERT_BG_PINK", + [The_THEME_DARK ] = "ALERT_BG_DARK", + }; + /*****************************************************************************/ /****************************** Private prototypes ***************************/ /*****************************************************************************/