From 5461b98a558db149f877316dce944b96940e9641 Mon Sep 17 00:00:00 2001 From: acanas Date: Thu, 30 Jun 2022 11:53:24 +0200 Subject: [PATCH] Version 21.103.4: Jun 30, 2022 Code refactoring in icons. --- swad_changelog.h | 3 +- swad_text.c | 138 -------------------------------------- swad_timeline_comment.c | 22 +++--- swad_timeline_comment.h | 3 +- swad_timeline_favourite.c | 24 +++---- swad_timeline_form.c | 58 +++------------- swad_timeline_form.h | 4 -- swad_timeline_note.c | 18 ++--- swad_timeline_share.c | 12 ++-- swad_timeline_user.c | 18 +++-- 10 files changed, 63 insertions(+), 237 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 7187219d..c11e6a31 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate TODO: Attach pdf files in multimedia. */ -#define Log_PLATFORM_VERSION "SWAD 21.103.3 (2022-06-30)" +#define Log_PLATFORM_VERSION "SWAD 21.103.4 (2022-06-30)" #define CSS_FILE "swad21.100.css" #define JS_FILE "swad21.100.js" /* + Version 21.103.4: Jun 30, 2022 Code refactoring in icons. (327968 lines) Version 21.103.3: Jun 30, 2022 Code refactoring in icons. (328131 lines) Version 21.103.2: Jun 30, 2022 Preparation for Turkish translation. (328306 lines) Version 21.103.1: Jun 29, 2022 Code refactoring in icons. (328305 lines) diff --git a/swad_text.c b/swad_text.c index 3fcd7182..ca5e38a1 100644 --- a/swad_text.c +++ b/swad_text.c @@ -5244,29 +5244,6 @@ const char *Txt_columns = "Sütunlar"; #endif -const char *Txt_Comment = // As a verb -#if L==1 // ca - "Comentar"; -#elif L==2 // de - "Kommentieren"; -#elif L==3 // en - "Comment"; -#elif L==4 // es - "Comentar"; -#elif L==5 // fr - "Commenter"; -#elif L==6 // gn - "Comentar"; // Okoteve traducción -#elif L==7 // it - "Commentare"; -#elif L==8 // pl - "Komentować"; -#elif L==9 // pt - "Comentar"; -#elif L==10 // tr - "Comment"; // Çeviri lazim! -#endif - const char *Txt_Comment_removed = #if L==1 // ca "Comentari eliminat."; @@ -20356,29 +20333,6 @@ const char *Txt_Mark_all_NOTIFICATIONS_as_read = "Mark all as read"; // Çeviri lazim! #endif -const char *Txt_TIMELINE_Mark_as_favourite = -#if L==1 // ca - "Marca com favorit"; -#elif L==2 // de - "Markieren als Favorit"; -#elif L==3 // en - "Mark as favourite"; -#elif L==4 // es - "Marcar como favorito"; -#elif L==5 // fr - "Marquer comme favori"; -#elif L==6 // gn - "Marcar como favorito"; // Okoteve traducción -#elif L==7 // it - "Segnare come preferito"; -#elif L==8 // pl - "Oznacz jako ulubiony"; -#elif L==9 // pt - "Marcar como favorito"; -#elif L==10 // tr - "Mark as favourite"; // Çeviri lazim! -#endif - const char *Txt_Marks_management_area = #if L==1 // ca "Zona d'administració de qualificacions"; @@ -54391,29 +54345,6 @@ const char *Txt_Timeline_OF_A_USER = // Warning: it is very important to include "%s timeline"; // Çeviri lazim! #endif -const char *Txt_TIMELINE_Favourite = -#if L==1 // ca - "Favorit"; -#elif L==2 // de - "Favorit"; -#elif L==3 // en - "Favourite"; -#elif L==4 // es - "Favorito"; -#elif L==5 // fr - "Favori"; -#elif L==6 // gn - "Favorito"; // Okoteve traducción -#elif L==7 // it - "Preferito"; -#elif L==8 // pl - "Ulubiony"; -#elif L==9 // pt - "Favorito"; -#elif L==10 // tr - "Favourite"; // Çeviri lazim! -#endif - const char *Txt_TIMELINE_Favourited_by_X_USERS = // Warning: it is very important to include %u in the following sentences #if L==1 // ca "Marcat com favorit per %u"; @@ -55024,52 +54955,6 @@ const char *Txt_TIMETABLE_TYPES[Tmt_NUM_TIMETABLE_TYPES] = #endif }; -const char *Txt_TIMELINE_Share = -#if L==1 // ca - "Compartir"; -#elif L==2 // de - "Teilen"; -#elif L==3 // en - "Share"; -#elif L==4 // es - "Compartir"; -#elif L==5 // fr - "Partager"; -#elif L==6 // gn - "Compartir"; // Okoteve traducción -#elif L==7 // it - "Condividere"; -#elif L==8 // pl - "Dzielić"; -#elif L==9 // pt - "Compartilhar"; -#elif L==10 // tr - "Share"; // Çeviri lazim! -#endif - -const char *Txt_TIMELINE_Shared = -#if L==1 // ca - "Compartit"; -#elif L==2 // de - "Geteilt"; -#elif L==3 // en - "Shared"; -#elif L==4 // es - "Compartido"; -#elif L==5 // fr - "Partagé"; -#elif L==6 // gn - "Compartido"; // Okoteve traducción -#elif L==7 // it - "Condiviso"; -#elif L==8 // pl - "Udostępnione"; -#elif L==9 // pt - "Compartilhado"; -#elif L==10 // tr - "Shared"; // Çeviri lazim! -#endif - const char *Txt_TIMELINE_Shared_by_X_USERS = // Warning: it is very important to include %u in the following sentences #if L==1 // ca "Compartit per %u"; @@ -58288,29 +58173,6 @@ const char *Txt_View_all_recipients = "View all recipients"; // Çeviri lazim! #endif -const char *Txt_View_all_USERS = -#if L==1 // ca - "Veure tots"; -#elif L==2 // de - "Anzeigen alle"; -#elif L==3 // en - "View all"; -#elif L==4 // es - "Ver todos"; -#elif L==5 // fr - "Voir tous"; -#elif L==6 // gn - "Ver todos"; // Okoteve traducción -#elif L==7 // it - "Vedi tutti"; -#elif L==8 // pl - "Zobacz wszystkich"; -#elif L==9 // pt - "Ver todos"; -#elif L==10 // tr - "View all"; // Çeviri lazim! -#endif - const char *Txt_View_attendance = #if L==1 // ca "Veure assistència"; diff --git a/swad_timeline_comment.c b/swad_timeline_comment.c index cee4d647..59168b57 100644 --- a/swad_timeline_comment.c +++ b/swad_timeline_comment.c @@ -113,12 +113,10 @@ static void TmlCom_ResetComm (struct TmlCom_Comment *Com); /********* Put an icon to toggle on/off the form to comment a note ***********/ /*****************************************************************************/ -void TmlCom_PutIconToToggleComm (const char UniqueId[Frm_MAX_BYTES_ID + 1]) +void TmlCom_PutIconToToggleComm (const struct Tml_Timeline *Timeline, + const char UniqueId[Frm_MAX_BYTES_ID + 1]) { - extern const char *Txt_Comment; - - /***** Link to toggle on/off the form to comment a note *****/ - /* Begin container */ + /***** Begin container *****/ HTM_DIV_Begin ("id=\"%s_ico\" class=\"Tml_ICO_COM_OFF\"",UniqueId); /* Begin anchor */ @@ -128,12 +126,14 @@ void TmlCom_PutIconToToggleComm (const char UniqueId[Frm_MAX_BYTES_ID + 1]) /* Icon to toggle comment */ Ico_PutIcon ("comment-regular.svg",Ico_BLACK, - Txt_Comment,"CONTEXT_ICO16x16"); + Act_GetActionText (Timeline->UsrOrGbl == TmlUsr_TIMELINE_GBL ? ActRcvComGblTL : + ActRcvComUsrTL), + "CONTEXT_ICO16x16"); /* End anchor */ HTM_A_End (); - /* End container */ + /***** End container *****/ HTM_DIV_End (); } @@ -143,14 +143,14 @@ void TmlCom_PutIconToToggleComm (const char UniqueId[Frm_MAX_BYTES_ID + 1]) void TmlCom_PutIconCommDisabled (void) { - extern const char *Txt_Comment; + extern const char *Txt_not_available; /***** Disabled icon to comment a note *****/ /* Begin container */ HTM_DIV_Begin ("class=\"Tml_ICO_COM_OFF Tml_ICO_DISABLED\""); /* Disabled icon */ - Ico_PutIcon ("edit.svg",Ico_BLACK,Txt_Comment,"ICO16x16"); + Ico_PutIcon ("comment-regular.svg",Ico_BLACK,Txt_not_available,"ICO16x16"); /* End container */ HTM_DIV_End (); @@ -671,8 +671,8 @@ static void TmlCom_WriteButtons (const struct Tml_Timeline *Timeline, HTM_DIV_Begin ("id=\"fav_com_%s_%u\" class=\"Tml_FAV_COM Tml_FAV_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_COMM, - Com->PubCod,Com->UsrCod,Com->NumFavs, - TmlUsr_SHOW_FEW_USRS); + Com->PubCod,Com->UsrCod,Com->NumFavs, + TmlUsr_SHOW_FEW_USRS); HTM_DIV_End (); /***** Foot column 2: icon to remove this comment *****/ diff --git a/swad_timeline_comment.h b/swad_timeline_comment.h index c8544c64..43e81b7a 100644 --- a/swad_timeline_comment.h +++ b/swad_timeline_comment.h @@ -48,7 +48,8 @@ struct TmlCom_Comment /****************************** Public prototypes ****************************/ /*****************************************************************************/ -void TmlCom_PutIconToToggleComm (const char UniqueId[Frm_MAX_BYTES_ID + 1]); +void TmlCom_PutIconToToggleComm (const struct Tml_Timeline *Timeline, + const char UniqueId[Frm_MAX_BYTES_ID + 1]); void TmlCom_PutIconCommDisabled (void); void TmlCom_PutPhotoAndFormToWriteNewComm (const struct Tml_Timeline *Timeline, diff --git a/swad_timeline_favourite.c b/swad_timeline_favourite.c index 74915c76..4c394bf9 100644 --- a/swad_timeline_favourite.c +++ b/swad_timeline_favourite.c @@ -73,8 +73,8 @@ void TmlFav_ShowAllFaversNoteGbl (void) /***** Write HTML inside DIV with form to fav/unfav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_NOTE, - Not.NotCod,Not.UsrCod,Not.NumFavs, - TmlUsr_SHOW_ALL_USRS); + Not.NotCod,Not.UsrCod,Not.NumFavs, + TmlUsr_SHOW_ALL_USRS); } /*****************************************************************************/ @@ -99,8 +99,8 @@ void TmlFav_FavNoteGbl (void) /***** Write HTML inside DIV with form to unfav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_NOTE, - Not.NotCod,Not.UsrCod,Not.NumFavs, - TmlUsr_SHOW_FEW_USRS); + Not.NotCod,Not.UsrCod,Not.NumFavs, + TmlUsr_SHOW_FEW_USRS); } void TmlFav_UnfNoteUsr (void) @@ -121,8 +121,8 @@ void TmlFav_UnfNoteGbl (void) /***** Write HTML inside DIV with form to fav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_NOTE, - Not.NotCod,Not.UsrCod,Not.NumFavs, - TmlUsr_SHOW_FEW_USRS); + Not.NotCod,Not.UsrCod,Not.NumFavs, + TmlUsr_SHOW_FEW_USRS); } static void TmlFav_FavNote (struct TmlNot_Note *Not) @@ -209,8 +209,8 @@ void TmlFav_ShowAllFaversComGbl (void) /***** Write HTML inside DIV with form to fav/unfav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_COMM, - Com.PubCod,Com.UsrCod,Com.NumFavs, - TmlUsr_SHOW_ALL_USRS); + Com.PubCod,Com.UsrCod,Com.NumFavs, + TmlUsr_SHOW_ALL_USRS); } /*****************************************************************************/ @@ -235,8 +235,8 @@ void TmlFav_FavCommGbl (void) /***** Write HTML inside DIV with form to unfav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_COMM, - Com.PubCod,Com.UsrCod,Com.NumFavs, - TmlUsr_SHOW_FEW_USRS); + Com.PubCod,Com.UsrCod,Com.NumFavs, + TmlUsr_SHOW_FEW_USRS); } void TmlFav_UnfCommUsr (void) @@ -257,8 +257,8 @@ void TmlFav_UnfCommGbl (void) /***** Write HTML inside DIV with form to fav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_COMM, - Com.PubCod,Com.UsrCod,Com.NumFavs, - TmlUsr_SHOW_FEW_USRS); + Com.PubCod,Com.UsrCod,Com.NumFavs, + TmlUsr_SHOW_FEW_USRS); } static void TmlFav_FavComm (struct TmlCom_Comment *Com) diff --git a/swad_timeline_form.c b/swad_timeline_form.c index 29456b64..a2db5ca7 100644 --- a/swad_timeline_form.c +++ b/swad_timeline_form.c @@ -41,8 +41,6 @@ /************************* Private constants and types ***********************/ /*****************************************************************************/ -#define TmlFrm_ICON_ELLIPSIS "ellipsis-h.svg" - const Act_Action_t TmlFrm_ActionGbl[TmlFrm_NUM_ACTIONS] = { [TmlFrm_RECEIVE_POST] = ActRcvPstGblTL, @@ -94,10 +92,6 @@ extern struct Globals Gbl; void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) { - extern const char *Txt_TIMELINE_Mark_as_favourite; - extern const char *Txt_TIMELINE_Favourite; - extern const char *Txt_TIMELINE_Share; - extern const char *Txt_TIMELINE_Shared; struct Tml_Form Form[TmlUsr_NUM_FAV_SHA][2] = { [TmlUsr_FAV_UNF_NOTE] = @@ -109,7 +103,6 @@ void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) .ParamCod = Cod, .Icon = TmlFav_ICON_FAV, .Color = Ico_BLACK, - .Title = Txt_TIMELINE_Mark_as_favourite, }, [true] = // I have faved ==> unfav { @@ -118,7 +111,6 @@ void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) .ParamCod = Cod, .Icon = TmlFav_ICON_FAV, .Color = Ico_RED, - .Title = Txt_TIMELINE_Favourite, }, }, [TmlUsr_FAV_UNF_COMM] = @@ -130,7 +122,6 @@ void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) .ParamCod = Cod, .Icon = TmlFav_ICON_FAV, .Color = Ico_BLACK, - .Title = Txt_TIMELINE_Mark_as_favourite, }, [true] = // I have faved ==> unfav { @@ -139,7 +130,6 @@ void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) .ParamCod = Cod, .Icon = TmlFav_ICON_FAV, .Color = Ico_RED, - .Title = Txt_TIMELINE_Favourite, }, }, [TmlUsr_SHA_UNS_NOTE] = @@ -151,7 +141,6 @@ void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) .ParamCod = Cod, .Icon = TmlSha_ICON_SHARE, .Color = Ico_BLACK, - .Title = Txt_TIMELINE_Share, }, [true] = // I have shared ==> unshare { @@ -160,7 +149,6 @@ void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod) .ParamCod = Cod, .Icon = TmlSha_ICON_SHARE, .Color = Ico_GREEN, - .Title = Txt_TIMELINE_Shared, }, }, }; @@ -197,38 +185,6 @@ void TmlFrm_EndForm (void) Frm_EndForm (); } -/*****************************************************************************/ -/********************* Form to show all favers/sharers ***********************/ -/*****************************************************************************/ - -void TmlFrm_PutFormToSeeAllFaversSharers (TmlFrm_Action_t Action, - const char *ParamFormat,long ParamCod, - TmlUsr_HowManyUsrs_t HowManyUsrs) - { - extern const char *Txt_View_all_USERS; - struct Tml_Form Form = - { - .Action = Action, - .ParamFormat = ParamFormat, - .ParamCod = ParamCod, - .Icon = TmlFrm_ICON_ELLIPSIS, - .Color = Ico_BLACK, - .Title = Txt_View_all_USERS, - }; - - switch (HowManyUsrs) - { - case TmlUsr_SHOW_FEW_USRS: - /***** Form and icon to view all users *****/ - TmlFrm_FormFavSha (&Form); - break; - case TmlUsr_SHOW_ALL_USRS: - /***** Disabled icon *****/ - Ico_PutIconOff (TmlFrm_ICON_ELLIPSIS,Ico_BLACK,Txt_View_all_USERS); - break; - } - } - /*****************************************************************************/ /******* Form to fav/unfav or share/unshare in global or user timeline *******/ /*****************************************************************************/ @@ -236,7 +192,6 @@ void TmlFrm_PutFormToSeeAllFaversSharers (TmlFrm_Action_t Action, void TmlFrm_FormFavSha (const struct Tml_Form *Form) { char *OnSubmit; - const char *Anchor; char ParamStr[7 + Cns_MAX_DECIMAL_DIGITS_LONG + 1]; /***** Create parameter string *****/ @@ -269,7 +224,10 @@ void TmlFrm_FormFavSha (const struct Tml_Form *Form) ParamStr, Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0) Err_NotEnoughMemoryExit (); - Anchor = "timeline"; + Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,"timeline",OnSubmit); + free (OnSubmit); + Ico_PutIconLink (Form->Icon,Form->Color, + Act_GetActionText (TmlFrm_ActionUsr[Form->Action])); } else { @@ -280,11 +238,11 @@ void TmlFrm_FormFavSha (const struct Tml_Form *Form) Gbl.Session.Id, ParamStr) < 0) Err_NotEnoughMemoryExit (); - Anchor = NULL; + Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,NULL,OnSubmit); + free (OnSubmit); + Ico_PutIconLink (Form->Icon,Form->Color, + Act_GetActionText (TmlFrm_ActionGbl[Form->Action])); } - Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,Anchor,OnSubmit); - free (OnSubmit); - Ico_PutIconLink (Form->Icon,Form->Color,Form->Title); Frm_EndForm (); } diff --git a/swad_timeline_form.h b/swad_timeline_form.h index 9e38f659..c377942d 100644 --- a/swad_timeline_form.h +++ b/swad_timeline_form.h @@ -63,7 +63,6 @@ struct Tml_Form long ParamCod; const char *Icon; Ico_Color_t Color; - const char *Title; }; /*****************************************************************************/ @@ -76,9 +75,6 @@ void TmlFrm_BeginForm (const struct Tml_Timeline *Timeline, TmlFrm_Action_t Action); void TmlFrm_EndForm (void); -void TmlFrm_PutFormToSeeAllFaversSharers (TmlFrm_Action_t Action, - const char *ParamFormat,long ParamCod, - TmlUsr_HowManyUsrs_t HowManyUsrs); void TmlFrm_FormFavSha (const struct Tml_Form *Form); void TmlFrm_FormToShowHiddenComms (long NotCod, diff --git a/swad_timeline_note.c b/swad_timeline_note.c index 10379fa1..56350c15 100644 --- a/swad_timeline_note.c +++ b/swad_timeline_note.c @@ -96,7 +96,8 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, static void TmlNot_WriteButtonsAndComms (const struct Tml_Timeline *Timeline, const struct TmlNot_Note *Not, const struct UsrData *UsrDat); -static void TmlNot_WriteButtonToAddAComm (const struct TmlNot_Note *Not, +static void TmlNot_WriteButtonToAddAComm (const struct Tml_Timeline *Timeline, + const struct TmlNot_Note *Not, const char IdNewComm[Frm_MAX_BYTES_ID + 1]); static void TmlNot_WriteFavShaRemAndComms (const struct Tml_Timeline *Timeline, const struct TmlNot_Note *Not, @@ -758,7 +759,7 @@ static void TmlNot_WriteButtonsAndComms (const struct Tml_Timeline *Timeline, Frm_SetUniqueId (IdNewComm); /***** Left: button to add a comment *****/ - TmlNot_WriteButtonToAddAComm (Not,IdNewComm); + TmlNot_WriteButtonToAddAComm (Timeline,Not,IdNewComm); /***** Right: write favs, shared and remove buttons, and comments *****/ TmlNot_WriteFavShaRemAndComms (Timeline,Not,UsrDat); @@ -771,7 +772,8 @@ static void TmlNot_WriteButtonsAndComms (const struct Tml_Timeline *Timeline, /********************** Write button to add a comment ************************/ /*****************************************************************************/ -static void TmlNot_WriteButtonToAddAComm (const struct TmlNot_Note *Not, +static void TmlNot_WriteButtonToAddAComm (const struct Tml_Timeline *Timeline, + const struct TmlNot_Note *Not, const char IdNewComm[Frm_MAX_BYTES_ID + 1]) { /***** Begin container *****/ @@ -781,7 +783,7 @@ static void TmlNot_WriteButtonToAddAComm (const struct TmlNot_Note *Not, if (Not->Unavailable) // Unavailable notes can not be commented TmlCom_PutIconCommDisabled (); else - TmlCom_PutIconToToggleComm (IdNewComm); + TmlCom_PutIconToToggleComm (Timeline,IdNewComm); /***** End container *****/ HTM_DIV_End (); @@ -828,8 +830,8 @@ static void TmlNot_WriteFavShaRem (const struct Tml_Timeline *Timeline, " class=\"Tml_FAV_NOT Tml_FAV_NOT_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_NOTE, - Not->NotCod,Not->UsrCod,Not->NumFavs, - TmlUsr_SHOW_FEW_USRS); + Not->NotCod,Not->UsrCod,Not->NumFavs, + TmlUsr_SHOW_FEW_USRS); HTM_DIV_End (); /***** Foot column 2: share zone *****/ @@ -837,8 +839,8 @@ static void TmlNot_WriteFavShaRem (const struct Tml_Timeline *Timeline, " class=\"Tml_SHA_NOT Tml_SHA_NOT_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); TmlUsr_PutIconFavSha (TmlUsr_SHA_UNS_NOTE, - Not->NotCod,Not->UsrCod,Not->NumShared, - TmlUsr_SHOW_FEW_USRS); + Not->NotCod,Not->UsrCod,Not->NumShared, + TmlUsr_SHOW_FEW_USRS); HTM_DIV_End (); /***** Foot column 3: icon to remove this note *****/ diff --git a/swad_timeline_share.c b/swad_timeline_share.c index b4639428..cd4dcafd 100644 --- a/swad_timeline_share.c +++ b/swad_timeline_share.c @@ -70,8 +70,8 @@ void TmlSha_ShowAllSharersNoteGbl (void) /***** Write HTML inside DIV with form to share/unshare *****/ TmlUsr_PutIconFavSha (TmlUsr_SHA_UNS_NOTE, - Not.NotCod,Not.UsrCod,Not.NumShared, - TmlUsr_SHOW_ALL_USRS); + Not.NotCod,Not.UsrCod,Not.NumShared, + TmlUsr_SHOW_ALL_USRS); } /*****************************************************************************/ @@ -96,8 +96,8 @@ void TmlSha_ShaNoteGbl (void) /***** Write HTML inside DIV with form to unshare *****/ TmlUsr_PutIconFavSha (TmlUsr_SHA_UNS_NOTE, - Not.NotCod,Not.UsrCod,Not.NumShared, - TmlUsr_SHOW_FEW_USRS); + Not.NotCod,Not.UsrCod,Not.NumShared, + TmlUsr_SHOW_FEW_USRS); } static void TmlSha_ShaNote (struct TmlNot_Note *Not) @@ -155,8 +155,8 @@ void TmlSha_UnsNoteGbl (void) /***** Write HTML inside DIV with form to share *****/ TmlUsr_PutIconFavSha (TmlUsr_SHA_UNS_NOTE, - Not.NotCod,Not.UsrCod,Not.NumShared, - TmlUsr_SHOW_FEW_USRS); + Not.NotCod,Not.UsrCod,Not.NumShared, + TmlUsr_SHOW_FEW_USRS); } static void TmlSha_UnsNote (struct TmlNot_Note *Not) diff --git a/swad_timeline_user.c b/swad_timeline_user.c index 42472337..b221cab8 100644 --- a/swad_timeline_user.c +++ b/swad_timeline_user.c @@ -117,8 +117,8 @@ void TmlUsr_RemoveUsrContent (long UsrCod) /*****************************************************************************/ static void TmlUsr_GetAndShowSharersOrFavers (TmlUsr_FavSha_t FavSha, - long Cod,long UsrCod,unsigned NumUsrs, - TmlUsr_HowManyUsrs_t HowManyUsrs) + long Cod,long UsrCod,unsigned NumUsrs, + TmlUsr_HowManyUsrs_t HowManyUsrs) { static const TmlFrm_Action_t Action[TmlUsr_NUM_FAV_SHA] = { @@ -132,6 +132,14 @@ static void TmlUsr_GetAndShowSharersOrFavers (TmlUsr_FavSha_t FavSha, [TmlUsr_FAV_UNF_COMM] = "PubCod=%ld", [TmlUsr_SHA_UNS_NOTE] = "NotCod=%ld", }; + struct Tml_Form Form = + { + .Action = Action[FavSha], + .ParamFormat = ParamFormat[FavSha], + .ParamCod = Cod, + .Icon = "ellipsis-h.svg", + .Color = Ico_BLACK, + }; MYSQL_RES *mysql_res; unsigned NumFirstUsrs; @@ -140,7 +148,7 @@ static void TmlUsr_GetAndShowSharersOrFavers (TmlUsr_FavSha_t FavSha, NumFirstUsrs = TmlUsr_GetListFaversOrSharers (FavSha,Cod,UsrCod, HowManyUsrs == TmlUsr_SHOW_FEW_USRS ? TmlUsr_DEF_USRS_SHOWN : - TmlUsr_MAX_USRS_SHOWN, + TmlUsr_MAX_USRS_SHOWN, &mysql_res); else NumFirstUsrs = 0; @@ -156,9 +164,7 @@ static void TmlUsr_GetAndShowSharersOrFavers (TmlUsr_FavSha_t FavSha, TmlUsr_ListSharersOrFavers (&mysql_res,NumUsrs,NumFirstUsrs); if (NumFirstUsrs < NumUsrs) // Not all are shown /* Clickable ellipsis to show all users */ - TmlFrm_PutFormToSeeAllFaversSharers (Action[FavSha], - ParamFormat[FavSha],Cod, - HowManyUsrs); + TmlFrm_FormFavSha (&Form); HTM_DIV_End (); /***** Free structure that stores the query result *****/