From 8c2949441326ea307b78ce755df0e2270a2d00b2 Mon Sep 17 00:00:00 2001 From: acanas Date: Wed, 5 Oct 2022 01:32:04 +0200 Subject: [PATCH] Version 22.40: Oct 04, 2022 Link in main title. --- css/{swad22.35.css => swad22.40.css} | 14 +-- swad_changelog.h | 5 +- swad_country.c | 2 +- swad_hierarchy.c | 145 ++++++++++++++++----------- swad_logo.c | 21 +--- 5 files changed, 95 insertions(+), 92 deletions(-) rename css/{swad22.35.css => swad22.40.css} (99%) diff --git a/css/swad22.35.css b/css/swad22.40.css similarity index 99% rename from css/swad22.35.css rename to css/swad22.40.css index 4d131532..65990ff4 100644 --- a/css/swad22.35.css +++ b/css/swad22.40.css @@ -399,7 +399,7 @@ a:hover /* Default ==> underlined */ height:40px; margin-right:10px; text-align:left; - vertical-align:top !important; + vertical-align:middle !important; } @media only screen and (max-width: 480px) { /* For mobile-phones */ @@ -523,7 +523,6 @@ a:hover /* Default ==> underlined */ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; - margin:0 auto; vertical-align:middle; } #big_full_name @@ -545,7 +544,6 @@ a:hover /* Default ==> underlined */ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; - margin:0 auto; vertical-align:middle; } } @@ -2300,14 +2298,6 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} overflow:hidden; text-overflow:ellipsis; } -.COUNTRY_MAP_TITLE - { - box-sizing:border-box; - width:40px; - height:40px; - margin-right:10px; - vertical-align:top; - } .COUNTRY_MAP_SMALL { box-sizing:border-box; @@ -2483,7 +2473,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} } .ICO_HIGHLIGHT, .CHECKBOX_UNCHECKED { - opacity:0.67; + opacity:0.7; } .ICO_HIGHLIGHT:hover, .CHECKBOX_UNCHECKED:hover, .CHECKBOX_CHECKED diff --git a/swad_changelog.h b/swad_changelog.h index 7c9456a6..2e8cc112 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate TODO: Attach pdf files in multimedia. */ -#define Log_PLATFORM_VERSION "SWAD 22.39.5 (2022-10-03)" -#define CSS_FILE "swad22.35.css" +#define Log_PLATFORM_VERSION "SWAD 22.40 (2022-10-04)" +#define CSS_FILE "swad22.40.css" #define JS_FILE "swad21.100.js" /* + Version 22.40: Oct 04, 2022 Link in main title. (332514 lines) Version 22.39.5: Oct 03, 2022 Fixed bug in edition of course program. (332513 lines) Version 22.39.4: Oct 03, 2022 Fixed layout issues in projects. (332515 lines) Version 22.39.3: Oct 03, 2022 Code refactoring in attendance events. (332519 lines) diff --git a/swad_country.c b/swad_country.c index 86337e9a..0664be2b 100644 --- a/swad_country.c +++ b/swad_country.c @@ -562,7 +562,7 @@ void Cty_DrawCountryMap (struct Cty_Countr *Cty,const char *Class) } else Ico_PutIcon ("tr16x16.gif",Ico_UNCHANGED, - Cty->Name[Gbl.Prefs.Language],Class); + Cty->Name[Gbl.Prefs.Language],Class); } /*****************************************************************************/ diff --git a/swad_hierarchy.c b/swad_hierarchy.c index eaea9857..02c14f13 100644 --- a/swad_hierarchy.c +++ b/swad_hierarchy.c @@ -52,6 +52,8 @@ extern struct Globals Gbl; /***************************** Private prototypes ****************************/ /*****************************************************************************/ +static void Hie_DrawLogo (const char *ShrtText); + static Hie_StatusTxt_t Hie_GetStatusTxtFromStatusBits (Hie_Status_t Status); static Hie_Status_t Hie_GetStatusBitsFromStatusTxt (Hie_StatusTxt_t StatusTxt); @@ -410,78 +412,101 @@ void Hie_WriteHierarchyInBreadcrumb (void) void Hie_WriteBigNameCtyInsCtrDegCrs (void) { - extern const char *Txt_TAGLINE; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; + static Act_Action_t NextAction[HieLvl_NUM_LEVELS] = + { + [HieLvl_UNK] = ActUnk, // Unknown + [HieLvl_SYS] = ActSeeCty, // System ==> list countries + [HieLvl_CTY] = ActSeeIns, // Country ==> list institutions + [HieLvl_INS] = ActSeeCtr, // Institution ==> list centers + [HieLvl_CTR] = ActSeeDeg, // Center ==> list degrees + [HieLvl_DEG] = ActSeeCrs, // Degree ==> list courses + [HieLvl_CRS] = ActSeePrg, // Course ==> see program + }; + const char *FullText[HieLvl_NUM_LEVELS] = + { + [HieLvl_SYS] = Cfg_PLATFORM_SHORT_NAME, + [HieLvl_CTY] = Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language], + [HieLvl_INS] = Gbl.Hierarchy.Ins.FullName, + [HieLvl_CTR] = Gbl.Hierarchy.Ctr.FullName, + [HieLvl_DEG] = Gbl.Hierarchy.Deg.FullName, + [HieLvl_CRS] = Gbl.Hierarchy.Crs.FullName, + }; + const char *ShrtText[HieLvl_NUM_LEVELS] = + { + [HieLvl_SYS] = Cfg_PLATFORM_SHORT_NAME, + [HieLvl_CTY] = Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language], + [HieLvl_INS] = Gbl.Hierarchy.Ins.ShrtName, + [HieLvl_CTR] = Gbl.Hierarchy.Ctr.ShrtName, + [HieLvl_DEG] = Gbl.Hierarchy.Deg.ShrtName, + [HieLvl_CRS] = Gbl.Hierarchy.Crs.ShrtName, + }; HTM_TxtF ("

