diff --git a/swad_attendance.c b/swad_attendance.c index 55fbc207..df8a68a5 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -2777,15 +2777,7 @@ static void Att_ListEventsToSelect (struct Att_Events *Events, /***** Put button to refresh *****/ if (NormalView) - { - HTM_DIV_Begin ("class=\"UPD\""); - HTM_BUTTON_Submit_Begin (Txt_Update_attendance, - "class=\"BT_LINK FORM_IN_%s BOLD\"", - The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Update_attendance); - HTM_BUTTON_End (); - HTM_DIV_End (); - } + Lay_WriteLinkToUpdate (Txt_Update_attendance); /***** End form *****/ if (NormalView) diff --git a/swad_changelog.h b/swad_changelog.h index 1624f504..7a624eee 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. */ -#define Log_PLATFORM_VERSION "SWAD 22.85 (2023-03-29)" +#define Log_PLATFORM_VERSION "SWAD 22.85.1 (2023-03-29)" #define CSS_FILE "swad22.78.15.css" #define JS_FILE "swad22.49.js" /* + Version 22.85.1: Mar 29, 2023 Code refactoring in links to update sections. (338447 lines) Version 22.85: Mar 29, 2023 New action to remove the resource clipboard in program. (338449 lines) Version 22.84: Mar 29, 2023 New action to see the resource clipboard in program. (338356 lines) Version 22.83.5: Mar 28, 2023 Fixed bugs in rubrics and exams. (338235 lines) diff --git a/swad_connected.c b/swad_connected.c index 5fafe5f9..aff55428 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -135,9 +135,8 @@ void Con_ShowConnectedUsrs (void) static void Con_PutIconToUpdateConnected (__attribute__((unused)) void *Args) { - Lay_PutContextualLinkOnlyIcon (ActLstCon,NULL, - Con_PutParScope,NULL, - "recycle.svg",Ico_BLACK); + Ico_PutContextualIconToUpdate (ActLstCon,NULL, + Con_PutParScope,NULL); } static void Con_PutParScope (__attribute__((unused)) void *Args) diff --git a/swad_exam_result.c b/swad_exam_result.c index e8aa7087..13ec5441 100644 --- a/swad_exam_result.c +++ b/swad_exam_result.c @@ -634,13 +634,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams) HTM_TABLE_End (); /***** Put link to refresh *****/ - HTM_DIV_Begin ("class=\"UPD\""); - HTM_BUTTON_Submit_Begin (Txt_Update_results, - "class=\"BT_LINK FORM_IN_%s BOLD\"", - The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Update_results); - HTM_BUTTON_End (); - HTM_DIV_End (); + Lay_WriteLinkToUpdate (Txt_Update_results); /***** End form *****/ Frm_EndForm (); diff --git a/swad_follow.c b/swad_follow.c index d4cd68a5..7dd88b99 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -268,9 +268,8 @@ static void Fol_PutIconsWhoToFollow (__attribute__((unused)) void *Args) static void Fol_PutIconToUpdateWhoToFollow (void) { - Lay_PutContextualLinkOnlyIcon (ActSeeSocPrf,NULL, - NULL,NULL, - "recycle.svg",Ico_BLACK); + Ico_PutContextualIconToUpdate (ActSeeSocPrf,NULL, + NULL,NULL); } /*****************************************************************************/ diff --git a/swad_group.c b/swad_group.c index ec2f9ed0..a520083e 100644 --- a/swad_group.c +++ b/swad_group.c @@ -403,15 +403,7 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncPars) (void *Args),void *Args Grp_FreeListGrpTypesAndGrps (); /***** Submit button *****/ - HTM_DIV_Begin ("class=\"UPD\""); - HTM_BUTTON_Submit_Begin (Txt_Update_users, - "class=\"BT_LINK FORM_IN_%s BOLD\"%s", - The_GetSuffix (), - Gbl.Action.Act == ActReqMsgUsr ? " onsubmit=\"CopyMessageToHiddenFields();\"" : - ""); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Update_users); - HTM_BUTTON_End (); - HTM_DIV_End (); + Lay_WriteLinkToUpdate (Txt_Update_users); /***** End form *****/ Frm_EndForm (); diff --git a/swad_icon.c b/swad_icon.c index ad1cdcd7..a527e492 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -256,6 +256,14 @@ void Ico_PutContextualIconToReset (Act_Action_t NextAction,const char *Anchor, "recycle.svg",Ico_RED); } +void Ico_PutContextualIconToUpdate (Act_Action_t NextAction,const char *Anchor, + void (*FuncPars) (void *Args),void *Args) + { + Lay_PutContextualLinkOnlyIcon (NextAction,Anchor, + FuncPars,Args, + "recycle.svg",Ico_BLACK); + } + void Ico_PutContextualIconToEdit (Act_Action_t NextAction,const char *Anchor, void (*FuncPars) (void *Args),void *Args) { @@ -426,6 +434,15 @@ void Ico_PutIconLink (const char *Icon,Ico_Color_t Color,Act_Action_t NextAction Ico_GetPreffix (Color),The_GetSuffix ()); } +/*****************************************************************************/ +/******************** Show an icon and a text to update **********************/ +/*****************************************************************************/ + +void Ico_PutIconTextUpdate (const char *Text) + { + Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Text); + } + /*****************************************************************************/ /******************* Show an icon with a link (with text) ********************/ /*****************************************************************************/ diff --git a/swad_icon.h b/swad_icon.h index d2ed8a69..c5178cd6 100644 --- a/swad_icon.h +++ b/swad_icon.h @@ -70,6 +70,8 @@ void Ico_PutContextualIconToRemove (Act_Action_t NextAction,const char *Anchor, void (*FuncPars) (void *Args),void *Args); void Ico_PutContextualIconToReset (Act_Action_t NextAction,const char *Anchor, void (*FuncPars) (void *Args),void *Args); +void Ico_PutContextualIconToUpdate (Act_Action_t NextAction,const char *Anchor, + void (*FuncPars) (void *Args),void *Args); void Ico_PutContextualIconToEdit (Act_Action_t NextAction,const char *Anchor, void (*FuncPars) (void *Args),void *Args); void Ico_PutContextualIconToViewFiles (Act_Action_t NextAction, @@ -108,6 +110,7 @@ void Ico_PutContextualIconToZIP (Act_Action_t NextAction, void Ico_PutDivIcon (const char *DivClass, const char *Icon,Ico_Color_t Color,const char *Title); void Ico_PutIconLink (const char *Icon,Ico_Color_t Color,Act_Action_t NextAction); +void Ico_PutIconTextUpdate (const char *Text); 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); void Ico_PutIconOn (const char *Icon,Ico_Color_t Color,const char *Title); diff --git a/swad_layout.c b/swad_layout.c index 2ba55e50..58d33fd3 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1698,6 +1698,23 @@ void Lay_WriteIndex (unsigned Index,const char *Class) HTM_DIV_End (); } +/*****************************************************************************/ +/*************************** Write a link to update **************************/ +/*****************************************************************************/ + +void Lay_WriteLinkToUpdate (const char *Txt) + { + HTM_DIV_Begin ("class=\"UPD\""); + HTM_BUTTON_Submit_Begin (Txt, + "class=\"BT_LINK FORM_IN_%s BOLD\"%s", + The_GetSuffix (), + Gbl.Action.Act == ActReqMsgUsr ? " onsubmit=\"CopyMessageToHiddenFields();\"" : + ""); + Ico_PutIconTextUpdate (Txt); + HTM_BUTTON_End (); + HTM_DIV_End (); + } + /*****************************************************************************/ /***** Get and show number of users who have chosen a layout of columns ******/ /*****************************************************************************/ diff --git a/swad_layout.h b/swad_layout.h index 1ddcb8e4..ce34b9d0 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -80,6 +80,7 @@ void Lay_HelpRichEditor (void); void Lay_BeginHTMLFile (FILE *File,const char *Title); void Lay_WriteIndex (unsigned Index,const char *Class); +void Lay_WriteLinkToUpdate (const char *Txt); //-------------------------------- Figures ------------------------------------ void Lay_GetAndShowNumUsrsPerSideColumns (void); diff --git a/swad_match_result.c b/swad_match_result.c index 18aead9b..65d61e60 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -607,13 +607,7 @@ static void MchRes_ListGamesToSelect (struct Gam_Games *Games) HTM_TABLE_End (); /***** Put button to refresh *****/ - HTM_DIV_Begin ("class=\"UPD\""); - HTM_BUTTON_Submit_Begin (Txt_Update_results, - "class=\"BT_LINK FORM_IN_%s BOLD\"", - The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Update_results); - HTM_BUTTON_End (); - HTM_DIV_End (); + Lay_WriteLinkToUpdate (Txt_Update_results); /***** End form *****/ Frm_EndForm (); diff --git a/swad_message.c b/swad_message.c index 31d1837c..7e31c230 100644 --- a/swad_message.c +++ b/swad_message.c @@ -1512,13 +1512,7 @@ static void Msg_ShowSntOrRcvMessages (struct Msg_Messages *Messages) Msg_ShowFormToFilterMsgs (Messages); /***** Put button to refresh *****/ - HTM_DIV_Begin ("class=\"UPD\""); - HTM_BUTTON_Submit_Begin (Txt_Update_messages, - "class=\"BT_LINK FORM_IN_%s BOLD\"", - The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Update_messages); - HTM_BUTTON_End (); - HTM_DIV_End (); + Lay_WriteLinkToUpdate (Txt_Update_messages); Frm_EndForm (); diff --git a/swad_photo.c b/swad_photo.c index 998b7ac8..692cbf32 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -1997,7 +1997,7 @@ static void Pho_PutLinkToCalculateDegreeStats (const struct Pho_DegPhotos *DegPh HTM_BUTTON_Submit_Begin (Txt_Calculate_average_photo_of_THE_DEGREE_X, "class=\"BT_LINK FORM_IN_%s BOLD\"", The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Calculate_average_photo_of_THE_DEGREE_X); + Ico_PutIconTextUpdate (Txt_Calculate_average_photo_of_THE_DEGREE_X); HTM_BUTTON_End (); /* Selector with all degrees with students */ diff --git a/swad_profile.c b/swad_profile.c index 82dad914..076745e0 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -779,11 +779,11 @@ static void Prf_PutLinkCalculateFigures (const char *EncryptedUsrCod) Frm_BeginForm (ActCalFig); Usr_PutParUsrCodEncrypted (EncryptedUsrCod); - /***** Put button to refresh *****/ + /***** Put icon to refresh *****/ HTM_BUTTON_Submit_Begin (Txt_Calculate, "class=\"BT_LINK FORM_OUT_%s BOLD\"", The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_Calculate); + Ico_PutIconTextUpdate (Txt_Calculate); HTM_BUTTON_End (); Frm_EndForm (); diff --git a/swad_timeline_publication.c b/swad_timeline_publication.c index 3fbe0d12..f59cb597 100644 --- a/swad_timeline_publication.c +++ b/swad_timeline_publication.c @@ -493,13 +493,12 @@ void TmlPub_PutLinkToViewOldPubs (void) HTM_DIV_Begin ("id=\"view_old_pubs_container\"" " class=\"Tml_WIDTH Tml_SEP BG_HIGHLIGHT\""); - /***** Put button to refresh *****/ HTM_BUTTON_Begin (Txt_See_more, "class=\"BT_LINK FORM_IN_%s BOLD\"" " onclick=\"refreshOldTimeline();return false;\"", The_GetSuffix ()); - Ico_PutIconTextLink ("recycle.svg",Ico_BLACK,Txt_See_more); + Ico_PutIconTextUpdate (Txt_See_more); HTM_BUTTON_End (); /***** End container *****/