diff --git a/swad_HTML.c b/swad_HTML.c index 02782af4..c0c8de2e 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -2049,6 +2049,27 @@ void HTM_Percentage (double Percentage) HTM_TxtF ("%5.2lf%%",Percentage); } +void HTM_TD_Txt_Left (const char *Txt) + { + HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); + HTM_Txt (Txt); + HTM_TD_End (); + } + +void HTM_TD_Txt_Right (const char *Txt) + { + HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); + HTM_Txt (Txt); + HTM_TD_End (); + } + +void HTM_TD_LINE_TOP_Txt (const char *Txt) + { + HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"",The_GetSuffix ()); + HTM_Txt (Txt); + HTM_TD_End (); + } + void HTM_TD_Unsigned (unsigned Num) { HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); @@ -2056,6 +2077,13 @@ void HTM_TD_Unsigned (unsigned Num) HTM_TD_End (); } +void HTM_TD_LINE_TOP_Unsigned (unsigned Num) + { + HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",The_GetSuffix ()); + HTM_Unsigned (Num); + HTM_TD_End (); + } + void HTM_TD_UnsignedLong (unsigned long Num) { HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); @@ -2063,6 +2091,13 @@ void HTM_TD_UnsignedLong (unsigned long Num) HTM_TD_End (); } +void HTM_TD_LINE_TOP_UnsignedLong (unsigned long Num) + { + HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",The_GetSuffix ()); + HTM_UnsignedLong (Num); + HTM_TD_End (); + } + void HTM_TD_Percentage (unsigned Num,unsigned NumTotal) { HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); @@ -2071,6 +2106,14 @@ void HTM_TD_Percentage (unsigned Num,unsigned NumTotal) HTM_TD_End (); } +void HTM_TD_LINE_TOP_Percentage (unsigned Num,unsigned NumTotal) + { + HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",The_GetSuffix ()); + HTM_Percentage (NumTotal ? (double) Num * 100.0 / (double) NumTotal : + 0.0); + HTM_TD_End (); + } + void HTM_TD_Ratio (unsigned Num,unsigned NumTotal) { HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); @@ -2079,9 +2122,24 @@ void HTM_TD_Ratio (unsigned Num,unsigned NumTotal) HTM_TD_End (); } +void HTM_TD_LINE_TOP_Ratio (unsigned Num,unsigned NumTotal) + { + HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",The_GetSuffix ()); + HTM_Double2Decimals (NumTotal ? (double) Num / (double) NumTotal : + 0.0); + HTM_TD_End (); + } + void HTM_TD_Double2Decimals (double Num) { HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_Double2Decimals (Num); HTM_TD_End (); } + +void HTM_TD_LINE_TOP_Double2Decimals (double Num) + { + HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"",The_GetSuffix ()); + HTM_Double2Decimals (Num); + HTM_TD_End (); + } diff --git a/swad_HTML.h b/swad_HTML.h index 2d803f93..405584d5 100644 --- a/swad_HTML.h +++ b/swad_HTML.h @@ -242,10 +242,18 @@ void HTM_DoubleFewDigits (double Num); void HTM_Double2Decimals (double Num); void HTM_Percentage (double Percentage); +void HTM_TD_Txt_Left (const char *Txt); +void HTM_TD_Txt_Right (const char *Txt); +void HTM_TD_LINE_TOP_Txt (const char *Txt); void HTM_TD_Unsigned (unsigned Num); +void HTM_TD_LINE_TOP_Unsigned (unsigned Num); void HTM_TD_UnsignedLong (unsigned long Num); +void HTM_TD_LINE_TOP_UnsignedLong (unsigned long Num); void HTM_TD_Percentage (unsigned Num,unsigned NumTotal); +void HTM_TD_LINE_TOP_Percentage (unsigned Num,unsigned NumTotal); void HTM_TD_Ratio (unsigned Num,unsigned NumTotal); +void HTM_TD_LINE_TOP_Ratio (unsigned Num,unsigned NumTotal); void HTM_TD_Double2Decimals (double Num); +void HTM_TD_LINE_TOP_Double2Decimals (double Num); #endif diff --git a/swad_assignment.c b/swad_assignment.c index eb82c2e3..d45273d5 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -546,8 +546,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments, The_GetSuffix ()); else HTM_TD_Begin ("class=\"LT DAT_%s %s\"", - The_GetSuffix (), - The_GetColorRows ()); + The_GetSuffix (),The_GetColorRows ()); if (Assignments->Asg.SendWork == Asg_SEND_WORK) Asg_WriteAssignmentFolder (&Assignments->Asg,PrintView); HTM_TD_End (); @@ -561,8 +560,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments, if (PrintView) HTM_TD_Begin ("colspan=\"2\" class=\"LT\""); else - HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"", - The_GetColorRows ()); + HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ()); Asg_WriteAsgAuthor (&Assignments->Asg); HTM_TD_End (); diff --git a/swad_attendance.c b/swad_attendance.c index 9ba94733..63f46808 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -2815,18 +2815,11 @@ static void Att_ListUsrsAttendanceTable (struct Att_Events *Events, NumAttEvent++) if (Events->Lst[NumAttEvent].Selected) { - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (Events->Lst[NumAttEvent].NumStdsFromList); - HTM_TD_End (); - + HTM_TD_LINE_TOP_Unsigned (Events->Lst[NumAttEvent].NumStdsFromList); Total += Events->Lst[NumAttEvent].NumStdsFromList; } - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (Total); - HTM_TD_End (); + HTM_TD_LINE_TOP_Unsigned (Total); HTM_TR_End (); } diff --git a/swad_browser.c b/swad_browser.c index 9a952f45..c7194285 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -10213,14 +10213,9 @@ void Brw_GetAndShowOERsStats (void) Brw_GetNumberOfOERs (License,NumFiles); HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_LICENSES[License]); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_LICENSES[License]); HTM_TD_UnsignedLong (NumFiles[0]); HTM_TD_UnsignedLong (NumFiles[1]); - HTM_TR_End (); } diff --git a/swad_center.c b/swad_center.c index 3f086eaa..e2f9e102 100644 --- a/swad_center.c +++ b/swad_center.c @@ -1301,13 +1301,11 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places) The_GetSuffix ()); HTM_TD_End (); - /***** Number of users who claim to belong to this center *****/ + /***** Number of users who claim to belong to this center, + number of degrees and + number of users in courses of this center *****/ HTM_TD_Unsigned (0); - - /***** Number of degrees *****/ HTM_TD_Unsigned (0); - - /***** Number of users in courses of this center *****/ HTM_TD_Unsigned (0); /***** Center requester *****/ @@ -1317,8 +1315,7 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places) HTM_TD_End (); /***** Center status *****/ - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_TD_End (); + HTM_TD_Empty (1); HTM_TR_End (); diff --git a/swad_changelog.h b/swad_changelog.h index f0b23416..33464b53 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -633,10 +633,11 @@ Me sale este error, no s "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') */ -#define Log_PLATFORM_VERSION "SWAD 23.36 (2023-10-11)" +#define Log_PLATFORM_VERSION "SWAD 23.37 (2023-10-14)" #define CSS_FILE "swad23.35.1.css" #define JS_FILE "swad22.49.js" /* + Version 23.37: Oct 14, 2023 Code refactoring in HTML. (335342 lines) Version 23.36: Oct 11, 2023 Code refactoring in HTML. (335342 lines) Version 23.35.2: Oct 11, 2023 Fixed bugs in short/full names. (335550 lines) Version 23.35.1: Oct 11, 2023 Changes in CSS related to short/full names. (335550 lines) diff --git a/swad_chat.c b/swad_chat.c index 8f83c8a7..f1c459c1 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -273,15 +273,8 @@ void Cht_ShowListOfChatRoomsWithUsrs (void) row = mysql_fetch_row (mysql_res); HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (row[0]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (row[1]); - HTM_TD_End (); - + HTM_TD_Txt_Left (row[0]); + HTM_TD_Txt_Right (row[1]); HTM_TR_End (); } diff --git a/swad_country.c b/swad_country.c index 6a3b3338..229c0eea 100644 --- a/swad_country.c +++ b/swad_country.c @@ -278,10 +278,7 @@ void Cty_ListCountries2 (void) HTM_TR_Begin (NULL); HTM_TD_Empty (1); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_Country_unspecified); - HTM_TD_End (); + HTM_TD_Txt_Left (Txt_Country_unspecified); /* Number of users who do not claim to belong to any country */ HTM_TD_Unsigned (Cty_GetCachedNumUsrsWhoDontClaimToBelongToAnyCty ()); diff --git a/swad_course.c b/swad_course.c index e690e3d4..1f676d4b 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1128,10 +1128,8 @@ static void Crs_PutFormToCreateCourse (void) Names[Nam_FULL_NAME] = Crs_EditingCrs->FullName; Nam_NewShortAndFullNames (Names); - /***** Current number of teachers in this course *****/ + /***** Current number of teachers and students in this course *****/ HTM_TD_Unsigned (0); - - /***** Current number of students in this course *****/ HTM_TD_Unsigned (0); /***** Course requester *****/ @@ -1140,8 +1138,7 @@ static void Crs_PutFormToCreateCourse (void) HTM_TD_End (); /***** Course status *****/ - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_TD_End (); + HTM_TD_Empty (1); HTM_TR_End (); diff --git a/swad_date.c b/swad_date.c index 58cc9580..7998b24b 100644 --- a/swad_date.c +++ b/swad_date.c @@ -1883,17 +1883,8 @@ void Dat_GetAndShowNumUsrsPerDateFormat (void) Dat_PutScriptDateFormat (Format); HTM_TD_End (); - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumUsrs[Format]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Format] * 100.0 / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); + HTM_TD_Unsigned (NumUsrs[Format]); + HTM_TD_Percentage (NumUsrs[Format],NumUsrsTotal); HTM_TR_End (); } diff --git a/swad_degree.c b/swad_degree.c index c3952c76..5687f58d 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -579,14 +579,12 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes) HTM_TD_Unsigned (0); /***** Degree requester *****/ - HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", - The_GetSuffix ()); + HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",The_GetSuffix ()); Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED); HTM_TD_End (); /***** Degree status *****/ - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_TD_End (); + HTM_TD_Empty (1); HTM_TR_End (); diff --git a/swad_department.c b/swad_department.c index 5a652674..6db7db81 100644 --- a/swad_department.c +++ b/swad_department.c @@ -131,8 +131,6 @@ void Dpt_SeeAllDepts (void) [Dpt_ORDER_BY_NUM_TCHS ] = HTM_HEAD_RIGHT }; unsigned NumDpt; - unsigned NumTchsInsInOtherDpts; - unsigned NumTchsInsWithNoDpt; /***** Trivial check *****/ if (Gbl.Hierarchy.Node[Hie_INS].HieCod <= 0) // No institution selected @@ -210,29 +208,15 @@ void Dpt_SeeAllDepts (void) HTM_TR_End (); /***** Write teachers of this institution with other department *****/ - NumTchsInsInOtherDpts = Dpt_DB_GetNumTchsCurrentInsInDepartment (0); - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_Other_departments); - HTM_TD_End (); - - HTM_TD_Unsigned (NumTchsInsInOtherDpts); - + HTM_TD_Txt_Left (Txt_Other_departments); + HTM_TD_Unsigned (Dpt_DB_GetNumTchsCurrentInsInDepartment (0)); HTM_TR_End (); /***** Write teachers with no department *****/ - NumTchsInsWithNoDpt = Dpt_DB_GetNumTchsCurrentInsInDepartment (-1L); - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_Department_unspecified); - HTM_TD_End (); - - HTM_TD_Unsigned (NumTchsInsWithNoDpt); - + HTM_TD_Txt_Left (Txt_Department_unspecified); + HTM_TD_Unsigned (Dpt_DB_GetNumTchsCurrentInsInDepartment (-1L)); HTM_TR_End (); /***** End table and box *****/ diff --git a/swad_follow.c b/swad_follow.c index 0b548952..c3633bd5 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -1211,15 +1211,10 @@ void Fol_GetAndShowFollowStats (void) /***** Write number of followed / followers *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Fol == 0 ? Txt_Followed : - Txt_Followers); - HTM_TD_End (); - + HTM_TD_Txt_Left (Fol == 0 ? Txt_Followed : + Txt_Followers); HTM_TD_Unsigned (NumUsrs); HTM_TD_Percentage (NumUsrs,NumUsrsTotal); - HTM_TR_End (); } @@ -1232,15 +1227,9 @@ void Fol_GetAndShowFollowStats (void) /***** Write number of followed per follower *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_FollowPerFollow[Fol]); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_FollowPerFollow[Fol]); HTM_TD_Double2Decimals (Average); - HTM_TD_Empty (1); - HTM_TR_End (); } diff --git a/swad_forum.c b/swad_forum.c index c267eef7..9201d7ca 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -3466,15 +3466,15 @@ static void For_WriteForumTotalStats (struct For_FiguresForum *FiguresForum) double NumPostsPerForum; /***** Compute number of threads per forum, number of posts per forum and number of posts per thread *****/ - NumThrsPerForum = (FiguresForum->NumForums ? (double) FiguresForum->NumThreads / - (double) FiguresForum->NumForums : - 0.0); + NumThrsPerForum = (FiguresForum->NumForums ? (double) FiguresForum->NumThreads / + (double) FiguresForum->NumForums : + 0.0); NumPostsPerThread = (FiguresForum->NumThreads ? (double) FiguresForum->NumPosts / (double) FiguresForum->NumThreads : 0.0); - NumPostsPerForum = (FiguresForum->NumForums ? (double) FiguresForum->NumPosts / - (double) FiguresForum->NumForums : - 0.0); + NumPostsPerForum = (FiguresForum->NumForums ? (double) FiguresForum->NumPosts / + (double) FiguresForum->NumForums : + 0.0); /***** Write forum name and stats *****/ HTM_TR_Begin (NULL); @@ -3483,45 +3483,14 @@ static void For_WriteForumTotalStats (struct For_FiguresForum *FiguresForum) The_GetSuffix ()); HTM_TD_End (); - HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Txt (Txt_Total); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (FiguresForum->NumForums); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (FiguresForum->NumThreads); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (FiguresForum->NumPosts); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP RM\"", - The_GetSuffix ()); - HTM_Unsigned (FiguresForum->NumUsrsToBeNotifiedByEMail); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (NumThrsPerForum); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (NumPostsPerThread); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (NumPostsPerForum); - HTM_TD_End (); + HTM_TD_LINE_TOP_Txt (Txt_Total); + HTM_TD_LINE_TOP_Unsigned (FiguresForum->NumForums); + HTM_TD_LINE_TOP_Unsigned (FiguresForum->NumThreads); + HTM_TD_LINE_TOP_Unsigned (FiguresForum->NumPosts); + HTM_TD_LINE_TOP_Unsigned (FiguresForum->NumUsrsToBeNotifiedByEMail); + HTM_TD_LINE_TOP_Double2Decimals (NumThrsPerForum); + HTM_TD_LINE_TOP_Double2Decimals (NumPostsPerThread); + HTM_TD_LINE_TOP_Double2Decimals (NumPostsPerForum); HTM_TR_End (); } diff --git a/swad_group.c b/swad_group.c index 594fe9df..4b1e2628 100644 --- a/swad_group.c +++ b/swad_group.c @@ -2221,8 +2221,7 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp, HTM_TD_End (); /* Room */ - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_TD_End (); + HTM_TD_Empty (1); /* Number of students who don't belong to any group of this type */ for (Role = Rol_TCH; diff --git a/swad_holiday.c b/swad_holiday.c index dde92eb8..d5cca9ff 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -178,21 +178,17 @@ void Hld_SeeAllHolidays (void) /* Write data of this holiday */ HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (Holidays.Lst[NumHld].PlcCod <= 0 ? Txt_All_places : - Holidays.Lst[NumHld].PlaceFullName); - HTM_TD_End (); + HTM_TD_Txt_Left (Holidays.Lst[NumHld].PlcCod <= 0 ? Txt_All_places : + Holidays.Lst[NumHld].PlaceFullName); Dat_ConvDateToDateStr (&Holidays.Lst[NumHld].StartDate,StrDate); - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_TxtF (" %s",StrDate); + HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); + HTM_NBSP (); + HTM_Txt (StrDate); HTM_TD_End (); - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); + HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); HTM_NBSP (); switch (Holidays.Lst[NumHld].HldTyp) { @@ -205,8 +201,7 @@ void Hld_SeeAllHolidays (void) } HTM_TD_End (); - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); + HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); HTM_TxtF (" %s",Holidays.Lst[NumHld].Name); HTM_TD_End (); diff --git a/swad_indicator.c b/swad_indicator.c index 48e0f531..8bc67f35 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -506,15 +506,8 @@ static void Ind_ShowNumCoursesWithIndicators (const struct Ind_Indicators *Indic if (PutForm) HTM_TD_Empty (1); - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Txt (Txt_Total); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (NumCrss); - HTM_TD_End (); + HTM_TD_LINE_TOP_Txt (Txt_Total); + HTM_TD_LINE_TOP_Unsigned (NumCrss); HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", The_GetSuffix ()); diff --git a/swad_institution.c b/swad_institution.c index d5e5e614..61b57d75 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1384,8 +1384,7 @@ static void Ins_PutFormToCreateInstitution (void) HTM_TD_End (); /***** Institution status *****/ - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_TD_End (); + HTM_TD_Empty (1); HTM_TR_End (); @@ -1894,10 +1893,7 @@ static void Ins_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss, /***** Number of order *****/ if (NumberThisRow != NumberLastRow) NumOrder = NumIns; - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumOrder); - HTM_TD_End (); + HTM_TD_Unsigned (NumOrder); /***** Write link to institution *****/ HTM_TD_Begin ("class=\"LM FORM_IN_%s\"", @@ -1921,10 +1917,7 @@ static void Ins_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss, HTM_TD_End (); /***** Write statistic *****/ - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumberThisRow); - HTM_TD_End (); + HTM_TD_Unsigned (NumberThisRow); HTM_TR_End (); diff --git a/swad_message.c b/swad_message.c index 3d577162..b452e280 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2843,10 +2843,7 @@ void Msg_ListBannedUsrs (void) HTM_TD_End (); /* Write user's full name */ - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (UsrDat.FullName); - HTM_TD_End (); + HTM_TD_Txt_Left (UsrDat.FullName); HTM_TR_End (); } @@ -2908,61 +2905,19 @@ void Msg_GetAndShowMsgsStats (void) /***** Write number of messages *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (Txt_MSGS_Sent); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsSentNotDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsSentDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsSentNotDeleted + NumMsgsSentDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Hyphen (); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_MSGS_Sent); + HTM_TD_Unsigned (NumMsgsSentNotDeleted); + HTM_TD_Unsigned (NumMsgsSentDeleted); + HTM_TD_Unsigned (NumMsgsSentNotDeleted + NumMsgsSentDeleted); + HTM_TD_Txt_Right ("-"); HTM_TR_End (); HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (Txt_MSGS_Received); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsReceivedNotDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsReceivedAndDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsReceivedNotDeleted + NumMsgsReceivedAndDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMsgsReceivedAndNotified); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_MSGS_Received); + HTM_TD_Unsigned (NumMsgsReceivedNotDeleted); + HTM_TD_Unsigned (NumMsgsReceivedAndDeleted); + HTM_TD_Unsigned (NumMsgsReceivedNotDeleted + NumMsgsReceivedAndDeleted); + HTM_TD_Unsigned (NumMsgsReceivedAndNotified); HTM_TR_End (); /***** End table and box *****/ diff --git a/swad_network.c b/swad_network.c index 46626b7b..c70a4ce5 100644 --- a/swad_network.c +++ b/swad_network.c @@ -384,17 +384,8 @@ void Net_ShowWebAndSocialNetworksStats (void) HTM_TxtF (" %s",Net_WebsAndSocialNetworksTitle[Web]); HTM_TD_End (); - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumUsrs); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Percentage (NumUsrsTotal ? 100.0 * (double) NumUsrs / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); + HTM_TD_Unsigned (NumUsrs); + HTM_TD_Percentage (NumUsrs,NumUsrsTotal); HTM_TR_End (); } diff --git a/swad_notice.c b/swad_notice.c index 678f2423..7579a7c7 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -821,32 +821,11 @@ void Not_GetAndShowNoticesStats (void) /***** Write number of notices *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumNotices[Not_ACTIVE_NOTICE]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumNotices[Not_OBSOLETE_NOTICE]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumNoticesDeleted); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s\"", - The_GetSuffix ()); - HTM_Unsigned ( NumTotalNotices); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumTotalNotifications); - HTM_TD_End (); - + HTM_TD_Unsigned (NumNotices[Not_ACTIVE_NOTICE]); + HTM_TD_Unsigned (NumNotices[Not_OBSOLETE_NOTICE]); + HTM_TD_Unsigned (NumNoticesDeleted); + HTM_TD_Unsigned (NumTotalNotices); + HTM_TD_Unsigned (NumTotalNotifications); HTM_TR_End (); /***** End table and box *****/ diff --git a/swad_notification.c b/swad_notification.c index 24cddc8c..9284b8fc 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -1814,67 +1814,21 @@ void Ntf_GetAndShowNumUsrsPerNotifyEvent (void) NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN { HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (Txt_NOTIFY_EVENTS_PLURAL[NotifyEvent]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumUsrs[NotifyEvent]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[NotifyEvent] * 100.0 / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumEvents[NotifyEvent]); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumMails[NotifyEvent]); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_NOTIFY_EVENTS_PLURAL[NotifyEvent]); + HTM_TD_Unsigned (NumUsrs[NotifyEvent]); + HTM_TD_Percentage (NumUsrs[NotifyEvent],NumUsrsTotal ); + HTM_TD_Unsigned (NumEvents[NotifyEvent]); + HTM_TD_Unsigned (NumMails[NotifyEvent]); HTM_TR_End (); } /***** Write total number of users who want to be notified by email on some event *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Txt (Txt_Total); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Percentage (NumUsrsTotal ? (double) NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent * 100.0 / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (NumEventsTotal); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (NumMailsTotal); - HTM_TD_End (); - + HTM_TD_LINE_TOP_Txt (Txt_Total); + HTM_TD_LINE_TOP_Unsigned (NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent); + HTM_TD_LINE_TOP_Percentage (NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent,NumUsrsTotal); + HTM_TD_LINE_TOP_Unsigned (NumEventsTotal); + HTM_TD_LINE_TOP_Unsigned (NumMailsTotal); HTM_TR_End (); /***** End table and box *****/ diff --git a/swad_place.c b/swad_place.c index c525d735..594e818a 100644 --- a/swad_place.c +++ b/swad_place.c @@ -166,18 +166,10 @@ void Plc_SeeAllPlaces (void) { /* Write data of this place */ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (Places.Lst[NumPlc].FullName); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (Places.Lst[NumPlc].NumCtrs); - HTM_TD_End (); - + HTM_TD_Txt_Left (Places.Lst[NumPlc].FullName); + HTM_TD_Unsigned (Places.Lst[NumPlc].NumCtrs); HTM_TR_End (); + NumCtrsWithPlc += Places.Lst[NumPlc].NumCtrs; } @@ -191,33 +183,21 @@ void Plc_SeeAllPlaces (void) /***** Write centers (of the current institution) with other place *****/ NumCtrsInOtherPlcs = Ctr_DB_GetNumCtrsInPlc (0); + HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"", - The_GetSuffix ()); - HTM_Txt (Txt_Other_places); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_%s\"", - The_GetSuffix ()); - HTM_Unsigned (NumCtrsInOtherPlcs); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_Other_places); + HTM_TD_Unsigned (NumCtrsInOtherPlcs); HTM_TR_End (); + NumCtrsWithPlc += NumCtrsInOtherPlcs; /***** Write centers (of the current institution) with no place *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_Place_unspecified); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_Place_unspecified); HTM_TD_Unsigned (Hie_GetNumNodesInHieLvl (Hie_CTR, // Number of centers... Hie_INS, // ...in institution Gbl.Hierarchy.Node[Hie_INS].HieCod) - NumCtrsWithPlc); - HTM_TR_End (); /***** End table *****/ diff --git a/swad_privacy.c b/swad_privacy.c index a26fa2b0..50cc31c5 100644 --- a/swad_privacy.c +++ b/swad_privacy.c @@ -367,14 +367,9 @@ static void Pri_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject, if (MaskAllowedVisibility & (1 << Visibility)) { HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_PRIVACY_OPTIONS[Visibility]); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_PRIVACY_OPTIONS[Visibility]); HTM_TD_Unsigned (NumUsrs[Visibility]); HTM_TD_Percentage (NumUsrs[Visibility],NumUsrsTotal); - HTM_TR_End (); } } diff --git a/swad_test.c b/swad_test.c index 3a49fb92..c242cead 100644 --- a/swad_test.c +++ b/swad_test.c @@ -782,10 +782,7 @@ void Tst_GetAndShowTestsStats (void) /***** Write stats *****/ HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_TST_STR_ANSWER_TYPES[AnsType]); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_TST_STR_ANSWER_TYPES[AnsType]); HTM_TD_Unsigned (Stats.NumCoursesWithQuestions); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); @@ -812,15 +809,8 @@ void Tst_GetAndShowTestsStats (void) /***** Write stats *****/ HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Txt (Txt_Total); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (Stats.NumCoursesWithQuestions); - HTM_TD_End (); + HTM_TD_LINE_TOP_Txt (Txt_Total); + HTM_TD_LINE_TOP_Unsigned (Stats.NumCoursesWithQuestions); HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", The_GetSuffix ()); @@ -831,35 +821,12 @@ void Tst_GetAndShowTestsStats (void) 0.0); HTM_TD_End (); - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (Stats.NumQsts); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (Stats.AvgQstsPerCourse); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_UnsignedLong (Stats.NumHits); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (Stats.AvgHitsPerCourse); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (Stats.AvgHitsPerQuestion); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (Stats.AvgScorePerQuestion); - HTM_TD_End (); + HTM_TD_LINE_TOP_Unsigned (Stats.NumQsts); + HTM_TD_LINE_TOP_Double2Decimals (Stats.AvgQstsPerCourse); + HTM_TD_LINE_TOP_UnsignedLong (Stats.NumHits); + HTM_TD_LINE_TOP_Double2Decimals (Stats.AvgHitsPerCourse); + HTM_TD_LINE_TOP_Double2Decimals (Stats.AvgHitsPerQuestion); + HTM_TD_LINE_TOP_Double2Decimals (Stats.AvgScorePerQuestion); HTM_TR_End (); diff --git a/swad_timeline.c b/swad_timeline.c index 5af28d05..4fbc17a4 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -600,11 +600,7 @@ void Tml_GetAndShowTimelineActivityStats (void) /***** Write number of timeline notes and number of users *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_Txt (Txt_TIMELINE_NOTE[NoteType]); - HTM_TD_End (); - + HTM_TD_Txt_Left (Txt_TIMELINE_NOTE[NoteType]); HTM_TD_Unsigned (NumNotes); HTM_TD_Unsigned (NumUsrs); HTM_TD_Percentage (NumUsrs,NumUsrsTotal); @@ -624,33 +620,11 @@ void Tml_GetAndShowTimelineActivityStats (void) /* Write totals */ HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"LM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Txt (Txt_Total); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (NumNotes); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Unsigned (NumUsrs); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Percentage (NumUsrsTotal ? (double) NumUsrs * 100.0 / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"RM DAT_STRONG_%s LINE_TOP\"", - The_GetSuffix ()); - HTM_Double2Decimals (NumUsrs ? (double) NumNotes / (double) NumUsrs : - 0.0); - HTM_TD_End (); + HTM_TD_LINE_TOP_Txt (Txt_Total); + HTM_TD_LINE_TOP_Unsigned (NumNotes); + HTM_TD_LINE_TOP_Unsigned (NumUsrs); + HTM_TD_LINE_TOP_Percentage (NumUsrs,NumUsrsTotal); + HTM_TD_LINE_TOP_Ratio (NumNotes,NumUsrs); HTM_TR_End ();