diff --git a/css/swad15.131.2.css b/css/swad15.131.2.css index 011bc052..d675ddb3 100644 --- a/css/swad15.131.2.css +++ b/css/swad15.131.2.css @@ -2100,6 +2100,26 @@ a:hover img.CENTRE_PHOTO_SHOW font-size:30pt; font-weight:bold; } +.FOLLOW_USR_PHOTO + { + box-sizing:border-box; + width:72px; + height:90px; + text-align:left; + vertical-align:bottom; + } +.FOLLOW_USR_NAME + { + box-sizing:border-box; + min-width:106px; + height:90px; + text-align:left; + vertical-align:bottom; + } +.FOLLOW_USR_ICON + { + padding:4px; + } .CON {color:#B8D070; font-size:11pt; line-height:110%; white-space:nowrap;} .CON_CRS {color:#398000; font-size:11pt; line-height:110%; white-space:nowrap;} diff --git a/icon/usr64x64.gif b/icon/usr64x64.gif index e6f96207..85442a18 100644 Binary files a/icon/usr64x64.gif and b/icon/usr64x64.gif differ diff --git a/swad_changelog.h b/swad_changelog.h index 3e4a9a0d..35f69bc8 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -121,13 +121,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.133.7 (2016-01-28)" +#define Log_PLATFORM_VERSION "SWAD 15.133.8 (2016-01-29)" #define CSS_FILE "swad15.131.2.css" #define JS_FILE "swad15.131.3.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.133.8: Jan 29, 2016 Link to request a user's profile. (195328 lines) Version 15.133.7: Jan 28, 2016 Changes in layout of followed/followers. (195288 lines) Version 15.133.6: Jan 28, 2016 Changes in layout of "Who to follow". (195287 lines) Version 15.133.5: Jan 28, 2016 Unlogged users can not view "Who to follow". (195276 lines) diff --git a/swad_follow.c b/swad_follow.c index ed85b43f..ede7d1ad 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -105,6 +105,9 @@ void Fol_SuggestWhoToFollow (void) unsigned NumUsr; struct UsrData UsrDat; + /***** Put link to request user's profile *****/ + Prf_PutLinkRequestUserProfile (); + /***** First try: build query to get users to follow *****/ sprintf (Query,"SELECT DISTINCT UsrCod FROM" " (" @@ -206,7 +209,7 @@ void Fol_SuggestWhoToFollow (void) if (NumUsrs) { /***** Start frame *****/ - Lay_StartRoundFrame (NULL,Txt_Who_to_follow); + Lay_StartRoundFrame ("560px",Txt_Who_to_follow); /***** Put form to update connected users *****/ fprintf (Gbl.F.Out,"
");
- if (Visible &&
- Gbl.Usrs.Me.Logged &&
- 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_Following_unfollow,NULL);
- fprintf (Gbl.F.Out," "
- ""
- " "
- "",
- Gbl.Prefs.IconsURL,
- Txt_Unfollow,Txt_Following_unfollow);
- Act_FormEnd ();
- }
- else // I do not follow this user
- {
- Act_FormStart (ActFolUsr);
- Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
- Act_LinkFormSubmit (Txt_Follow,NULL);
- fprintf (Gbl.F.Out,""
- ""
- " "
- "",
- Gbl.Prefs.IconsURL,
- Txt_Follow,Txt_Follow);
- Act_FormEnd ();
- }
- }
- fprintf (Gbl.F.Out," | ");
-
/***** Check if I can see the public profile *****/
- fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out," | "); if (Visible) { /***** User's photo *****/ @@ -680,21 +642,67 @@ static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat) NULL, "PHOTO60x80",Pho_ZOOM,false); } - fprintf (Gbl.F.Out," | "); + fprintf (Gbl.F.Out,"" + ""); /***** Put form to go to public profile *****/ - fprintf (Gbl.F.Out," | ");
if (Visible &&
UsrDat->Nickname[0])
{
Act_FormStart (ActSeePubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"DAT");
- Usr_RestrictLengthAndWriteName (UsrDat,8);
+ Usr_RestrictLengthAndWriteName (UsrDat,10);
fprintf (Gbl.F.Out,"");
Act_FormEnd ();
}
+
+ /***** Put form to follow / unfollow *****/
+ if (Visible && Gbl.Usrs.Me.Logged)
+ {
+ if (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod)
+ fprintf (Gbl.F.Out," "
+ ""
+ " "
+ "",
+ Gbl.Prefs.IconsURL);
+ else
+ {
+ if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) // I follow user
+ {
+ Act_FormStart (ActUnfUsr);
+ Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
+ Act_LinkFormSubmit (Txt_Following_unfollow,NULL);
+ fprintf (Gbl.F.Out,""
+ ""
+ " "
+ "",
+ Gbl.Prefs.IconsURL,
+ Txt_Unfollow,Txt_Following_unfollow);
+ Act_FormEnd ();
+ }
+ else // I do not follow this user
+ {
+ Act_FormStart (ActFolUsr);
+ Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
+ Act_LinkFormSubmit (Txt_Follow,NULL);
+ fprintf (Gbl.F.Out,""
+ ""
+ " "
+ "",
+ Gbl.Prefs.IconsURL,
+ Txt_Follow,Txt_Follow);
+ Act_FormEnd ();
+ }
+ }
+ }
+
fprintf (Gbl.F.Out," | ");
}
diff --git a/swad_profile.c b/swad_profile.c
index b3b38f7b..cfb1536f 100644
--- a/swad_profile.c
+++ b/swad_profile.c
@@ -121,6 +121,21 @@ char *Prf_GetURLPublicProfile (char *URL,const char *NicknameWithoutArroba)
return URL;
}
+/*****************************************************************************/
+/******************* Put link to request a user's profile ********************/
+/*****************************************************************************/
+
+void Prf_PutLinkRequestUserProfile (void)
+ {
+ extern const char *Txt_View_public_profile;
+
+ fprintf (Gbl.F.Out,"