diff --git a/css/swad15.79.css b/css/swad15.80.css similarity index 99% rename from css/swad15.79.css rename to css/swad15.80.css index 02c1b885..36a47e26 100644 --- a/css/swad15.79.css +++ b/css/swad15.80.css @@ -1359,7 +1359,7 @@ a:hover img.CENTRE_PHOTO_SHOW left:-300px; top:-400px; padding:6px; - background-color:rgba(255,255,255,0.8); + background-color:rgba(255,255,255,0.95); border-width:1px; border-style:solid; border-color:#C0C0C0; @@ -1855,27 +1855,49 @@ a:hover img.CENTRE_PHOTO_SHOW opacity:0.67; } -#num_following +#following_side { display:inline-block; box-sizing:border-box; width:50%; padding-right:10px; - text-align:right; } -#num_followers +#followers_side { display:inline-block; box-sizing:border-box; width:50%; padding-left:10px; - text-align:left; } -.FOLLOW +.FOLLOW_SIDE { - display:inline-block; - min-width:125px; + display:table; + box-sizing:border-box; + width:100%; + } +#follows_me + { + display:table-cell; + box-sizing:border-box; + padding-right:20px; + text-align:right; + vertical-align:middle; + } +#follow_usr + { + display:table-cell; + height:60px; + box-sizing:border-box; + padding-left:20px; + text-align:left; + vertical-align:middle; + } +.FOLLOW_BOX + { + display:table-cell; + width:140px; text-align:center; + vertical-align:middle; } .FOLLOW_NUM { diff --git a/icon/follow64x64.png b/icon/follow64x64.png new file mode 100644 index 00000000..b35d7350 Binary files /dev/null and b/icon/follow64x64.png differ diff --git a/icon/following64x64.png b/icon/following64x64.png new file mode 100644 index 00000000..d7996e4c Binary files /dev/null and b/icon/following64x64.png differ diff --git a/icon/unfollow320x320.png b/icon/unfollow320x320.png index d8990c52..266121d7 100644 Binary files a/icon/unfollow320x320.png and b/icon/unfollow320x320.png differ diff --git a/swad_changelog.h b/swad_changelog.h index 93f4f0a6..01a2be5b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -115,13 +115,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.79.2 (2015-12-29)" -#define CSS_FILE "swad15.79.css" +#define Log_PLATFORM_VERSION "SWAD 15.80 (2015-12-29)" +#define CSS_FILE "swad15.80.css" #define JS_FILE "swad15.77.7.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 15.80: Dec 29, 2015 Changes in layout of user's profile. (188944 lines) Version 15.79.2: Dec 29, 2015 Include my public activity in timeline. (188838 lines) Version 15.79.1: Dec 29, 2015 Changes in layout of user's profile. (188836 lines) Version 15.79: Dec 29, 2015 Show timeline of a selected user. diff --git a/swad_follow.c b/swad_follow.c index d6d822b3..400b9bd1 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -121,28 +121,90 @@ unsigned Fol_GetNumFollowers (long UsrCod) /*****************************************************************************/ void Fol_ShowFollowingAndFollowers (const struct UsrData *UsrDat, - unsigned NumFollowing,unsigned NumFollowers) + unsigned NumFollowing,unsigned NumFollowers, + bool UsrFollowsMe,bool IFollowUsr) { extern const char *Txt_Following; extern const char *Txt_Followers; + extern const char *Txt_Following_unfollow; + extern const char *Txt_Unfollow; + extern const char *Txt_Follow; + bool ItsMe = (UsrDat->UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod); /***** Start section *****/ fprintf (Gbl.F.Out,"
"); /***** Followed users *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
" + "
"); + + /* User follows me? */ + fprintf (Gbl.F.Out,"
"); + if (UsrFollowsMe) + fprintf (Gbl.F.Out,"TE SIGUE"); // Need translation!!!! + fprintf (Gbl.F.Out,"
"); + + /* Number of followed */ Fol_ShowNumberOfFollowingOrFollowers (UsrDat, NumFollowing, ActSeeFlg,Txt_Following); - fprintf (Gbl.F.Out,"
"); + + /* End following side */ + fprintf (Gbl.F.Out,"
" + "
"); /***** Followers *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
" + "
"); + + /* Number of followers */ Fol_ShowNumberOfFollowingOrFollowers (UsrDat, NumFollowers, ActSeeFlr,Txt_Followers); + + /* I follow user? */ + fprintf (Gbl.F.Out,"
"); + if (!ItsMe) + { + if (IFollowUsr) + { + Act_FormStart (ActUnfUsr); + Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Act_LinkFormSubmit (Txt_Following_unfollow,"REC_DAT_BOLD"); + fprintf (Gbl.F.Out,"
" + "\"%s\"" + "
" + "", + Gbl.Prefs.IconsURL, + Txt_Unfollow,Txt_Following_unfollow); + Act_FormEnd (); + } + else // I do not follow user + { + Act_FormStart (ActFolUsr); + Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Act_LinkFormSubmit (Txt_Follow,"REC_DAT_BOLD"); + fprintf (Gbl.F.Out,"
" + "\"%s\"" + "
" + "", + Gbl.Prefs.IconsURL, + Txt_Follow,Txt_Follow); + Act_FormEnd (); + } + } fprintf (Gbl.F.Out,"
"); + /* End followers side */ + fprintf (Gbl.F.Out,"
" + "
"); + /***** End section *****/ fprintf (Gbl.F.Out,"
"); } @@ -160,7 +222,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat, extern const char *The_ClassFormBold[The_NUM_THEMES]; /***** Start container *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); /***** Number *****/ if (NumUsrs) @@ -369,6 +431,7 @@ void Fol_ListFollowers (void) static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat) { extern const char *Txt_View_public_profile; + extern const char *Txt_Following_unfollow; extern const char *Txt_Unfollow; extern const char *Txt_Follow; bool ShowPhoto; @@ -382,28 +445,28 @@ static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat) Gbl.Usrs.Me.Logged && Gbl.Usrs.Me.UsrDat.UsrCod != UsrDat->UsrCod) { - if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) + if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) // I follow user { Act_FormStart (ActUnfUsr); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmit (Txt_Unfollow,NULL); + Act_LinkFormSubmit (Txt_Following_unfollow,NULL); fprintf (Gbl.F.Out,"
" - "\"%s\"" "
" "", Gbl.Prefs.IconsURL, - Txt_Unfollow,Txt_Unfollow); + Txt_Unfollow,Txt_Following_unfollow); Act_FormEnd (); } - else + else // I do not follow this user { Act_FormStart (ActFolUsr); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_Follow,NULL); fprintf (Gbl.F.Out,"
" - "\"%s\"" "
" diff --git a/swad_follow.h b/swad_follow.h index 60787d2c..4f894fd2 100644 --- a/swad_follow.h +++ b/swad_follow.h @@ -47,7 +47,8 @@ bool Fol_CheckUsrIsFollowerOf (long FollowerCod,long FollowedCod); unsigned Fol_GetNumFollowing (long UsrCod); unsigned Fol_GetNumFollowers (long UsrCod); void Fol_ShowFollowingAndFollowers (const struct UsrData *UsrDat, - unsigned NumFollowing,unsigned NumFollowers); + unsigned NumFollowing,unsigned NumFollowers, + bool UsrFollowsMe,bool IFollowUsr); void Fol_ListFollowing (void); void Fol_ListFollowers (void); diff --git a/swad_notification.c b/swad_notification.c index 9b56688a..14208580 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -213,7 +213,7 @@ static const char *Ntf_Icons[Ntf_NUM_NOTIFY_EVENTS] = "survey16x16.gif", // Ntf_EVENT_SURVEY /* Profile tab */ - "follow64x64.gif", // Ntf_EVENT_FOLLOWER + "follow64x64.png", // Ntf_EVENT_FOLLOWER }; /*****************************************************************************/ diff --git a/swad_profile.c b/swad_profile.c index 0ba2c838..c8da5f54 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -220,6 +220,8 @@ bool Prf_ShowUserProfile (void) { unsigned NumFollowing; unsigned NumFollowers; + bool UsrFollowsMe; + bool IFollowUsr; /***** Check if I can see the public profile *****/ if (Pri_ShowIsAllowed (Gbl.Usrs.Other.UsrDat.ProfileVisibility, @@ -242,11 +244,22 @@ bool Prf_ShowUserProfile (void) /***** Show details of user's profile *****/ Prf_ShowDetailsUserProfile (&Gbl.Usrs.Other.UsrDat); - /***** Show following and followers *****/ + /***** Count following and followers *****/ NumFollowing = Fol_GetNumFollowing (Gbl.Usrs.Other.UsrDat.UsrCod); NumFollowers = Fol_GetNumFollowers (Gbl.Usrs.Other.UsrDat.UsrCod); + UsrFollowsMe = false; + if (NumFollowing) + UsrFollowsMe = Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Other.UsrDat.UsrCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + IFollowUsr = false; + if (NumFollowers) + IFollowUsr = Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod, + Gbl.Usrs.Other.UsrDat.UsrCod); + + /***** Show following and followers *****/ Fol_ShowFollowingAndFollowers (&Gbl.Usrs.Other.UsrDat, - NumFollowing,NumFollowers); + NumFollowing,NumFollowers, + UsrFollowsMe,IFollowUsr); return true; } diff --git a/swad_record.c b/swad_record.c index 6d18bb02..25a2d362 100644 --- a/swad_record.c +++ b/swad_record.c @@ -1956,6 +1956,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, extern const char *Txt_View_works; extern const char *Txt_See_exams; extern const char *Txt_Attendance; + extern const char *Txt_Following_unfollow; extern const char *Txt_Unfollow; extern const char *Txt_Follow; extern const char *Txt_View_public_profile; @@ -2164,8 +2165,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "
" "", Gbl.Prefs.IconsURL, - Txt_Edit, - Txt_Edit); + Txt_Edit,Txt_Edit); Act_FormEnd (); } @@ -2215,8 +2215,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "
" "", Gbl.Prefs.IconsURL, - Txt_Admin_user, - Txt_Admin_user); + Txt_Admin_user,Txt_Admin_user); Act_FormEnd (); } @@ -2243,8 +2242,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "" "", Gbl.Prefs.IconsURL, - Txt_View_works, - Txt_View_works); + Txt_View_works,Txt_View_works); Act_FormEnd (); /***** Button to view user's test exams *****/ @@ -2265,8 +2263,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "" "", Gbl.Prefs.IconsURL, - Txt_See_exams, - Txt_See_exams); + Txt_See_exams,Txt_See_exams); Act_FormEnd (); /***** Button to view user's attendance *****/ @@ -2293,8 +2290,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "" "", Gbl.Prefs.IconsURL, - Txt_Attendance, - Txt_Attendance); + Txt_Attendance,Txt_Attendance); Act_FormEnd (); } } @@ -2313,46 +2309,43 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "" "", Gbl.Prefs.IconsURL, - Txt_Write_a_message, - Txt_Write_a_message); + Txt_Write_a_message,Txt_Write_a_message); Act_FormEnd (); /***** Button to follow / unfollow *****/ if (TypeOfView == Rec_RECORD_PUBLIC && !ItsMe) { - if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) + if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) // I follow user { Act_FormStart (ActUnfUsr); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmit (Txt_Unfollow,"REC_DAT_BOLD"); + Act_LinkFormSubmit (Txt_Following_unfollow,"REC_DAT_BOLD"); fprintf (Gbl.F.Out,"
" - "\"%s\"" "
" "", Gbl.Prefs.IconsURL, - Txt_Unfollow, - Txt_Unfollow); + Txt_Unfollow,Txt_Following_unfollow); Act_FormEnd (); } - else + else // I do not follow user { Act_FormStart (ActFolUsr); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_Follow,"REC_DAT_BOLD"); fprintf (Gbl.F.Out,"
" - "\"%s\"" "
" "", Gbl.Prefs.IconsURL, - Txt_Follow, - Txt_Follow); + Txt_Follow,Txt_Follow); Act_FormEnd (); } } diff --git a/swad_text.c b/swad_text.c index 03cef583..0ca92be7 100644 --- a/swad_text.c +++ b/swad_text.c @@ -12045,6 +12045,27 @@ const char *Txt_Following = "Seguinte"; #endif +const char *Txt_Following_unfollow = +#if L==1 + "Següent, deixar de seguir"; +#elif L==2 + "Folgende, entfolgen"; +#elif L==3 + "Following, unfollow"; +#elif L==4 + "Siguiendo, dejar de seguir"; +#elif L==5 + "Suivant, se désabonner"; +#elif L==6 + "Siguiendo, dejar de seguir"; // Okoteve traducción +#elif L==7 + "Following, smetti"; +#elif L==8 + "Następujący, nie obserwuj"; +#elif L==9 + "Seguinte, deixar de seguir"; +#endif + const char *Txt_For_security_enter_your_password = #if L==1 "Per a més seguretat, introdueixi la seva contrasenya";