Version 16.146.7

This commit is contained in:
Antonio Cañas Vargas 2017-03-04 19:46:46 +01:00
parent 93c3979ce3
commit 89232aa72d
6 changed files with 67 additions and 60 deletions

View File

@ -1598,6 +1598,30 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
}
/************************** Map and name of country **************************/
.COUNTRY_SMALL
{
display:inline-block;
box-sizing:border-box;
max-width:300px;
margin-left:4px;
text-align:left;
vertical-align:middle;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.COUNTRY_TINY
{
display:inline-block;
box-sizing:border-box;
max-width:120px;
margin-left:4px;
text-align:left;
vertical-align:middle;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.COUNTRY_MAP_TITLE
{
box-sizing:border-box;
@ -1606,13 +1630,6 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
margin-right:10px;
vertical-align:top;
}
.COUNTRY_MAP_TINY
{
box-sizing:border-box;
width:20px;
height:20px;
vertical-align:middle;
}
.COUNTRY_MAP_SMALL
{
box-sizing:border-box;
@ -1620,6 +1637,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
height:64px;
vertical-align:middle;
}
.COUNTRY_MAP_TINY
{
box-sizing:border-box;
width:20px;
height:20px;
vertical-align:middle;
}
.COUNTRY_MAP_SHOW
{
box-sizing:border-box;
@ -1634,12 +1658,12 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
height:625px;
margin:12px;
}
.COUNTRY_TXT
/********************* List of my courses ************************************/
.MY_CRSS_LNK
{
display:inline-block;
box-sizing:border-box;
max-width:100px;
margin-left:4px;
max-width:500px;
text-align:left;
vertical-align:middle;
white-space:nowrap;

View File

@ -197,13 +197,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.146.6 (2017-03-04)"
#define Log_PLATFORM_VERSION "SWAD 16.146.7 (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.7: Mar 03, 2017 Changes in layout of my courses. (216339 lines)
Version 16.146.6: Mar 03, 2017 Changes in layout of countries. (216331 lines)
Version 16.146.5: Mar 03, 2017 Code refactoring related with author of assignments, attendance events and surveys. (216319 lines)
Version 16.146.4: Mar 03, 2017 Changes in layout of surveys. (216349 lines)

View File

@ -164,7 +164,9 @@ void Cty_SeeCtyWithPendingInss (void)
"<td class=\"LEFT_MIDDLE %s\">",
BgColor);
Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeIns,
"DAT_NOBR","COUNTRY_MAP_SMALL");
"COUNTRY_SMALL",
"COUNTRY_MAP_SMALL",
"DAT");
fprintf (Gbl.F.Out,"</td>");
/* Number of pending institutions (row[1]) */
@ -703,7 +705,9 @@ static void Cty_ListOneCountryForSeeing (struct Country *Cty,unsigned NumCty)
/***** Country map (and link to WWW if exists) *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE %s\">",BgColor);
Cty_DrawCountryMapAndNameWithLink (Cty,ActSeeIns,
"DAT_N","COUNTRY_MAP_SMALL");
"COUNTRY_SMALL",
"COUNTRY_MAP_SMALL",
"DAT_N");
fprintf (Gbl.F.Out,"</td>");
/* Write stats of this country */
@ -794,7 +798,9 @@ static unsigned Cty_GetNumUsrsWhoClaimToBelongToCty (long CtyCod)
/*****************************************************************************/
void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action,
const char *ClassLink,const char *ClassMap)
const char *ClassContainer,
const char *ClassMap,
const char *ClassLink)
{
extern const char *Txt_Go_to_X;
char CountryName[Cty_MAX_BYTES_COUNTRY_NAME + 1];
@ -802,6 +808,7 @@ void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action,
/***** Start form *****/
Act_FormGoToStart (Action);
Cty_PutParamCtyCod (Cty->CtyCod);
fprintf (Gbl.F.Out,"<div class=\"%s\">",ClassContainer);
/***** Link to action *****/
sprintf (Gbl.Title,Txt_Go_to_X,Cty->Name[Gbl.Prefs.Language]);
@ -813,8 +820,9 @@ void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action,
/***** Write country name and end link *****/
Str_Copy (CountryName,Cty->Name[Gbl.Prefs.Language],
Cty_MAX_BYTES_COUNTRY_NAME);
fprintf (Gbl.F.Out,"<div class=\"COUNTRY_TXT\">%s (%s)</div>"
"</a>",
fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;(%s)"
"</a>"
"</div>",
CountryName,
Cty->Alpha2);

View File

@ -84,7 +84,9 @@ void Cty_ListCountries1 (void);
void Cty_ListCountries2 (void);
void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action,
const char *ClassLink,const char *ClassMap);
const char *ClassContainer,
const char *ClassMap,
const char *ClassLink);
void Cty_DrawCountryMap (struct Country *Cty,const char *Class);
bool Cty_CheckIfCountryMapExists (struct Country *Cty);

View File

