diff --git a/css/swad16.146.css b/css/swad16.146.css index e55f4553b..b0d0dfc27 100644 --- a/css/swad16.146.css +++ b/css/swad16.146.css @@ -2279,8 +2279,8 @@ a:hover img.CENTRE_PHOTO_SHOW font-size:12pt; } -/**************** Author of assignments, messages, surveys... ****************/ -.AUTHOR +/********** Author of assignments, attendance, messages, surveys... **********/ +.AUTHOR_1_LINE { display:inline-block; box-sizing:border-box; @@ -2292,6 +2292,18 @@ a:hover img.CENTRE_PHOTO_SHOW overflow:hidden; text-overflow:ellipsis; } +.AUTHOR_2_LINES + { + display:inline-block; + box-sizing:border-box; + max-width:60px; + height:40px; + text-align:left; + vertical-align:middle; + white-space:nowrap; + overflow:hidden; + text-overflow:ellipsis; + } .AUTHOR_TXT {color:#4D88A1; font-size:11pt;} .AUTHOR_TXT_LIGHT {color:#AFC4CC; font-size:11pt;} .AUTHOR_TXT_NEW {color:#4D88A1; font-size:11pt; font-weight:bold;} diff --git a/swad_assignment.c b/swad_assignment.c index 297c32a68..b3312ce08 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -450,7 +450,7 @@ static void Asg_WriteAsgAuthor (struct Assignment *Asg) "PHOTO15x20",Pho_ZOOM,false); /***** Write name *****/ - fprintf (Gbl.F.Out,"
%s
", + fprintf (Gbl.F.Out,"
%s
", Asg->Hidden ? "AUTHOR_TXT_LIGHT" : "AUTHOR_TXT", UsrDat.FullName); diff --git a/swad_attendance.c b/swad_attendance.c index 9d30e1293..2548672f7 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -474,8 +474,6 @@ static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att) { bool ShowPhoto = false; char PhotoURL[PATH_MAX + 1]; - char FirstName[Usr_MAX_BYTES_NAME + 1]; - char Surnames[Usr_MAX_BYTES_SURNAMES + 1]; struct UsrData UsrDat; /***** Initialize structure with user's data *****/ @@ -492,23 +490,10 @@ static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att) "PHOTO15x20",Pho_ZOOM,false); /***** Write name *****/ - Str_Copy (FirstName,UsrDat.FirstName, - Usr_MAX_BYTES_NAME); - Str_Copy (Surnames,UsrDat.Surname1, - Usr_MAX_BYTES_SURNAMES); - if (UsrDat.Surname2[0]) - { - Str_Concat (Surnames," ", - Usr_MAX_BYTES_SURNAMES); - Str_Concat (Surnames,UsrDat.Surname2, - Usr_MAX_BYTES_SURNAMES); - } - Str_LimitLengthHTMLStr (FirstName,8); - Str_LimitLengthHTMLStr (Surnames,8); - fprintf (Gbl.F.Out,"%s %s", + fprintf (Gbl.F.Out,"
%s
", Att->Hidden ? "AUTHOR_TXT_LIGHT" : "AUTHOR_TXT", - FirstName,Surnames); + UsrDat.FullName); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); diff --git a/swad_centre.c b/swad_centre.c index e9e3e0923..87d57c7b6 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1572,7 +1572,7 @@ static void Ctr_ListCentresForEdition (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" @@ -2489,7 +2489,7 @@ static void Ctr_PutFormToCreateCentre (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" diff --git a/swad_changelog.h b/swad_changelog.h index db0266295..d03e51c48 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -197,15 +197,16 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.146.1 (2017-03-03)" +#define Log_PLATFORM_VERSION "SWAD 16.146.2 (2017-03-04)" #define CSS_FILE "swad16.146.css" #define JS_FILE "swad16.144.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 16.146.1: Mar 02, 2017 Changes in layout of assigments. (216350 lines) - Version 16.146: Mar 02, 2017 Changes in layout of class photos. (216351 lines) + Version 16.146.2: Mar 04, 2017 Changes in layout of authors. (216354 lines) + Version 16.146.1: Mar 03, 2017 Changes in layout of assigments. (216350 lines) + Version 16.146: Mar 03, 2017 Changes in layout of class photos. (216351 lines) Version 16.145.2: Mar 02, 2017 Some help URLs translated to spanish. (216338 lines) Version 16.145.1: Mar 02, 2017 Changes in several help URLs. (216337 lines) Version 16.145: Mar 02, 2017 Support for languages in help. diff --git a/swad_course.c b/swad_course.c index 5625c8ae5..8a4070e58 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1579,7 +1579,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" @@ -1745,7 +1745,7 @@ static void Crs_PutFormToCreateCourse (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" diff --git a/swad_degree.c b/swad_degree.c index 4b205fe73..f597433cf 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -868,7 +868,7 @@ static void Deg_ListDegreesForEdition (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" @@ -1041,7 +1041,7 @@ static void Deg_PutFormToCreateDegree (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" diff --git a/swad_forum.c b/swad_forum.c index 8e0cd7b83..3f3319463 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1313,7 +1313,7 @@ static void For_ShowAForumPost (struct ForumThread *Thr,unsigned PstNum,long Pst /* Write author */ fprintf (Gbl.F.Out,""); Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - Msg_WriteMsgAuthor (&UsrDat,125,16,"AUTHOR_TXT",Enabled,NULL); + Msg_WriteMsgAuthor (&UsrDat,"AUTHOR_TXT",Enabled,NULL); fprintf (Gbl.F.Out,""); if (Enabled) { @@ -3514,7 +3514,7 @@ void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],struct Pagination *Pagi /* Write the author of first or last message */ UsrDat.UsrCod = Thr.UsrCod[Order]; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - Msg_WriteMsgAuthor (&UsrDat,68,9,Style,Thr.Enabled[Order],BgColor); + Msg_WriteMsgAuthor (&UsrDat,Style,Thr.Enabled[Order],BgColor); /* Write the date of first or last message (it's in YYYYMMDDHHMMSS format) */ TimeUTC = Thr.WriteTime[Order]; diff --git a/swad_institution.c b/swad_institution.c index fe2cbb2b5..b83295117 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1559,7 +1559,7 @@ static void Ins_ListInstitutionsForEdition (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" @@ -2242,7 +2242,7 @@ static void Ins_PutFormToCreateInstitution (void) fprintf (Gbl.F.Out,"" "" ""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,100,6,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); fprintf (Gbl.F.Out,"" "
" "" diff --git a/swad_message.c b/swad_message.c index 306e6de58..c84835cd9 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2910,7 +2910,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) /***** Write message author *****/ Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - Msg_WriteMsgAuthor (&UsrDat,100,11, + Msg_WriteMsgAuthor (&UsrDat, Open ? "MSG_AUT_BG" : "MSG_AUT_BG_NEW", // Style true,NULL); @@ -3110,7 +3110,6 @@ static void Msg_WriteSentOrReceivedMsgSubject (long MsgCod,const char *Subject,b // Input: UsrDat must hold user's data void Msg_WriteMsgAuthor (struct UsrData *UsrDat, - unsigned WidthOfNameColumn,unsigned MaxCharsInName, const char *Style,bool Enabled,const char *BgColor) { extern const char *Txt_Unknown_or_without_photo; @@ -3142,10 +3141,19 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat, fprintf (Gbl.F.Out,"",WidthOfNameColumn); + fprintf (Gbl.F.Out,"\">"); /* Restrict length of firstname and surnames */ - Usr_RestrictLengthAndWriteName (UsrDat,MaxCharsInName); + fprintf (Gbl.F.Out,"
" + "%s
" + "%s", + Style, + UsrDat->FirstName, + UsrDat->Surname1); + if (UsrDat->Surname2[0]) + fprintf (Gbl.F.Out,"%s", + UsrDat->Surname2); + fprintf (Gbl.F.Out,"
"); } else { @@ -3159,11 +3167,10 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat, Style); if (BgColor) fprintf (Gbl.F.Out," %s",BgColor); - fprintf (Gbl.F.Out,"\" style=\"width:%upx;\">", - WidthOfNameColumn); + fprintf (Gbl.F.Out,"\">"); } - /***** End seconf column *****/ + /***** End second column *****/ fprintf (Gbl.F.Out,""); } diff --git a/swad_message.h b/swad_message.h index bb5594fb8..147e2fec4 100644 --- a/swad_message.h +++ b/swad_message.h @@ -100,7 +100,6 @@ void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_TEXT + 1], void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg); void Msg_WriteMsgAuthor (struct UsrData *UsrDat, - unsigned WidthOfNameColumn,unsigned MaxCharsInName, const char *Style,bool Enabled,const char *BgColor); bool Msg_WriteCrsOrgMsg (long CrsCod); void Msg_WriteListUsrsDstMsg (long MsgCod); diff --git a/swad_notification.c b/swad_notification.c index 8733584b9..464f4a690 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -533,7 +533,7 @@ void Ntf_ShowMyNotifications (void) fprintf (Gbl.F.Out,""); /* Write user (from) */ - Msg_WriteMsgAuthor (&UsrDat,120,11,ClassAuthorBg,true,NULL); + Msg_WriteMsgAuthor (&UsrDat,ClassAuthorBg,true,NULL); /* Write location */ fprintf (Gbl.F.Out,"",