Version 15.110.14

This commit is contained in:
Antonio Cañas Vargas 2016-01-13 12:59:23 +01:00
parent 4b85d57de7
commit cf219cf6ee
4 changed files with 82 additions and 44 deletions

View File

@ -1692,12 +1692,16 @@ a:hover img.CENTRE_PHOTO_SHOW
width:536px;
border-top:1px solid silver;
}
.SOCIAL_TOP_SHARER
.SOCIAL_TOP_CONTAINER
{
box-sizing:border-box;
width:536px;
padding-top:10px;
}
.SOCIAL_TOP_PUBLISHER
{
color:#A0A0A0;
font-size:12pt;
font-size:13pt;
}
.SOCIAL_LEFT_PHOTO
{

View File

@ -110,27 +110,32 @@
// TODO: Fix bug at the end of ranking (number too low) when a course is selected
// TODO: Reply to all
// TODO: Hour in exam announcement should start at six a.m.
// TODO: FIX BUG: In results of search of students, no mark of confirmation is shown even if the student really has confirmed his/her registration in the course
// TODO: Forum SWAD should be always named "SWAD"?
// TODO: Enable chat for guests?
// TODO: Go to forum post (or at least to forum thread) from social timeline?
// TODO: Increment one second after each refresh in social timeline?
// TODO: Add a new type of visibility of profile "unknown". Keep the same for photos?
// TODO: Limit text of post/comment in social timeline to 1000 characters?
// TODO: Limit text of post/comment in social timeline to 1000 characters? Limit textarea to 20 lines not resizeable.
// TODO: Sinchronize timeline in other actions
// TODO: Optimize Javascript not concatenating big strings in new timeline
// TODO: Review code related to Soc_MAX_RECENT_PUBS_TO_GET
// TODO: FIX BUG: Timeline is not shown on user's profile
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.110.13 (2016-01-13)"
#define Log_PLATFORM_VERSION "SWAD 15.110.14 (2016-01-13)"
#define CSS_FILE "swad15.110.13.css"
#define JS_FILE "swad15.110.13.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.110.14:Jan 13, 2016 Form to go to public profile of sharer/commenter in timeline. (192525 lines)
Version 15.110.13:Jan 13, 2016 Time in social timeline without seconds. (192495 lines)
Version 15.110.12:Jan 13, 2016 Display name of sharer/commenter in timeline. (192456 lines)
Version 15.110.11:Jan 13, 2016 Fixed bug in social timeline. (192403 lines)

View File

@ -216,6 +216,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
const struct SocialPublishing *SocPub,
bool ShowNoteAlone,
bool ViewTopLine);
static void Soc_ShowTopPublisher (const struct SocialPublishing *SocPub);
static void Soc_WriteDateTime (time_t TimeUTC);
static void Soc_GetAndWriteSocialPost (long PstCod);
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot);
@ -785,8 +786,6 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
bool ShowNoteAlone, // Social note is shown alone, not in a list
bool ViewTopLine) // Separate with a top line from previous social note
{
extern const char *Txt_SOCIAL_USER_has_shared;
extern const char *Txt_SOCIAL_USER_has_commented;
extern const char *Txt_Forum;
extern const char *Txt_Course;
extern const char *Txt_Degree;
@ -831,28 +830,13 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
Deg.DegCod = -1L;
Crs.CrsCod = -1L;
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
/***** Write sharer/commenter if distinct to author *****/
if (!ShowNoteAlone && // Listing, not note alone
SocPub) // SocPub may be NULL
if (SocPub->PubType == Soc_PUB_SHARED_NOTE ||
SocPub->PubType == Soc_PUB_COMMENT_TO_NOTE)
{
UsrDat.UsrCod = SocPub->PublisherCod;
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // TODO: Optimize with a specialized function, we only need FullName
{
Str_LimitLengthHTMLStr (UsrDat.FullName,40);
Soc_ShowTopPublisher (SocPub);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_TOP_SHARER\">");
fprintf (Gbl.F.Out,
SocPub->PubType == Soc_PUB_SHARED_NOTE ? Txt_SOCIAL_USER_has_shared :
Txt_SOCIAL_USER_has_commented,
UsrDat.FullName);
fprintf (Gbl.F.Out,"</div>");
}
}
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
/***** Get author data *****/
UsrDat.UsrCod = SocNot->UsrCod;
@ -1051,6 +1035,51 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
}
}
/*****************************************************************************/
/*************** Write sharer/commenter if distinct to author ****************/
/*****************************************************************************/
static void Soc_ShowTopPublisher (const struct SocialPublishing *SocPub)
{
extern const char *Txt_View_public_profile;
extern const char *Txt_SOCIAL_USER_has_shared;
extern const char *Txt_SOCIAL_USER_has_commented;
struct UsrData UsrDat;
if (SocPub)
if (SocPub->PubType == Soc_PUB_SHARED_NOTE ||
SocPub->PubType == Soc_PUB_COMMENT_TO_NOTE)
{
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
/***** Get user's data *****/
UsrDat.UsrCod = SocPub->PublisherCod;
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // TODO: Optimize with a specialized function, we only need FullName
{
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_TOP_CONTAINER SOCIAL_TOP_PUBLISHER\">");
/***** Show user's name inside form to go to user's public profile *****/
Act_FormStart (ActSeePubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"SOCIAL_TOP_PUBLISHER");
Str_LimitLengthHTMLStr (UsrDat.FullName,40);
fprintf (Gbl.F.Out,"%s</a>",UsrDat.FullName);
Act_FormEnd ();
/***** Show action made *****/
fprintf (Gbl.F.Out," %s",
SocPub->PubType == Soc_PUB_SHARED_NOTE ? Txt_SOCIAL_USER_has_shared :
Txt_SOCIAL_USER_has_commented);
fprintf (Gbl.F.Out,"</div>");
}
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
}
/*****************************************************************************/
/**************** Write the date of creation of a social note ****************/
/*****************************************************************************/

