mirror of https://github.com/acanas/swad-core.git
Version 23.52.5: Dec 13, 2023 Responsive design in follow.
This commit is contained in:
parent
1b3d7edc3a
commit
4609ebaabf
|
@ -5145,32 +5145,38 @@ button.PAG_DARK:hover, .PAG_CUR_DARK {background-color:#707070;}
|
||||||
font-size:30pt;
|
font-size:30pt;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
|
.FOLLOW_USR
|
||||||
|
{
|
||||||
|
display:inline-block;
|
||||||
|
}
|
||||||
.FOLLOW_PHOTO
|
.FOLLOW_PHOTO
|
||||||
{
|
{
|
||||||
|
display:inline-block;
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:72px;
|
width:72px;
|
||||||
height:90px;
|
height:90px;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
vertical-align:bottom;
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
.FOLLOW_USR
|
.FOLLOW_TXT
|
||||||
{
|
{
|
||||||
|
display:inline-block;
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:100px;
|
width:100px;
|
||||||
height:90px;
|
height:80px;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
.FOLLOW_USR_NAME
|
.FOLLOW_TXT_NAME
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
max-width:100px;
|
max-width:90px;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
vertical-align:bottom;
|
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
}
|
}
|
||||||
.FOLLOW_USR_ICO
|
.FOLLOW_TXT_ICO
|
||||||
{
|
{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
padding:4px;
|
padding:4px;
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
||||||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 23.52.4 (2023-12-13)"
|
#define Log_PLATFORM_VERSION "SWAD 23.52.5 (2023-12-13)"
|
||||||
#define CSS_FILE "swad23.52.4.css"
|
#define CSS_FILE "swad23.52.5.css"
|
||||||
#define JS_FILE "swad23.52.js"
|
#define JS_FILE "swad23.52.js"
|
||||||
/*
|
/*
|
||||||
|
Version 23.52.5: Dec 13, 2023 Responsive design in follow. (335814 lines)
|
||||||
Version 23.52.4: Dec 13, 2023 Responsive design in hierarchy configuration and connected users. (335821 lines)
|
Version 23.52.4: Dec 13, 2023 Responsive design in hierarchy configuration and connected users. (335821 lines)
|
||||||
Version 23.52.3: Dec 08, 2023 Responsive design in figures. (335825 lines)
|
Version 23.52.3: Dec 08, 2023 Responsive design in figures. (335825 lines)
|
||||||
Version 23.52.2: Dec 07, 2023 Responsive design in account. (335811 lines)
|
Version 23.52.2: Dec 07, 2023 Responsive design in account. (335811 lines)
|
||||||
|
|
139
swad_follow.c
139
swad_follow.c
|
@ -135,10 +135,10 @@ void Fol_SuggestUsrsToFollowOnMainZone (void)
|
||||||
Fol_SUGGEST_ANY_USER,
|
Fol_SUGGEST_ANY_USER,
|
||||||
&mysql_res)))
|
&mysql_res)))
|
||||||
{
|
{
|
||||||
/***** Begin box and table *****/
|
/***** Begin box *****/
|
||||||
Box_BoxTableBegin ("560px",Txt_Who_to_follow,
|
Box_BoxBegin (NULL,Txt_Who_to_follow,
|
||||||
Fol_PutIconsWhoToFollow,NULL,
|
Fol_PutIconsWhoToFollow,NULL,
|
||||||
Hlp_START_Profiles_who_to_follow,Box_NOT_CLOSABLE,2);
|
Hlp_START_Profiles_who_to_follow,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Initialize structure with user's data *****/
|
/***** Initialize structure with user's data *****/
|
||||||
Usr_UsrDataConstructor (&UsrDat);
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
@ -150,27 +150,20 @@ void Fol_SuggestUsrsToFollowOnMainZone (void)
|
||||||
{
|
{
|
||||||
/***** Get user *****/
|
/***** Get user *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get user's code (row[0]) */
|
|
||||||
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
/***** Show user *****/
|
/***** Show user *****/
|
||||||
if ((NumUsr % Fol_NUM_COLUMNS_FOLLOW) == 0)
|
|
||||||
HTM_TR_Begin (NULL);
|
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_DONT_GET_ROLE_IN_CRS))
|
Usr_DONT_GET_ROLE_IN_CRS))
|
||||||
Fol_ShowFollowedOrFollower (&UsrDat);
|
Fol_ShowFollowedOrFollower (&UsrDat);
|
||||||
if ((NumUsr % Fol_NUM_COLUMNS_FOLLOW) == (Fol_NUM_COLUMNS_FOLLOW-1) ||
|
|
||||||
NumUsr == NumUsrs - 1)
|
|
||||||
HTM_TR_End ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** End table and box *****/
|
/***** End box *****/
|
||||||
Box_BoxTableEnd ();
|
Box_BoxEnd ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Ale_ShowAlert (Ale_INFO,Txt_No_user_to_whom_you_can_follow_Try_again_later);
|
Ale_ShowAlert (Ale_INFO,Txt_No_user_to_whom_you_can_follow_Try_again_later);
|
||||||
|
@ -461,10 +454,10 @@ static void Fol_ListFollowingUsr (struct Usr_Data *UsrDat)
|
||||||
/***** Initialize structure with user's data *****/
|
/***** Initialize structure with user's data *****/
|
||||||
Usr_UsrDataConstructor (&FollowingUsrDat);
|
Usr_UsrDataConstructor (&FollowingUsrDat);
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box *****/
|
||||||
Box_BoxTableBegin ("560px",Txt_Following,
|
Box_BoxBegin (NULL,Txt_Following,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
NULL,Box_NOT_CLOSABLE,2);
|
NULL,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
for (NumUsr = 0;
|
for (NumUsr = 0;
|
||||||
NumUsr < NumUsrs;
|
NumUsr < NumUsrs;
|
||||||
|
@ -474,19 +467,14 @@ static void Fol_ListFollowingUsr (struct Usr_Data *UsrDat)
|
||||||
FollowingUsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
FollowingUsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
||||||
|
|
||||||
/***** Show user *****/
|
/***** Show user *****/
|
||||||
if ((NumUsr % Fol_NUM_COLUMNS_FOLLOW) == 0)
|
|
||||||
HTM_TR_Begin (NULL);
|
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&FollowingUsrDat,
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&FollowingUsrDat,
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_DONT_GET_ROLE_IN_CRS))
|
Usr_DONT_GET_ROLE_IN_CRS))
|
||||||
Fol_ShowFollowedOrFollower (&FollowingUsrDat);
|
Fol_ShowFollowedOrFollower (&FollowingUsrDat);
|
||||||
if ((NumUsr % Fol_NUM_COLUMNS_FOLLOW) == (Fol_NUM_COLUMNS_FOLLOW-1) ||
|
|
||||||
NumUsr == NumUsrs - 1)
|
|
||||||
HTM_TR_End ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End table and box *****/
|
/***** End box *****/
|
||||||
Box_BoxTableEnd ();
|
Box_BoxEnd ();
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
Usr_UsrDataDestructor (&FollowingUsrDat);
|
Usr_UsrDataDestructor (&FollowingUsrDat);
|
||||||
|
@ -539,9 +527,9 @@ static void Fol_ListFollowersUsr (struct Usr_Data *UsrDat)
|
||||||
Usr_UsrDataConstructor (&FollowerUsrDat);
|
Usr_UsrDataConstructor (&FollowerUsrDat);
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
Box_BoxTableBegin ("560px",Txt_Followers,
|
Box_BoxBegin (NULL,Txt_Followers,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
NULL,Box_NOT_CLOSABLE,2);
|
NULL,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
for (NumUsr = 0;
|
for (NumUsr = 0;
|
||||||
NumUsr < NumUsrs;
|
NumUsr < NumUsrs;
|
||||||
|
@ -551,21 +539,14 @@ static void Fol_ListFollowersUsr (struct Usr_Data *UsrDat)
|
||||||
FollowerUsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
FollowerUsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
||||||
|
|
||||||
/***** Show user *****/
|
/***** Show user *****/
|
||||||
if ((NumUsr % Fol_NUM_COLUMNS_FOLLOW) == 0)
|
|
||||||
HTM_TR_Begin (NULL);
|
|
||||||
|
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&FollowerUsrDat,
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&FollowerUsrDat,
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_DONT_GET_ROLE_IN_CRS))
|
Usr_DONT_GET_ROLE_IN_CRS))
|
||||||
Fol_ShowFollowedOrFollower (&FollowerUsrDat);
|
Fol_ShowFollowedOrFollower (&FollowerUsrDat);
|
||||||
|
|
||||||
if ((NumUsr % Fol_NUM_COLUMNS_FOLLOW) == (Fol_NUM_COLUMNS_FOLLOW-1) ||
|
|
||||||
NumUsr == NumUsrs - 1)
|
|
||||||
HTM_TR_End ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End table and box *****/
|
/***** End box *****/
|
||||||
Box_BoxTableEnd ();
|
Box_BoxEnd ();
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
Usr_UsrDataDestructor (&FollowerUsrDat);
|
Usr_UsrDataDestructor (&FollowerUsrDat);
|
||||||
|
@ -598,48 +579,52 @@ static void Fol_ShowFollowedOrFollower (struct Usr_Data *UsrDat)
|
||||||
};
|
};
|
||||||
bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat);
|
bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat);
|
||||||
|
|
||||||
/***** Show user's photo *****/
|
HTM_DIV_Begin ("class=\"FOLLOW_USR\"");
|
||||||
HTM_TD_Begin ("class=\"FOLLOW_PHOTO\"");
|
|
||||||
if (Visible)
|
|
||||||
Pho_ShowUsrPhotoIfAllowed (UsrDat,
|
|
||||||
ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM);
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
/***** Show user's name and icon to follow/unfollow *****/
|
/***** Show user's photo *****/
|
||||||
HTM_TD_Begin ("class=\"FOLLOW_USR\"");
|
HTM_DIV_Begin ("class=\"FOLLOW_PHOTO\"");
|
||||||
|
if (Visible)
|
||||||
|
Pho_ShowUsrPhotoIfAllowed (UsrDat,
|
||||||
|
ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM);
|
||||||
|
HTM_DIV_End ();
|
||||||
|
|
||||||
if (Visible)
|
/***** Show user's name and icon to follow/unfollow *****/
|
||||||
{
|
HTM_DIV_Begin ("class=\"FOLLOW_TXT\"");
|
||||||
/* Put form to go to public profile */
|
|
||||||
Frm_BeginForm (ActSeeOthPubPrf);
|
|
||||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
|
||||||
HTM_DIV_Begin ("class=\"LT FOLLOW_USR_NAME DAT_%s\"", // Limited width
|
|
||||||
The_GetSuffix ());
|
|
||||||
HTM_BUTTON_Submit_Begin (Txt_Another_user_s_profile,
|
|
||||||
"class=\"BT_LINK LT\"");
|
|
||||||
Usr_WriteFirstNameBRSurnames (UsrDat);
|
|
||||||
HTM_BUTTON_End ();
|
|
||||||
HTM_DIV_End ();
|
|
||||||
Frm_EndForm ();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Gbl.Usrs.Me.Logged || // Not logged
|
if (Visible)
|
||||||
Usr_ItsMe (UsrDat->UsrCod) == Usr_ME) // It's me
|
{
|
||||||
/* Inactive icon to follow/unfollow */
|
/* Put form to go to public profile */
|
||||||
Fol_PutInactiveIconToFollowUnfollow ();
|
Frm_BeginForm (ActSeeOthPubPrf);
|
||||||
else // It's not me
|
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||||
{
|
HTM_DIV_Begin ("class=\"LT FOLLOW_TXT_NAME DAT_%s\"", // Limited width
|
||||||
/* Put form to follow / unfollow */
|
The_GetSuffix ());
|
||||||
if (Fol_DB_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,
|
HTM_BUTTON_Submit_Begin (Txt_Another_user_s_profile,
|
||||||
UsrDat->UsrCod)) // I follow user
|
"class=\"BT_LINK LT\"");
|
||||||
/* Form to unfollow */
|
Usr_WriteFirstNameBRSurnames (UsrDat);
|
||||||
Fol_PutIconToUnfollow (UsrDat->EnUsrCod);
|
HTM_BUTTON_End ();
|
||||||
else if (Visible) // I do not follow this user and I can follow
|
HTM_DIV_End ();
|
||||||
/* Form to follow */
|
Frm_EndForm ();
|
||||||
Fol_PutIconToFollow (UsrDat->EnUsrCod);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
HTM_TD_End ();
|
if (!Gbl.Usrs.Me.Logged || // Not logged
|
||||||
|
Usr_ItsMe (UsrDat->UsrCod) == Usr_ME) // It's me
|
||||||
|
/* Inactive icon to follow/unfollow */
|
||||||
|
Fol_PutInactiveIconToFollowUnfollow ();
|
||||||
|
else // It's not me
|
||||||
|
{
|
||||||
|
/* Put form to follow / unfollow */
|
||||||
|
if (Fol_DB_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
UsrDat->UsrCod)) // I follow user
|
||||||
|
/* Form to unfollow */
|
||||||
|
Fol_PutIconToUnfollow (UsrDat->EnUsrCod);
|
||||||
|
else if (Visible) // I do not follow this user and I can follow
|
||||||
|
/* Form to follow */
|
||||||
|
Fol_PutIconToFollow (UsrDat->EnUsrCod);
|
||||||
|
}
|
||||||
|
|
||||||
|
HTM_DIV_End ();
|
||||||
|
|
||||||
|
HTM_DIV_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -717,7 +702,7 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct Usr_Data *UsrDat)
|
||||||
static void Fol_PutInactiveIconToFollowUnfollow (void)
|
static void Fol_PutInactiveIconToFollowUnfollow (void)
|
||||||
{
|
{
|
||||||
/***** Inactive icon to follow/unfollow *****/
|
/***** Inactive icon to follow/unfollow *****/
|
||||||
HTM_DIV_Begin ("class=\"FOLLOW_USR_ICO ICO_HIDDEN\"");
|
HTM_DIV_Begin ("class=\"FOLLOW_TXT_ICO ICO_HIDDEN\"");
|
||||||
Ico_PutIcon ("user.svg",Ico_BLACK,"","ICO16x16");
|
Ico_PutIcon ("user.svg",Ico_BLACK,"","ICO16x16");
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
}
|
}
|
||||||
|
@ -732,7 +717,7 @@ static void Fol_PutIconToFollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTED_
|
||||||
Usr_PutParUsrCodEncrypted (EncryptedUsrCod);
|
Usr_PutParUsrCodEncrypted (EncryptedUsrCod);
|
||||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user-plus.svg",
|
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user-plus.svg",
|
||||||
Act_GetActionText (ActFolUsr),
|
Act_GetActionText (ActFolUsr),
|
||||||
"class=\"FOLLOW_USR_ICO ICO16x16 ICO_%s_%s ICO_HIGHLIGHT\"",
|
"class=\"FOLLOW_TXT_ICO ICO16x16 ICO_%s_%s ICO_HIGHLIGHT\"",
|
||||||
Ico_GetPreffix (Ico_BLACK),The_GetSuffix ());
|
Ico_GetPreffix (Ico_BLACK),The_GetSuffix ());
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -747,7 +732,7 @@ static void Fol_PutIconToUnfollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTE
|
||||||
Usr_PutParUsrCodEncrypted (EncryptedUsrCod);
|
Usr_PutParUsrCodEncrypted (EncryptedUsrCod);
|
||||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user-check.svg",
|
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user-check.svg",
|
||||||
Act_GetActionText (ActUnfUsr),
|
Act_GetActionText (ActUnfUsr),
|
||||||
"class=\"FOLLOW_USR_ICO ICO_HIGHLIGHT ICO16x16\"");
|
"class=\"FOLLOW_TXT_ICO ICO_HIGHLIGHT ICO16x16\"");
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57463,7 +57463,7 @@ const char *Txt_Who_to_follow =
|
||||||
#elif L==5 // fr
|
#elif L==5 // fr
|
||||||
"Qui à suivre";
|
"Qui à suivre";
|
||||||
#elif L==6 // gn
|
#elif L==6 // gn
|
||||||
"A quién seguir"; // Okoteve traducción
|
"Mávapepa osegíta";
|
||||||
#elif L==7 // it
|
#elif L==7 // it
|
||||||
"Chi da seguire";
|
"Chi da seguire";
|
||||||
#elif L==8 // pl
|
#elif L==8 // pl
|
||||||
|
@ -57471,7 +57471,7 @@ const char *Txt_Who_to_follow =
|
||||||
#elif L==9 // pt
|
#elif L==9 // pt
|
||||||
"Quem seguir";
|
"Quem seguir";
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"Who to follow"; // Çeviri lazim!
|
"Kimi takip etmeli";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *Txt_With_ = // Example: "With students"
|
const char *Txt_With_ = // Example: "With students"
|
||||||
|
|
Loading…
Reference in New Issue