", The_GetSuffix ()); + /***** Logo and text *****/ + HTM_DIV_Begin ("id=\"big_name_container\""); + + Frm_BeginFormGoTo (NextAction[Gbl.Hierarchy.Level]); + HTM_BUTTON_Submit_Begin (Txt_Actions[NextAction[Gbl.Hierarchy.Level]], + "class=\"BT_LINK ICO_HIGHLIGHT\""); + + HTM_DIV_Begin ("id=\"big_full_name\""); // Full name + Hie_DrawLogo (ShrtText[Gbl.Hierarchy.Level]); + HTM_Txt (FullText[Gbl.Hierarchy.Level]); + HTM_DIV_End (); + + HTM_DIV_Begin ("id=\"big_short_name\""); // Short name + Hie_DrawLogo (ShrtText[Gbl.Hierarchy.Level]); + HTM_Txt (ShrtText[Gbl.Hierarchy.Level]); + HTM_DIV_End (); + + HTM_BUTTON_End (); + Frm_EndForm (); + + HTM_DIV_End (); + + HTM_TxtF ("

"); + } + +/*****************************************************************************/ +/********************** Draw logo in the top of the page *********************/ +/*****************************************************************************/ + +static void Hie_DrawLogo (const char *ShrtText) + { + static HieLvl_Level_t LogoScope[HieLvl_NUM_LEVELS] = + { + [HieLvl_INS] = HieLvl_INS, + [HieLvl_CTR] = HieLvl_CTR, + [HieLvl_DEG] = HieLvl_DEG, + [HieLvl_CRS] = HieLvl_DEG, // Draw logo of degree + }; + static const long *LogoCode[HieLvl_NUM_LEVELS] = + { + [HieLvl_INS] = &Gbl.Hierarchy.Ins.InsCod, + [HieLvl_CTR] = &Gbl.Hierarchy.Ctr.CtrCod, + [HieLvl_DEG] = &Gbl.Hierarchy.Deg.DegCod, + [HieLvl_CRS] = &Gbl.Hierarchy.Deg.DegCod, + }; + /***** Logo *****/ switch (Gbl.Hierarchy.Level) { case HieLvl_SYS: // System - Ico_PutIcon ("swad64x64.png",Ico_UNCHANGED, - Cfg_PLATFORM_FULL_NAME,"ICO40x40 TOP_LOGO"); - break; + Ico_PutIcon ("swad64x64.png",Ico_UNCHANGED,ShrtText,"TOP_LOGO"); + break; case HieLvl_CTY: // Country - Cty_DrawCountryMap (&Gbl.Hierarchy.Cty,"COUNTRY_MAP_TITLE"); - break; - case HieLvl_INS: // Institution - Lgo_DrawLogo (HieLvl_INS,Gbl.Hierarchy.Ins.InsCod, - Gbl.Hierarchy.Ins.ShrtName,40,"TOP_LOGO",false); - break; - case HieLvl_CTR: // Center - Lgo_DrawLogo (HieLvl_CTR,Gbl.Hierarchy.Ctr.CtrCod, - Gbl.Hierarchy.Ctr.ShrtName,40,"TOP_LOGO",false); - break; - case HieLvl_DEG: // Degree - case HieLvl_CRS: // Course - Lgo_DrawLogo (HieLvl_DEG,Gbl.Hierarchy.Deg.DegCod, - Gbl.Hierarchy.Deg.ShrtName,40,"TOP_LOGO",false); - break; + Cty_DrawCountryMap (&Gbl.Hierarchy.Cty,"TOP_LOGO"); + break; default: + Lgo_DrawLogo (LogoScope[Gbl.Hierarchy.Level], + *LogoCode[Gbl.Hierarchy.Level], + ShrtText,40,"TOP_LOGO", + false); // Don't put icon if not exists break; } - - /***** Text *****/ - HTM_DIV_Begin ("id=\"big_name_container\""); - if (Gbl.Hierarchy.Cty.CtyCod > 0) - { - HTM_DIV_Begin ("id=\"big_full_name\""); - HTM_Txt ( (Gbl.Hierarchy.Level == HieLvl_CRS) ? Gbl.Hierarchy.Crs.FullName :// Full name - ((Gbl.Hierarchy.Level == HieLvl_DEG) ? Gbl.Hierarchy.Deg.FullName : - ((Gbl.Hierarchy.Level == HieLvl_CTR) ? Gbl.Hierarchy.Ctr.FullName : - ((Gbl.Hierarchy.Level == HieLvl_INS) ? Gbl.Hierarchy.Ins.FullName : - Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language])))); - HTM_DIV_End (); - - HTM_DIV_Begin ("class=\"NOT_SHOWN\""); - HTM_Txt (" / "); // To separate - HTM_DIV_End (); - - HTM_DIV_Begin ("id=\"big_short_name\""); - HTM_Txt ( (Gbl.Hierarchy.Level == HieLvl_CRS) ? Gbl.Hierarchy.Crs.ShrtName :// Short name - ((Gbl.Hierarchy.Level == HieLvl_DEG) ? Gbl.Hierarchy.Deg.ShrtName : - ((Gbl.Hierarchy.Level == HieLvl_CTR) ? Gbl.Hierarchy.Ctr.ShrtName : - ((Gbl.Hierarchy.Level == HieLvl_INS) ? Gbl.Hierarchy.Ins.ShrtName : - Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language])))); - HTM_DIV_End (); - } - else // No country specified ==> home page - { - HTM_DIV_Begin ("id=\"big_full_name\""); // Full name - HTM_TxtF ("%s: %s",Cfg_PLATFORM_SHORT_NAME,Txt_TAGLINE); - HTM_DIV_End (); - - HTM_DIV_Begin ("class=\"NOT_SHOWN\""); - HTM_Txt (" / "); // To separate - HTM_DIV_End (); - - HTM_DIV_Begin ("id=\"big_short_name\""); // Short name - HTM_Txt (Cfg_PLATFORM_SHORT_NAME); - HTM_DIV_End (); - } - HTM_DIV_End (); - HTM_TxtF (""); } /*****************************************************************************/ diff --git a/swad_logo.c b/swad_logo.c index ce46031f..9704c90e 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -57,7 +57,7 @@ static void Lgo_PutIconToRemoveLogoDeg (__attribute__((unused)) void *Args); static void Lgo_PutIconToRemoveLogo (Act_Action_t ActionRem); /*****************************************************************************/ -/****************************** Draw degree logo *****************************/ +/***************** Draw institution, center or degree logo *******************/ /*****************************************************************************/ void Lgo_DrawLogo (HieLvl_Level_t Scope,long Cod,const char *AltText, @@ -65,13 +65,9 @@ void Lgo_DrawLogo (HieLvl_Level_t Scope,long Cod,const char *AltText, { static const char *HieIcon[HieLvl_NUM_LEVELS] = { - [HieLvl_UNK] = "sitemap.svg", // not applicable here - [HieLvl_SYS] = "sitemap.svg", // not applicable here - [HieLvl_CTY] = "sitemap.svg", // not applicable here [HieLvl_INS] = "university.svg", [HieLvl_CTR] = "building.svg", [HieLvl_DEG] = "graduation-cap.svg", - [HieLvl_CRS] = "sitemap.svg", // not applicable here }; const char *Folder = NULL; // To avoid warning char PathLogo[PATH_MAX + 1]; @@ -167,16 +163,11 @@ void Lgo_DrawLogo (HieLvl_Level_t Scope,long Cod,const char *AltText, "", ClassNotEmpty ? Class : ""); - + free (Icon); + free (URL); } else - { - if (asprintf (&URL,"%s",Cfg_URL_ICON_PUBLIC) < 0) - Err_NotEnoughMemoryExit (); - if (asprintf (&Icon,"%s",HieIcon[Scope]) < 0) - Err_NotEnoughMemoryExit (); - - HTM_IMG (URL,Icon,AltText, + HTM_IMG (Cfg_URL_ICON_PUBLIC,HieIcon[Scope],AltText, "class=\"ICO%ux%u ICO_%s_%s" "%s%s\"", Size,Size, @@ -185,10 +176,6 @@ void Lgo_DrawLogo (HieLvl_Level_t Scope,long Cod,const char *AltText, "", ClassNotEmpty ? Class : ""); - } - - free (Icon); - free (URL); } } }