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 **************************/ /************************** 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 .COUNTRY_MAP_TITLE
{ {
box-sizing:border-box; box-sizing:border-box;
@ -1606,13 +1630,6 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
margin-right:10px; margin-right:10px;
vertical-align:top; vertical-align:top;
} }
.COUNTRY_MAP_TINY
{
box-sizing:border-box;
width:20px;
height:20px;
vertical-align:middle;
}
.COUNTRY_MAP_SMALL .COUNTRY_MAP_SMALL
{ {
box-sizing:border-box; box-sizing:border-box;
@ -1620,6 +1637,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
height:64px; height:64px;
vertical-align:middle; vertical-align:middle;
} }
.COUNTRY_MAP_TINY
{
box-sizing:border-box;
width:20px;
height:20px;
vertical-align:middle;
}
.COUNTRY_MAP_SHOW .COUNTRY_MAP_SHOW
{ {
box-sizing:border-box; box-sizing:border-box;
@ -1634,12 +1658,12 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
height:625px; height:625px;
margin:12px; margin:12px;
} }
.COUNTRY_TXT
/********************* List of my courses ************************************/
.MY_CRSS_LNK
{ {
display:inline-block;
box-sizing:border-box; box-sizing:border-box;
max-width:100px; max-width:500px;
margin-left:4px;
text-align:left; text-align:left;
vertical-align:middle; vertical-align:middle;
white-space:nowrap; white-space:nowrap;

View File

@ -197,13 +197,14 @@
/****************************** Public constants *****************************/ /****************************** 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 CSS_FILE "swad16.146.css"
#define JS_FILE "swad16.144.js" #define JS_FILE "swad16.144.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // 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.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.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) 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\">", "<td class=\"LEFT_MIDDLE %s\">",
BgColor); BgColor);
Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeIns, Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeIns,
"DAT_NOBR","COUNTRY_MAP_SMALL"); "COUNTRY_SMALL",
"COUNTRY_MAP_SMALL",
"DAT");
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Number of pending institutions (row[1]) */ /* 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) *****/ /***** Country map (and link to WWW if exists) *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE %s\">",BgColor); fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE %s\">",BgColor);
Cty_DrawCountryMapAndNameWithLink (Cty,ActSeeIns, Cty_DrawCountryMapAndNameWithLink (Cty,ActSeeIns,
"DAT_N","COUNTRY_MAP_SMALL"); "COUNTRY_SMALL",
"COUNTRY_MAP_SMALL",
"DAT_N");
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write stats of this country */ /* 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, 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; extern const char *Txt_Go_to_X;
char CountryName[Cty_MAX_BYTES_COUNTRY_NAME + 1]; char CountryName[Cty_MAX_BYTES_COUNTRY_NAME + 1];
@ -802,6 +808,7 @@ void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action,
/***** Start form *****/ /***** Start form *****/
Act_FormGoToStart (Action); Act_FormGoToStart (Action);
Cty_PutParamCtyCod (Cty->CtyCod); Cty_PutParamCtyCod (Cty->CtyCod);
fprintf (Gbl.F.Out,"<div class=\"%s\">",ClassContainer);
/***** Link to action *****/ /***** Link to action *****/
sprintf (Gbl.Title,Txt_Go_to_X,Cty->Name[Gbl.Prefs.Language]); 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 *****/ /***** Write country name and end link *****/
Str_Copy (CountryName,Cty->Name[Gbl.Prefs.Language], Str_Copy (CountryName,Cty->Name[Gbl.Prefs.Language],
Cty_MAX_BYTES_COUNTRY_NAME); Cty_MAX_BYTES_COUNTRY_NAME);
fprintf (Gbl.F.Out,"<div class=\"COUNTRY_TXT\">%s (%s)</div>" fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;(%s)"
"</a>", "</a>"
"</div>",
CountryName, CountryName,
Cty->Alpha2); Cty->Alpha2);

View File

@ -84,7 +84,9 @@ void Cty_ListCountries1 (void);
void Cty_ListCountries2 (void); void Cty_ListCountries2 (void);
void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action, 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); void Cty_DrawCountryMap (struct Country *Cty,const char *Class);
bool Cty_CheckIfCountryMapExists (struct Country *Cty); bool Cty_CheckIfCountryMapExists (struct Country *Cty);

View File

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

View File

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