diff --git a/css/swad16.192.css b/css/swad16.193.4.css similarity index 99% rename from css/swad16.192.css rename to css/swad16.193.4.css index df0ccd8d4..64544da7f 100644 --- a/css/swad16.192.css +++ b/css/swad16.193.4.css @@ -1497,15 +1497,21 @@ a:hover /* Default ==> underlined */ display:inline-block; box-sizing:border-box; max-width:90%; - margin:8px auto 0 auto; + margin:8px auto; + padding:12px; background-color:#FFF9EA; + border-radius:2px; + box-shadow: 0 2px 2px 0 rgba(124,121,109,0.14), 0 2px 1px -2px rgba(124,121,109,0.2), 0 1px 5px 0 rgba(124,121,109,0.12); + /* opacity:0.9; */ + } +.ALERT_TXT + { + box-sizing:border-box; + margin:0 auto; + padding:12px 12px 12px 45px; background-position:12px 12px; background-size:20px 20px; background-repeat:no-repeat; - padding:12px 12px 12px 45px; - border-radius:2px; - box-shadow: 0 2px 2px 0 rgba(124,121,109,0.14), 0 2px 1px -2px rgba(124,121,109,0.2), 0 1px 5px 0 rgba(124,121,109,0.12); - opacity:0.9; font-size:12pt; color:#632921; text-align:left; diff --git a/icon/question16x16.gif b/icon/question16x16.gif new file mode 100644 index 000000000..04b26958e Binary files /dev/null and b/icon/question16x16.gif differ diff --git a/swad_changelog.h b/swad_changelog.h index b712d13cc..cf6d42539 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -221,13 +221,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.193.3 (2017-04-27)" -#define CSS_FILE "swad16.192.css" +#define Log_PLATFORM_VERSION "SWAD 16.193.4 (2017-04-27)" +#define CSS_FILE "swad16.193.4.css" #define JS_FILE "swad16.181.js" // 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 16.193.4: Apr 27, 2017 Changes in layout of alerts. + Changed dialog to remove user as administrator. (218311 lines) Version 16.193.3: Apr 27, 2017 Changes in layout of alerts. Changed dialog to remove my photo. (218291 lines) Version 16.193.2: Apr 27, 2017 Statistics tab is renamed as Analytics tab. (218265 lines) diff --git a/swad_enrolment.c b/swad_enrolment.c index e32f13e52..f3d33b694 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -3986,19 +3986,22 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,const char *InsCtrDegN if (Usr_ChkIfUsrCodExists (Gbl.Usrs.Other.UsrDat.UsrCod)) { + /***** Show question and button to remove user as administrator *****/ + /* Start alert */ sprintf (Gbl.Message, ItsMe ? Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_X : Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_X, InsCtrDegName); - Lay_ShowAlert (Lay_INFO,Gbl.Message); + Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message); + /* Show user's record */ Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); - Act_FormStart (Enr_ActRemAdm[Scope]); - Usr_PutParamOtherUsrCodEncrypted (); - Lay_PutRemoveButton (ItsMe ? Txt_Remove_me_as_an_administrator : - Txt_Remove_USER_as_an_administrator); - Act_FormEnd (); + /* End alert */ + Lay_ShowAlertAndButton2 (Enr_ActRemAdm[Scope],Usr_PutParamOtherUsrCodEncrypted, + Lay_REMOVE_BUTTON, + ItsMe ? Txt_Remove_me_as_an_administrator : + Txt_Remove_USER_as_an_administrator); } else Lay_ShowErrorAndExit ("User doesn't exist."); diff --git a/swad_layout.c b/swad_layout.c index d33df7923..aac5ce7fd 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1588,7 +1588,7 @@ void Lay_ShowErrorAndExit (const char *Message) void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message) { Lay_ShowAlertAndButton1 (AlertType,Message); - Lay_ShowAlertAndButton2 (ActUnk,Lay_NO_BUTTON,NULL); + Lay_ShowAlertAndButton2 (ActUnk,NULL,Lay_NO_BUTTON,NULL); } void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message) @@ -1599,16 +1599,19 @@ void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message) /***** Start box *****/ fprintf (Gbl.F.Out,"
" - "
", - Gbl.Prefs.IconsURL,Lay_AlertIcons[AlertType]); + "
"); /***** Write message *****/ + fprintf (Gbl.F.Out,"
", + Gbl.Prefs.IconsURL,Lay_AlertIcons[AlertType]); if (Message) fprintf (Gbl.F.Out,"%s",Message); + fprintf (Gbl.F.Out,"
"); } -void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,Lay_Button_t Button,const char *TxtButton) +void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,void (*FuncParams) (), + Lay_Button_t Button,const char *TxtButton) { /***** Optional button *****/ if (NextAction != ActUnk && @@ -1616,14 +1619,21 @@ void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,Lay_Button_t Button,const TxtButton) if (TxtButton[0]) { + /* Start form */ Act_FormStart (NextAction); + if (FuncParams) + FuncParams (); + + /* Put button *****/ Lay_PutButton (Button,TxtButton); + + /* End form */ Act_FormEnd (); } /***** End box *****/ fprintf (Gbl.F.Out,"
" - "
"); + "
"); } /*****************************************************************************/ diff --git a/swad_layout.h b/swad_layout.h index 51600a61a..8bc5bb0ff 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -120,7 +120,8 @@ void Lay_EndRoundFrame (void); void Lay_ShowErrorAndExit (const char *Message); void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message); void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message); -void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,Lay_Button_t Button,const char *TxtButton); +void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,void (*FuncParams) (), + Lay_Button_t Button,const char *TxtButton); void Lay_RefreshNotifsAndConnected (void); void Lay_RefreshLastClicks (void); diff --git a/swad_photo.c b/swad_photo.c index 58753a597..72681d9f5 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -423,7 +423,7 @@ void Pho_ReqRemoveMyPhoto (void) fprintf (Gbl.F.Out,""); /* End alert */ - Lay_ShowAlertAndButton2 (ActRemMyPho,Lay_REMOVE_BUTTON,Txt_Remove_photo); + Lay_ShowAlertAndButton2 (ActRemMyPho,NULL,Lay_REMOVE_BUTTON,Txt_Remove_photo); } else Lay_ShowAlert (Lay_INFO,Txt_The_photo_no_longer_exists);