From d280fd6ecf5008ddb6c2f402c289958dac49a0cb Mon Sep 17 00:00:00 2001 From: acanas Date: Fri, 5 May 2023 10:40:56 +0200 Subject: [PATCH] Version 22.106: May 05, 2023 Changes in layoyt of frequent actions. --- css/swad22.105.css | 15 ++++----------- swad_HTML.c | 40 +++++++++++++++++++++++++++++++++++++++- swad_HTML.h | 2 +- swad_MFU.c | 24 ++++++++++++------------ swad_changelog.h | 3 ++- swad_text.c | 6 +++--- 6 files changed, 61 insertions(+), 29 deletions(-) diff --git a/css/swad22.105.css b/css/swad22.105.css index 13fcdd27..9d9e821a 100644 --- a/css/swad22.105.css +++ b/css/swad22.105.css @@ -1362,30 +1362,23 @@ a:hover /* Default ==> underlined */ { box-sizing:border-box; width:148px; - border-style:solid; - border-width:1px; - border-color:#8cbcce; padding:5px; - border-radius:2px; font-size:11pt; } #MFU_actions ul { display:inline-block; box-sizing:border-box; - width:138px; - margin:2px 0; - padding:6px 0 0 0; - border-style:solid; - border-width:1px 0 0 0; - border-color:rgba(140,188,206,0.2); + width:134px; + margin:0; + padding:0; list-style-type:none; text-align:left; vertical-align:middle; } #MFU_actions li { - width:138px; + width:134px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; diff --git a/swad_HTML.c b/swad_HTML.c index 9fadbf22..021fe58d 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -70,6 +70,7 @@ static unsigned HTM_DT_NestingLevel = 0; static unsigned HTM_DD_NestingLevel = 0; static unsigned HTM_A_NestingLevel = 0; static unsigned HTM_SCRIPT_NestingLevel = 0; +static unsigned HTM_FIELDSET_NestingLevel = 0; static unsigned HTM_LABEL_NestingLevel = 0; static unsigned HTM_BUTTON_NestingLevel = 0; static unsigned HTM_TEXTAREA_NestingLevel = 0; @@ -100,6 +101,8 @@ static void HTM_LI_BeginWithoutAttr (void); static void HTM_A_BeginWithoutAttr (void); +static void HTM_FIELDSET_BeginWithoutAttr (void); + static void HTM_LABEL_BeginWithoutAttr (void); static void HTM_TEXTAREA_BeginWithoutAttr (void); @@ -1001,14 +1004,49 @@ void HTM_PARAM (const char *Name, /********************************* Fieldsets *********************************/ /*****************************************************************************/ -void HTM_FIELDSET_Begin (void) +void HTM_FIELDSET_Begin (const char *fmt,...) + { + va_list ap; + int NumBytesPrinted; + char *Attr; + + if (fmt) + { + if (fmt[0]) + { + va_start (ap,fmt); + NumBytesPrinted = vasprintf (&Attr,fmt,ap); + va_end (ap); + if (NumBytesPrinted < 0) // -1 if no memory or any other error + Err_NotEnoughMemoryExit (); + + /***** Print HTML *****/ + HTM_TxtF ("
",Attr); + + free (Attr); + } + else + HTM_FIELDSET_BeginWithoutAttr (); + } + else + HTM_FIELDSET_BeginWithoutAttr (); + + HTM_FIELDSET_NestingLevel++; + } + +static void HTM_FIELDSET_BeginWithoutAttr (void) { HTM_Txt ("
"); } void HTM_FIELDSET_End (void) { + if (HTM_FIELDSET_NestingLevel == 0) // No FIELDSET open + Ale_ShowAlert (Ale_ERROR,"Trying to close unopened FIELDSET."); + HTM_Txt ("
"); + + HTM_FIELDSET_NestingLevel--; } void HTM_LEGEND (const char *Txt) diff --git a/swad_HTML.h b/swad_HTML.h index fdd7fa90..96f737e4 100644 --- a/swad_HTML.h +++ b/swad_HTML.h @@ -143,7 +143,7 @@ void HTM_SCRIPT_End (void); void HTM_PARAM (const char *Name, const char *fmt,...); -void HTM_FIELDSET_Begin (void); +void HTM_FIELDSET_Begin (const char *fmt,...); void HTM_FIELDSET_End (void); void HTM_LEGEND (const char *Txt); diff --git a/swad_MFU.c b/swad_MFU.c index 4074f37f..8c1065c8 100644 --- a/swad_MFU.c +++ b/swad_MFU.c @@ -249,7 +249,6 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) { - extern const char *Txt_My_frequent_actions; extern const char *Txt_Frequent_ACTIONS; extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; unsigned NumAct; @@ -259,15 +258,10 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) char MenuStr[MFU_MAX_BYTES_MENU + 1]; char TabMenuStr[MFU_MAX_BYTES_TAB + 6 + MFU_MAX_BYTES_MENU + 1]; - /***** Begin div and link *****/ - HTM_DIV_Begin ("id=\"MFU_actions\" class=\"MFU_%s\"", - The_GetSuffix ()); - - Frm_BeginForm (ActMFUAct); - HTM_BUTTON_Submit_Begin (Txt_My_frequent_actions,"class=\"BT_LINK\""); - HTM_TxtF ("%s",Txt_Frequent_ACTIONS); - HTM_BUTTON_End (); - Frm_EndForm (); + /***** Begin fieldset *****/ + HTM_FIELDSET_Begin ("id=\"MFU_actions\" class=\"MFU_%s\"", + The_GetSuffix ()); + HTM_LEGEND (Txt_Frequent_ACTIONS); /***** Begin list of frequently used actions *****/ HTM_UL_Begin (NULL); @@ -300,8 +294,14 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) /***** End list of frequently used actions *****/ HTM_UL_End (); - /***** End div *****/ - HTM_DIV_End (); + HTM_DIV_Begin ("class=\"CM\""); + Lay_PutContextualLinkOnlyIcon (ActMFUAct,NULL, + NULL,NULL, + "ellipsis-h.svg",Ico_BLACK); + HTM_DIV_End (); + + /***** End fieldset *****/ + HTM_FIELDSET_End (); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index c60afca0..9a8d75c1 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. */ -#define Log_PLATFORM_VERSION "SWAD 22.105 (2023-05-05)" +#define Log_PLATFORM_VERSION "SWAD 22.106 (2023-05-05)" #define CSS_FILE "swad22.105.css" #define JS_FILE "swad22.49.js" /* + Version 22.106: May 05, 2023 Changes in layoyt of frequent actions. (338126 lines) Version 22.105: May 05, 2023 Changes in CSS. (338102 lines) Version 22.104.6: May 04, 2023 Changes in projects. (338079 lines) Version 22.104.5: May 04, 2023 Fixed issue in indicators. (338079 lines) diff --git a/swad_text.c b/swad_text.c index 51d1092f..9858ad64 100644 --- a/swad_text.c +++ b/swad_text.c @@ -15434,7 +15434,7 @@ const char *Txt_Frequent_ACTIONS = // Check that this sentence fits within the a #elif L==5 // fr "Frequent"; #elif L==6 // gn - "Frecuentes"; // Okoteve traducción + "Jepiguáva"; #elif L==7 // it "Frequenti"; #elif L==8 // pl @@ -22778,7 +22778,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] = #elif L==5 // fr "Frequent" #elif L==6 // gn - "Frecuentes" // Okoteve traducción + "Jepiguáva" #elif L==7 // it "Frequenti" #elif L==8 // pl @@ -24710,7 +24710,7 @@ const char *Txt_My_frequent_actions = #elif L==5 // fr "Mes actions fréquentes"; #elif L==6 // gn - "Mis acciones frecuentes"; // Okoteve traducción + "Che rembiapo py'&ytilde;i"; #elif L==7 // it "Le mie azioni frequenti"; #elif L==8 // pl