From cb1332d31566014ae349625526ca166235d2d851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 29 Jan 2016 00:41:52 +0100 Subject: [PATCH] Version 15.133.8 --- css/swad15.131.2.css | 20 ++++++++ icon/usr64x64.gif | Bin 578 -> 371 bytes swad_changelog.h | 3 +- swad_follow.c | 108 +++++++++++++++++++++++-------------------- swad_profile.c | 15 ++++++ swad_profile.h | 1 + 6 files changed, 96 insertions(+), 51 deletions(-) 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 e6f962072a3032b0712d96c560bc8a57d7bf2a9d..85442a18844b8d403fcd111992228eedbbbe78cc 100644 GIT binary patch delta 344 zcmV-e0jK`L1oHwqM@dFFIblEmKmfA<06;)MOG`^qQc_!6TVrEmYHDh9baZ=rdxC<3 zii(Pnk&&93nxmtmt*x!Hva*pnCV!r2s;+G7zA(oa0RRNW5|@bW|A4|SR0A3Tj3LKy zYyuQYjnkQoT8h)7wUWp>g2R8*(FL^&Y6Mr*#IJ23X z0k0|yPJqPkP~i`T4(E&r7}1Z2dlh}?3z6{$ qJQ5-NGX5J;uwsA|Aq^5>kriN>y8*;J$(%{Erp=o;bLxB%0RTJ1=8Fmd delta 552 zcmV+@0@wZX0>T73M@dFFIblEmKmfA<06;)MN=iynQc_%8Tx4WqYinzCbaZ-pdV+$2 zi;IhslarjBoTQ|rs;a8CwziQvCVzT}004t>Ug_GB$7Ro;3Tglj5|UV2c?^{+5{^fZ8U#~Go+|Y0eKb+H?A10w8$9_fi{;FM*;{94h{?{n9BfV4+9C} zwmff>vW!}dr_hzB8Rey=k$wx1(sCtlP%*>cf?kV!*t0e`8Qwl)qSBap61teQh z=rqNpg`HOJU2p*Oh=q(oY&~F5KukrNf&keuK+vENqrs}$Y7oyx0HX`&q{2gi"); @@ -221,7 +224,7 @@ void Fol_SuggestWhoToFollow (void) /***** Start listing *****/ fprintf (Gbl.F.Out,""); + " style=\"margin:0 auto;\">"); for (NumUsr = 0; NumUsr < NumUsrs; @@ -494,7 +497,7 @@ void Fol_ListFollowing (void) Usr_UsrDataConstructor (&UsrDat); /***** Start listing *****/ - Lay_StartRoundFrameTable (NULL,2,Txt_Following); + Lay_StartRoundFrameTable ("560px",2,Txt_Following); for (NumUsr = 0; NumUsr < NumUsrs; @@ -570,7 +573,7 @@ void Fol_ListFollowers (void) Usr_UsrDataConstructor (&UsrDat); /***** Start listing *****/ - Lay_StartRoundFrameTable (NULL,2,Txt_Followers); + Lay_StartRoundFrameTable ("560px",2,Txt_Followers); for (NumUsr = 0; NumUsr < NumUsrs; @@ -629,49 +632,8 @@ static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat) char PhotoURL[PATH_MAX+1]; bool Visible = Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod); - /***** Put form to follow / unfollow *****/ - fprintf (Gbl.F.Out,""); - /***** Check if I can see the public profile *****/ - fprintf (Gbl.F.Out,""); + 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,"
"); + Lay_PutContextualLink (ActReqPubPrf,NULL, + "usr64x64.gif", + Txt_View_public_profile,Txt_View_public_profile); + fprintf (Gbl.F.Out,"
"); + } + /*****************************************************************************/ /************************** Request a user's profile *************************/ /*****************************************************************************/ diff --git a/swad_profile.h b/swad_profile.h index 68248c1d..bfdab988 100644 --- a/swad_profile.h +++ b/swad_profile.h @@ -40,6 +40,7 @@ /*****************************************************************************/ char *Prf_GetURLPublicProfile (char *URL,const char *NicknameWithoutArroba); +void Prf_PutLinkRequestUserProfile (void); void Prf_RequestUserProfile (void); void Prf_GetUsrDatAndShowUserProfile (void);
"); - 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,"
" - "\"%s\"" - "
" - "", - 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,"
" - "\"%s\"" - "
" - "", - Gbl.Prefs.IconsURL, - Txt_Follow,Txt_Follow); - Act_FormEnd (); - } - } - 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,""); /***** 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,"
" + "\"%s\"" + "
" + "", + 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,"
" + "\"%s\"" + "
" + "", + Gbl.Prefs.IconsURL, + Txt_Follow,Txt_Follow); + Act_FormEnd (); + } + } + } + fprintf (Gbl.F.Out,"