Version 15.80

This commit is contained in:
Antonio Cañas Vargas 2015-12-29 19:40:38 +01:00
parent 9929a4ebb7
commit 7427289570
11 changed files with 160 additions and 46 deletions

View File

@ -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
{

BIN
icon/follow64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
icon/following64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -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.

View File

@ -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,"<section id=\"follow_section\">");
/***** Followed users *****/
fprintf (Gbl.F.Out,"<div id=\"num_following\">");
fprintf (Gbl.F.Out,"<div id=\"following_side\">"
"<div class=\"FOLLOW_SIDE\">");
/* User follows me? */
fprintf (Gbl.F.Out,"<div id=\"follows_me\" class=\"DAT_LIGHT\">");
if (UsrFollowsMe)
fprintf (Gbl.F.Out,"TE SIGUE"); // Need translation!!!!
fprintf (Gbl.F.Out,"</div>");
/* Number of followed */
Fol_ShowNumberOfFollowingOrFollowers (UsrDat,
NumFollowing,
ActSeeFlg,Txt_Following);
fprintf (Gbl.F.Out,"</div>");
/* End following side */
fprintf (Gbl.F.Out,"</div>"
"</div>");
/***** Followers *****/
fprintf (Gbl.F.Out,"<div id=\"num_followers\">");
fprintf (Gbl.F.Out,"<div id=\"followers_side\">"
"<div class=\"FOLLOW_SIDE\">");
/* Number of followers */
Fol_ShowNumberOfFollowingOrFollowers (UsrDat,
NumFollowers,
ActSeeFlr,Txt_Followers);
/* I follow user? */
fprintf (Gbl.F.Out,"<div id=\"follow_usr\">");
if (!ItsMe)
{
if (IFollowUsr)
{
Act_FormStart (ActUnfUsr);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_Following_unfollow,"REC_DAT_BOLD");
fprintf (Gbl.F.Out,"<div class=\"ICON_HIGHLIGHT\""
" style=\"display:inline;\" >"
"<img src=\"%s/following64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON40x40\" />"
"</div>"
"</a>",
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,"<div class=\"ICON_HIGHLIGHT\""
" style=\"display:inline;\" >"
"<img src=\"%s/follow64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON40x40\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Follow,Txt_Follow);
Act_FormEnd ();
}
}
fprintf (Gbl.F.Out,"</div>");
/* End followers side */
fprintf (Gbl.F.Out,"</div>"
"</div>");
/***** End section *****/
fprintf (Gbl.F.Out,"</section>");
}
@ -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,"<div class=\"FOLLOW\">");
fprintf (Gbl.F.Out,"<div class=\"FOLLOW_BOX\">");
/***** 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,"<div class=\"ICON_HIGHLIGHT\">"
"<img src=\"%s/unfollow64x64.gif\""
"<img src=\"%s/following64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>"
"</a>",
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,"<div class=\"ICON_HIGHLIGHT\">"
"<img src=\"%s/follow64x64.gif\""
"<img src=\"%s/follow64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>"

View File

@ -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);

View File

@ -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
};
/*****************************************************************************/

View File

@ -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;
}

View File

@ -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,
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Edit,
Txt_Edit);
Txt_Edit,Txt_Edit);
Act_FormEnd ();
}
@ -2215,8 +2215,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
"</div>"
"</a>",
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,
"</div>"
"</a>",
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,
"</div>"
"</a>",
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,
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Attendance,
Txt_Attendance);
Txt_Attendance,Txt_Attendance);
Act_FormEnd ();
}
}
@ -2313,46 +2309,43 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
"</div>"
"</a>",
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,"<div class=\"ICON_HIGHLIGHT\""
" style=\"display:inline;\" >"
"<img src=\"%s/unfollow64x64.gif\""
"<img src=\"%s/following64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>"
"</a>",
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,"<div class=\"ICON_HIGHLIGHT\""
" style=\"display:inline;\" >"
"<img src=\"%s/follow64x64.gif\""
"<img src=\"%s/follow64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Follow,
Txt_Follow);
Txt_Follow,Txt_Follow);
Act_FormEnd ();
}
}

View File

@ -12045,6 +12045,27 @@ const char *Txt_Following =
"Seguinte";
#endif
const char *Txt_Following_unfollow =
#if L==1
"Seg&uuml;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&eacute;sabonner";
#elif L==6
"Siguiendo, dejar de seguir"; // Okoteve traducción
#elif L==7
"Following, smetti";
#elif L==8
"Nast&eogon;puj&aogon;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&eacute;s seguretat, introdueixi la seva contrasenya";