mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-05 08:15:25 +02:00
Version 22.40: Oct 04, 2022 Link in main title.
This commit is contained in:
parent
4d9d5e7392
commit
8c29494413
|
@ -399,7 +399,7 @@ a:hover /* Default ==> underlined */
|
||||||
height:40px;
|
height:40px;
|
||||||
margin-right:10px;
|
margin-right:10px;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
vertical-align:top !important;
|
vertical-align:middle !important;
|
||||||
}
|
}
|
||||||
@media only screen and (max-width: 480px)
|
@media only screen and (max-width: 480px)
|
||||||
{ /* For mobile-phones */
|
{ /* For mobile-phones */
|
||||||
|
@ -523,7 +523,6 @@ a:hover /* Default ==> underlined */
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
margin:0 auto;
|
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
#big_full_name
|
#big_full_name
|
||||||
|
@ -545,7 +544,6 @@ a:hover /* Default ==> underlined */
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
margin:0 auto;
|
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2300,14 +2298,6 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
}
|
}
|
||||||
.COUNTRY_MAP_TITLE
|
|
||||||
{
|
|
||||||
box-sizing:border-box;
|
|
||||||
width:40px;
|
|
||||||
height:40px;
|
|
||||||
margin-right:10px;
|
|
||||||
vertical-align:top;
|
|
||||||
}
|
|
||||||
.COUNTRY_MAP_SMALL
|
.COUNTRY_MAP_SMALL
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
|
@ -2483,7 +2473,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
||||||
}
|
}
|
||||||
.ICO_HIGHLIGHT, .CHECKBOX_UNCHECKED
|
.ICO_HIGHLIGHT, .CHECKBOX_UNCHECKED
|
||||||
{
|
{
|
||||||
opacity:0.67;
|
opacity:0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ICO_HIGHLIGHT:hover, .CHECKBOX_UNCHECKED:hover, .CHECKBOX_CHECKED
|
.ICO_HIGHLIGHT:hover, .CHECKBOX_UNCHECKED:hover, .CHECKBOX_CHECKED
|
|
@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
|
||||||
|
|
||||||
TODO: Attach pdf files in multimedia.
|
TODO: Attach pdf files in multimedia.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 22.39.5 (2022-10-03)"
|
#define Log_PLATFORM_VERSION "SWAD 22.40 (2022-10-04)"
|
||||||
#define CSS_FILE "swad22.35.css"
|
#define CSS_FILE "swad22.40.css"
|
||||||
#define JS_FILE "swad21.100.js"
|
#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.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.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)
|
Version 22.39.3: Oct 03, 2022 Code refactoring in attendance events. (332519 lines)
|
||||||
|
|
141
swad_hierarchy.c
141
swad_hierarchy.c
|
@ -52,6 +52,8 @@ extern struct Globals Gbl;
|
||||||
/***************************** Private prototypes ****************************/
|
/***************************** Private prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Hie_DrawLogo (const char *ShrtText);
|
||||||
|
|
||||||
static Hie_StatusTxt_t Hie_GetStatusTxtFromStatusBits (Hie_Status_t Status);
|
static Hie_StatusTxt_t Hie_GetStatusTxtFromStatusBits (Hie_Status_t Status);
|
||||||
static Hie_Status_t Hie_GetStatusBitsFromStatusTxt (Hie_StatusTxt_t StatusTxt);
|
static Hie_Status_t Hie_GetStatusBitsFromStatusTxt (Hie_StatusTxt_t StatusTxt);
|
||||||
|
|
||||||
|
@ -410,78 +412,101 @@ void Hie_WriteHierarchyInBreadcrumb (void)
|
||||||
|
|
||||||
void Hie_WriteBigNameCtyInsCtrDegCrs (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 ("<h1 id=\"main_title\" class=\"MAIN_TITLE_%s\">",
|
HTM_TxtF ("<h1 id=\"main_title\" class=\"MAIN_TITLE_%s\">",
|
||||||
The_GetSuffix ());
|
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 ("</h1>");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********************** 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 *****/
|
/***** Logo *****/
|
||||||
switch (Gbl.Hierarchy.Level)
|
switch (Gbl.Hierarchy.Level)
|
||||||
{
|
{
|
||||||
case HieLvl_SYS: // System
|
case HieLvl_SYS: // System
|
||||||
Ico_PutIcon ("swad64x64.png",Ico_UNCHANGED,
|
Ico_PutIcon ("swad64x64.png",Ico_UNCHANGED,ShrtText,"TOP_LOGO");
|
||||||
Cfg_PLATFORM_FULL_NAME,"ICO40x40 TOP_LOGO");
|
|
||||||
break;
|
break;
|
||||||
case HieLvl_CTY: // Country
|
case HieLvl_CTY: // Country
|
||||||
Cty_DrawCountryMap (&Gbl.Hierarchy.Cty,"COUNTRY_MAP_TITLE");
|
Cty_DrawCountryMap (&Gbl.Hierarchy.Cty,"TOP_LOGO");
|
||||||
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;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Lgo_DrawLogo (LogoScope[Gbl.Hierarchy.Level],
|
||||||
|
*LogoCode[Gbl.Hierarchy.Level],
|
||||||
|
ShrtText,40,"TOP_LOGO",
|
||||||
|
false); // Don't put icon if not exists
|
||||||
break;
|
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 ("</h1>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
21
swad_logo.c
21
swad_logo.c
|
@ -57,7 +57,7 @@ static void Lgo_PutIconToRemoveLogoDeg (__attribute__((unused)) void *Args);
|
||||||
static void Lgo_PutIconToRemoveLogo (Act_Action_t ActionRem);
|
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,
|
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] =
|
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_INS] = "university.svg",
|
||||||
[HieLvl_CTR] = "building.svg",
|
[HieLvl_CTR] = "building.svg",
|
||||||
[HieLvl_DEG] = "graduation-cap.svg",
|
[HieLvl_DEG] = "graduation-cap.svg",
|
||||||
[HieLvl_CRS] = "sitemap.svg", // not applicable here
|
|
||||||
};
|
};
|
||||||
const char *Folder = NULL; // To avoid warning
|
const char *Folder = NULL; // To avoid warning
|
||||||
char PathLogo[PATH_MAX + 1];
|
char PathLogo[PATH_MAX + 1];
|
||||||
|
@ -167,16 +163,11 @@ void Lgo_DrawLogo (HieLvl_Level_t Scope,long Cod,const char *AltText,
|
||||||
"",
|
"",
|
||||||
ClassNotEmpty ? Class :
|
ClassNotEmpty ? Class :
|
||||||
"");
|
"");
|
||||||
|
free (Icon);
|
||||||
|
free (URL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
HTM_IMG (Cfg_URL_ICON_PUBLIC,HieIcon[Scope],AltText,
|
||||||
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,
|
|
||||||
"class=\"ICO%ux%u ICO_%s_%s"
|
"class=\"ICO%ux%u ICO_%s_%s"
|
||||||
"%s%s\"",
|
"%s%s\"",
|
||||||
Size,Size,
|
Size,Size,
|
||||||
|
@ -186,10 +177,6 @@ void Lgo_DrawLogo (HieLvl_Level_t Scope,long Cod,const char *AltText,
|
||||||
ClassNotEmpty ? Class :
|
ClassNotEmpty ? Class :
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
free (Icon);
|
|
||||||
free (URL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user