View File

@ -35783,46 +35783,46 @@ const char *Txt_SOCIAL_PUBLISHING_Not_shared_by_anyone = // No longer shared
"N&atilde;o compartilhado por qualquer pessoa";
#endif
const char *Txt_SOCIAL_USER_has_commented = // Warning: it is very important to include %s in the following sentences
const char *Txt_SOCIAL_USER_has_commented =
#if L==1
"%s ha comentat:";
"ha comentat:";
#elif L==2
"%s hat kommentiert:";
"hat kommentiert:";
#elif L==3
"%s has commented:";
"has commented:";
#elif L==4
"%s ha comentado:";
"ha comentado:";
#elif L==5
"%s a comment&eacute;:";
"a comment&eacute;:";
#elif L==6
"%s ha comentado:"; // Okoteve traducción
"ha comentado:"; // Okoteve traducción
#elif L==7
"%s ha commentato:";
"ha commentato:";
#elif L==8
"%s skomentowa&lstroke:";
"skomentowa&lstroke:";
#elif L==9
"%s comentou:";
"comentou:";
#endif
const char *Txt_SOCIAL_USER_has_shared = // Warning: it is very important to include %s in the following sentences
const char *Txt_SOCIAL_USER_has_shared =
#if L==1
"%s ha compartit:";
"ha compartit:";
#elif L==2
"%s hat sich geteilt:";
"hat sich geteilt:";
#elif L==3
"%s has shared:";
"has shared:";
#elif L==4
"%s ha compartido:";
"ha compartido:";
#elif L==5
"%s a partag&eacute;:";
"a partag&eacute;:";
#elif L==6
"%s ha compartido:"; // Okoteve traducción
"ha compartido:"; // Okoteve traducción
#elif L==7
"%s ha condiviso:";
"ha condiviso:";
#elif L==8
"%s podzieli&lstroke:";
"podzieli&lstroke:";
#elif L==9
"%s compartilhou:";
"compartilhou:";
#endif
const char *Txt_Sort_degrees_by =