Version19.90.2

This commit is contained in:
Antonio Cañas Vargas 2019-12-13 01:04:09 +01:00
parent 42bf6362da
commit ba510a38e7
3 changed files with 98 additions and 53 deletions

View File

@ -490,13 +490,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.90.1 (2019-12-12)"
#define Log_PLATFORM_VERSION "SWAD 19.90.2 (2019-12-13)"
#define CSS_FILE "swad19.90.1.css"
#define JS_FILE "swad19.90.js"
/*
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// TODO: Impedir la creación y edición de proyectos si no son editables.
Version 19.90.2: Dec 13, 2019 Code refactoring in matches. (248427 lines)
Version 19.90.1: Dec 12, 2019 Changes in CSS. (248391 lines)
Version 19.90: Dec 12, 2019 Hourglass to start countdown. (248373 lines)
2 changes necessary in database:

View File

@ -61,6 +61,10 @@ extern struct Globals Gbl;
#define Mch_ICON_NEXT "fas fa-step-forward"
#define Mch_ICON_RESULTS "fas fa-chart-bar"
#define Mch_COUNTDOWN_SECONDS_LARGE 60
#define Mch_COUNTDOWN_SECONDS_MEDIUM 30
#define Mch_COUNTDOWN_SECONDS_SMALL 10
/*****************************************************************************/
/******************************* Private types *******************************/
/*****************************************************************************/
@ -164,8 +168,8 @@ static void Mch_ShowRefreshablePartTch (struct Match *Match);
static void Mch_WriteElapsedTimeInMch (struct Match *Match);
static void Mch_WriteElapsedTimeInQst (struct Match *Match);
static void Mch_WriteHourglass (struct Match *Match);
static void Mch_PutFormCountdown (struct Match *Match,long Countdown,
const char *Class,const char *Txt);
static void Mch_PutFormCountdown (struct Match *Match,long Countdown,const char *Color);
static void Mch_PutHourglassIconAndCountdown (struct Match *Match);
static void Mch_WriteNumRespondersQst (struct Match *Match);
static void Mch_ShowRightColumnTch (const struct Match *Match);
@ -2283,65 +2287,25 @@ static void Mch_WriteElapsedTimeInQst (struct Match *Match)
static void Mch_WriteHourglass (struct Match *Match)
{
const char *Class;
const char *Icon;
/***** Start container *****/
HTM_DIV_Begin ("class=\"MCH_SHOW_HOURGLASS\"");
/***** Put forms to start countdown *****/
Mch_PutFormCountdown (Match,-1L,"MCH_GREEN" ," ∞ ");
Mch_PutFormCountdown (Match,60L,"MCH_LIMEGREEN"," 60″" );
Mch_PutFormCountdown (Match,30L,"MCH_YELLOW" ," 30″" );
Mch_PutFormCountdown (Match,10L,"MCH_RED" ," 10″" );
Mch_PutFormCountdown (Match,-1 ,"MCH_GREEN" );
Mch_PutFormCountdown (Match,Mch_COUNTDOWN_SECONDS_LARGE ,"MCH_LIMEGREEN");
Mch_PutFormCountdown (Match,Mch_COUNTDOWN_SECONDS_MEDIUM,"MCH_YELLOW" );
Mch_PutFormCountdown (Match,Mch_COUNTDOWN_SECONDS_SMALL ,"MCH_RED" );
/***** Set hourglass icon depending on countdown *****/
if (Match->Status.Showing == Mch_END) // Match over
{
Class = "BT_LINK_OFF MCH_BUTTON_HIDDEN MCH_GREEN";
Icon = "fa-hourglass-start";
}
else if (Match->Status.Countdown < 0) // No countdown
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_GREEN";
Icon = "fa-hourglass-start";
}
else if (Match->Status.Countdown > 30) // Countdown in progress
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_LIMEGREEN";
Icon = "fa-hourglass-start";
}
else if (Match->Status.Countdown > 10) // Countdown in progress
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_YELLOW";
Icon = "fa-hourglass-half";
}
else // Countdown about to end
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_RED";
Icon = "fa-hourglass-end";
}
/***** Put icon with link *****/
HTM_BR ();
HTM_DIV_Begin ("class=\"MCH_BIGBUTTON_CONT\"");
HTM_BUTTON_BUTTON_Begin ("Cuenta atr&aacute;s",Class,NULL); // TODO: Need translation!!!!
HTM_TxtF ("<i class=\"fas %s\"></i>",Icon);
HTM_BR ();
if (Match->Status.Countdown > 0)
HTM_TxtF ("&nbsp;%02ld&Prime;",Match->Status.Countdown);
else
HTM_NBSP ();
HTM_BUTTON_End ();
HTM_DIV_End ();
/***** Put icon hourglass and write countdown *****/
Mch_PutHourglassIconAndCountdown (Match);
/***** End container *****/
HTM_DIV_End ();
}
static void Mch_PutFormCountdown (struct Match *Match,long Countdown,
const char *Color,const char *Txt)
static void Mch_PutFormCountdown (struct Match *Match,long Countdown,const char *Color)
{
extern const char *Txt_Countdown;
char *Class;
bool PutForm = Match->Status.Showing != Mch_END;
@ -2365,12 +2329,19 @@ static void Mch_PutFormCountdown (struct Match *Match,long Countdown,
/***** Put icon *****/
HTM_DIV_Begin ("class=\"MCH_SMALLBUTTON_CONT\"");
if (PutForm)
HTM_BUTTON_OnMouseDown_Begin ("Cuenta atr&aacute;s",Class); // TODO: Need translation!!!!
HTM_BUTTON_OnMouseDown_Begin (Txt_Countdown,Class);
else
HTM_BUTTON_BUTTON_Begin (NULL,Class,NULL);
HTM_Txt (Txt);
if (Countdown >= 0)
HTM_TxtF ("&nbsp;%ld&Prime;",Countdown);
else
HTM_Txt ("&nbsp;&infin;&nbsp;");
HTM_BUTTON_End ();
HTM_DIV_End ();
/***** Free class *****/
@ -2381,6 +2352,57 @@ static void Mch_PutFormCountdown (struct Match *Match,long Countdown,
Frm_EndForm ();
}
static void Mch_PutHourglassIconAndCountdown (struct Match *Match)
{
extern const char *Txt_Countdown;
const char *Class;
const char *Icon;
/***** Set hourglass icon depending on countdown *****/
if (Match->Status.Showing == Mch_END) // Match over
{
Class = "BT_LINK_OFF MCH_BUTTON_HIDDEN MCH_GREEN";
Icon = "fa-hourglass-start";
}
else if (Match->Status.Countdown < 0) // No countdown
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_GREEN";
Icon = "fa-hourglass-start";
}
else if (Match->Status.Countdown > Mch_COUNTDOWN_SECONDS_MEDIUM) // Countdown in progress
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_LIMEGREEN";
Icon = "fa-hourglass-start";
}
else if (Match->Status.Countdown > Mch_COUNTDOWN_SECONDS_SMALL) // Countdown in progress
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_YELLOW";
Icon = "fa-hourglass-half";
}
else // Countdown about to end
{
Class = "BT_LINK_OFF MCH_BUTTON_OFF MCH_RED";
Icon = "fa-hourglass-end";
}
/***** Put hourglass icon with countdown *****/
HTM_BR ();
HTM_DIV_Begin ("class=\"MCH_BIGBUTTON_CONT\"");
HTM_BUTTON_BUTTON_Begin (Txt_Countdown,Class,NULL);
HTM_TxtF ("<i class=\"fas %s\"></i>",Icon);
HTM_BR ();
if (Match->Status.Countdown > 0)
HTM_TxtF ("&nbsp;%02ld&Prime;",Match->Status.Countdown);
else
HTM_NBSP ();
HTM_BUTTON_End ();
HTM_DIV_End ();
}
/*****************************************************************************/
/*************** Write number of responders to a match question **************/
/*****************************************************************************/
static void Mch_WriteNumRespondersQst (struct Match *Match)
{
extern const char *Txt_MATCH_respond;

View File

@ -4816,6 +4816,28 @@ const char *Txt_Could_not_detect_any_face_in_front_position_ =
"N&atilde;o foi poss&iacute;vel detectar nenhum rosto na posi&ccedil;&atilde;o frontal.";
#endif
const char *Txt_Countdown =
#if L==1 // ca
"Compte enrere";
#elif L==2 // de
"Countdown";
#elif L==3 // en
"Countdown";
#elif L==4 // es
"Cuenta atr&aacute;s";
#elif L==5 // fr
"Compte &agrave; rebours";
#elif L==6 // gn
"Cuenta atr&aacute;s"; // Okoteve traducción
#elif L==7 // it
"Conto alla rovescia";
#elif L==8 // pl
"Odliczanie";
#elif L==9 // pt
"Contagem regressiva";
#endif
const char *Txt_Countries =
#if L==1 // ca
"Pa&iuml;sos";