diff --git a/css/swad_desktop.css b/css/swad_desktop.css index 468a6777..bae80291 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -823,7 +823,7 @@ a:hover img.CENTRE_PHOTO_SHOW .RANK { color:#808080; - font-size:16pt; + font-size:12pt; font-weight:bold; } diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 0f61132b..1525be3d 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -636,7 +636,7 @@ a:hover img.CENTRE_PHOTO_SHOW .RANK { color:#808080; - font-size:20pt; + font-size:18pt; font-weight:bold; } diff --git a/swad_attendance.c b/swad_attendance.c index 7d8166c8..bd7a6aed 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -261,14 +261,15 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt /***** Start date/time *****/ fprintf (Gbl.F.Out,"" \ "Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" : "DATE_RED_LIGHT") : (Att->Open ? "DATE_GREEN" : "DATE_RED")); if (!ShowOnlyThisAttEventComplete) - fprintf (Gbl.F.Out," bgcolor=\"%s\"",Gbl.ColorRows[Gbl.RowEvenOdd]); - fprintf (Gbl.F.Out,">%02u/%02u/%02u
%02u:%02u h", + fprintf (Gbl.F.Out," background-color:%s;", + Gbl.ColorRows[Gbl.RowEvenOdd]); + fprintf (Gbl.F.Out,"\">%02u/%02u/%02u
%02u:%02u h", Att->DateTimes[Att_START_TIME].Date.Day, Att->DateTimes[Att_START_TIME].Date.Month, Att->DateTimes[Att_START_TIME].Date.Year % 100, diff --git a/swad_changelog.h b/swad_changelog.h index e0153fea..8365d03e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.94.3 (2015/03/17)" +#define Log_PLATFORM_VERSION "SWAD 14.94.4 (2015/03/17)" // 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 14.94.4: Mar 17, 2015 Changes in ranking layout. (182679 lines) Version 14.94.3: Mar 17, 2015 Changes in record fonts. (182667 lines) Version 14.94.2: Mar 17, 2015 Fixed bug in ranking. (182668 lines) Version 14.94.1: Mar 17, 2015 Fixed bug in user's profile. (182667 lines) diff --git a/swad_profile.c b/swad_profile.c index 805fae65..a831338d 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -99,7 +99,7 @@ static void Prf_CreateUsrFigures (long UsrCod,const struct UsrFigures *UsrFigure static bool Prf_CheckIfUsrFiguresExists (long UsrCod); static void Prf_GetAndShowRankingFigure (const char *FieldName); -static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat); +static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank); /*****************************************************************************/ /************************** Get public profile URL ***************************/ @@ -1264,9 +1264,9 @@ static void Prf_GetAndShowRankingFigure (const char *FieldName) fprintf (Gbl.F.Out,""); - for (NumUsr = 1, Rank = 1; + for (NumUsr = 1, Rank = 1, Gbl.RowEvenOdd = 0; NumUsr <= NumUsrs; - NumUsr++) + NumUsr++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd) { /***** Get user and number of clicks *****/ row = mysql_fetch_row (mysql_res); @@ -1286,15 +1286,12 @@ static void Prf_GetAndShowRankingFigure (const char *FieldName) } /***** Show row *****/ - fprintf (Gbl.F.Out,"" - "" - "" - "" + fprintf (Gbl.F.Out,""); + Prf_ShowUsrInRanking (&UsrDat,Rank); + fprintf (Gbl.F.Out,"" "", - Figure); + Gbl.ColorRows[Gbl.RowEvenOdd],Figure); } fprintf (Gbl.F.Out,"
#%u", - Rank); - Prf_ShowUsrInRanking (&UsrDat); - fprintf (Gbl.F.Out,"%ld
%ld
"); @@ -1405,9 +1402,9 @@ void Prf_GetAndShowRankingClicksPerDay (void) fprintf (Gbl.F.Out,""); - for (NumUsr = 1, Rank = 1; + for (NumUsr = 1, Rank = 1, Gbl.RowEvenOdd = 0; NumUsr <= NumUsrs; - NumUsr++) + NumUsr++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd) { /***** Get user and number of clicks *****/ row = mysql_fetch_row (mysql_res); @@ -1425,13 +1422,11 @@ void Prf_GetAndShowRankingClicksPerDay (void) } /***** Show row *****/ - fprintf (Gbl.F.Out,"" - "" - "" - ""); + Prf_ShowUsrInRanking (&UsrDat,Rank); + fprintf (Gbl.F.Out,"" ""); @@ -1451,30 +1446,48 @@ void Prf_GetAndShowRankingClicksPerDay (void) /************** Show user's photo and nickname in ranking list ***************/ /*****************************************************************************/ -static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat) +static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank) { extern const char *Txt_View_public_profile; bool ShowPhoto; char PhotoURL[PATH_MAX+1]; + bool Visible = Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod); + + fprintf (Gbl.F.Out,"" + "" + "" + ""); } diff --git a/swad_user.c b/swad_user.c index c6f33876..0e65bd0f 100644 --- a/swad_user.c +++ b/swad_user.c @@ -666,7 +666,7 @@ void Usr_BuildFullName (struct UsrData *UsrDat) /******** Restrict length of firstname and surnames and write then ***********/ /*****************************************************************************/ -void Usr_RestrictLengthAndWriteName (struct UsrData *UsrDat,unsigned MaxChars) +void Usr_RestrictLengthAndWriteName (const struct UsrData *UsrDat,unsigned MaxChars) { char FirstName[Usr_MAX_BYTES_NAME_SPEC_CHAR+1]; char Surnames[2*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)]; diff --git a/swad_user.h b/swad_user.h index 5b655b3c..48544eff 100644 --- a/swad_user.h +++ b/swad_user.h @@ -206,7 +206,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat); void Usr_BuildFullName (struct UsrData *UsrDat); -void Usr_RestrictLengthAndWriteName (struct UsrData *UsrDat,unsigned MaxChars); +void Usr_RestrictLengthAndWriteName (const struct UsrData *UsrDat,unsigned MaxChars); bool Usr_CheckIfUsrIsAdm (long UsrCod,Sco_Scope_t Scope,long Cod); bool Usr_CheckIfUsrIsSuperuser (long UsrCod);
#%u", - Rank); - Prf_ShowUsrInRanking (&UsrDat); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
", + Gbl.ColorRows[Gbl.RowEvenOdd]); Str_WriteFloatNum (NumClicksPerDay); fprintf (Gbl.F.Out,"
" + "#%u" + "", + Gbl.ColorRows[Gbl.RowEvenOdd], + Rank, + Gbl.ColorRows[Gbl.RowEvenOdd]); /***** Check if I can see the public profile *****/ - if (Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod)) + if (Visible) { /***** User's photo *****/ ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO15x20",Pho_ZOOM); - - /***** Put form to go to public profile *****/ - if (UsrDat->Nickname[0]) - { - Act_FormStart (ActSeePubPrf); - Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmit (Txt_View_public_profile,"DAT_SMALL"); - fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); - } + "PHOTO18x24",Pho_ZOOM); } + + fprintf (Gbl.F.Out,"", + Gbl.ColorRows[Gbl.RowEvenOdd]); + + /***** Put form to go to public profile *****/ + if (Visible && UsrDat->Nickname[0]) + { + Act_FormStart (ActSeePubPrf); + Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Act_LinkFormSubmit (Txt_View_public_profile,"DAT_SMALL"); + Usr_RestrictLengthAndWriteName (UsrDat,8); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + + fprintf (Gbl.F.Out,"