@ -519,10 +519,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
char InsFullName[Ins_MAX_LENGTH_INSTIT_FULL_NAME + 1];
char CtrFullName[Ctr_MAX_LENGTH_CENTRE_FULL_NAME + 1];
char DegFullName[Deg_MAX_LENGTH_DEGREE_FULL_NAME + 1];
char CrsFullName[Crs_MAX_LENGTH_COURSE_FULL_NAME + 1];
bool IsLastItemInLevel[1 + 5];
bool Highlight; // Highlight because degree, course, etc. is selected
MYSQL_RES *mysql_resCty;
@ -542,7 +538,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
unsigned NumCrs;
unsigned NumCrss;
char ActTxt[Act_MAX_LENGTH_ACTION_TXT + 1];
char PathRelRSSFile[PATH_MAX + 1];
const char *ClassNormal;
char ClassHighlight[64];
@ -631,7 +626,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to institution *****/
Highlight = (Gbl.CurrentCtr.Ctr.CtrCod <= 0 &&
Gbl.CurrentIns.Ins.InsCod == Ins.InsCod);
fprintf (Gbl.F.Out,"<li class=\"%s\" style=\"height:25px;\">",
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\" style=\"height:25px;\">",
Highlight ? ClassHighlight :
ClassNormal);
IsLastItemInLevel[2] = (NumIns == NumInss - 1);
@ -642,10 +637,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Highlight ? ClassHighlight :
ClassNormal,NULL);
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShrtName,20,NULL,true);
Str_Copy (InsFullName,Ins.FullName,
Ins_MAX_LENGTH_INSTIT_FULL_NAME);
Str_LimitLengthHTMLStr (InsFullName,Crs_MAX_BYTES_TXT_LINK);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",InsFullName);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Ins.FullName);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</li>");
@ -667,7 +659,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to centre *****/
Highlight = (Gbl.CurrentDeg.Deg.DegCod <= 0 &&
Gbl.CurrentCtr.Ctr.CtrCod == Ctr.CtrCod);
fprintf (Gbl.F.Out,"<li class=\"%s\" style=\"height:25px;\">",
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\" style=\"height:25px;\">",
Highlight ? ClassHighlight :
ClassNormal);
IsLastItemInLevel[3] = (NumCtr == NumCtrs - 1);
@ -678,10 +670,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Highlight ? ClassHighlight :
ClassNormal,NULL);
Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShrtName,20,NULL,true);
Str_Copy (CtrFullName,Ctr.FullName,
Ctr_MAX_LENGTH_CENTRE_FULL_NAME);
Str_LimitLengthHTMLStr (CtrFullName,Crs_MAX_BYTES_TXT_LINK);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",CtrFullName);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Ctr.FullName);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</li>");
@ -703,7 +692,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to degree *****/
Highlight = (Gbl.CurrentCrs.Crs.CrsCod <= 0 &&
Gbl.CurrentDeg.Deg.DegCod == Deg.DegCod);
fprintf (Gbl.F.Out,"<li class=\"%s\" style=\"height:25px;\">",
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\" style=\"height:25px;\">",
Highlight ? ClassHighlight :
ClassNormal);
IsLastItemInLevel[4] = (NumDeg == NumDegs - 1);
@ -714,10 +703,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Highlight ? ClassHighlight :
ClassNormal,NULL);
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShrtName,20,NULL,true);
Str_Copy (DegFullName,Deg.FullName,
Deg_MAX_LENGTH_DEGREE_FULL_NAME);
Str_LimitLengthHTMLStr (DegFullName,Crs_MAX_BYTES_TXT_LINK);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",DegFullName);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Deg.FullName);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</li>");
@ -738,7 +724,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to course *****/
Highlight = (Gbl.CurrentCrs.Crs.CrsCod == Crs.CrsCod);
fprintf (Gbl.F.Out,"<li class=\"%s\" style=\"height:25px;\">",
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\" style=\"height:25px;\">",
Highlight ? ClassHighlight :
ClassNormal);
IsLastItemInLevel[5] = (NumCrs == NumCrss - 1);
@ -751,30 +737,14 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
ClassNormal,NULL);
fprintf (Gbl.F.Out,"<img src=\"%s/dot64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />",
" class=\"ICO20x20\" />"
"&nbsp;%s"
"</a>",
Gbl.Prefs.IconsURL,
Crs.ShrtName,
Crs.FullName,
Crs.FullName);
Str_Copy (CrsFullName,Crs.FullName,
Crs_MAX_LENGTH_COURSE_FULL_NAME);
Str_LimitLengthHTMLStr (CrsFullName,Crs_MAX_BYTES_TXT_LINK);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",CrsFullName);
Act_FormEnd ();
/***** Write link to RSS file *****/
sprintf (PathRelRSSFile,"%s/%s/%ld/%s/%s",
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_RSS_FOLDER,Cfg_RSS_FILE);
if (!Fil_CheckIfPathExists (PathRelRSSFile))
RSS_UpdateRSSFileForACrs (&Crs);
fprintf (Gbl.F.Out," <a href=\"");
RSS_WriteRSSLink (Gbl.F.Out,Crs.CrsCod);
fprintf (Gbl.F.Out,"\" target=\"_blank\">"
"<img src=\"%s/rss16x16.gif\""
" alt=\"RSS\" title=\"RSS\""
" class=\"ICO20x20\" />"
"</a>",
Gbl.Prefs.IconsURL);
fprintf (Gbl.F.Out,"</li>");
}

View File

@ -3361,7 +3361,9 @@ static void Sta_WriteCountry (long CtyCod)
/***** Form to go to country *****/
Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeCtyInf,
"LOG","COUNTRY_MAP_TINY");
"COUNTRY_TINY",
"COUNTRY_MAP_TINY",
"LOG");
}
else // Hit with no country selected
/***** No country selected *****/