Version 22.21: Sep 22, 2022 Changes in layout of course program.

This commit is contained in:
acanas 2022-09-23 00:13:10 +02:00
parent 1dba1d82d9
commit 2cbcea8099
19 changed files with 84 additions and 66 deletions

View File

@ -1707,40 +1707,40 @@ a:hover img.CENTER_PHOTO_SHOW
.PRG_TIT_1_PURPLE,
.PRG_TIT_1_BLUE,
.PRG_TIT_1_YELLOW,
.PRG_TIT_1_PINK {color:#202020; font-size:20pt; font-weight:bold;}
.PRG_TIT_1_DARK {color:#e0e0e0; font-size:20pt; font-weight:bold;}
.PRG_TIT_1_PINK {color:#4d88a1; font-size:20pt; font-weight:bold;}
.PRG_TIT_1_DARK {color:#afc4cc; font-size:20pt; font-weight:bold;}
.PRG_TIT_2_WHITE,
.PRG_TIT_2_GREY,
.PRG_TIT_2_PURPLE,
.PRG_TIT_2_BLUE,
.PRG_TIT_2_YELLOW,
.PRG_TIT_2_PINK {color:#202020; font-size:18pt; font-weight:bold;}
.PRG_TIT_2_DARK {color:#e0e0e0; font-size:18pt; font-weight:bold;}
.PRG_TIT_2_PINK {color:#4d88a1; font-size:18pt; font-weight:bold;}
.PRG_TIT_2_DARK {color:#afc4cc; font-size:18pt; font-weight:bold;}
.PRG_TIT_3_WHITE,
.PRG_TIT_3_GREY,
.PRG_TIT_3_PURPLE,
.PRG_TIT_3_BLUE,
.PRG_TIT_3_YELLOW,
.PRG_TIT_3_PINK {color:#202020; font-size:16pt; font-weight:bold;}
.PRG_TIT_3_DARK {color:#e0e0e0; font-size:16pt; font-weight:bold;}
.PRG_TIT_3_PINK {color:#4d88a1; font-size:16pt; font-weight:bold;}
.PRG_TIT_3_DARK {color:#afc4cc; font-size:16pt; font-weight:bold;}
.PRG_TIT_4_WHITE,
.PRG_TIT_4_GREY,
.PRG_TIT_4_PURPLE,
.PRG_TIT_4_BLUE,
.PRG_TIT_4_YELLOW,
.PRG_TIT_4_PINK {color:#202020; font-size:14pt; font-weight:bold;}
.PRG_TIT_4_DARK {color:#e0e0e0; font-size:14pt; font-weight:bold;}
.PRG_TIT_4_PINK {color:#4d88a1; font-size:14pt; font-weight:bold;}
.PRG_TIT_4_DARK {color:#afc4cc; font-size:14pt; font-weight:bold;}
.PRG_TIT_5_WHITE,
.PRG_TIT_5_GREY,
.PRG_TIT_5_PURPLE,
.PRG_TIT_5_BLUE,
.PRG_TIT_5_YELLOW,
.PRG_TIT_5_PINK {color:#202020; font-size:13pt; font-weight:bold;}
.PRG_TIT_5_DARK {color:#e0e0e0; font-size:13pt; font-weight:bold;}
.PRG_TIT_5_PINK {color:#4d88a1; font-size:13pt; font-weight:bold;}
.PRG_TIT_5_DARK {color:#afc4cc; font-size:13pt; font-weight:bold;}
.PRG_TXT_WHITE,
.PRG_TXT_GREY,
@ -1793,6 +1793,14 @@ a:hover img.CENTER_PHOTO_SHOW
width:360px;
}
.PRG_LNK_WHITE {color:#4d88a1; font-size:13pt;}
.PRG_LNK_GREY {color:#4d88a1; font-size:13pt;}
.PRG_LNK_PURPLE {color:#4d88a1; font-size:13pt;}
.PRG_LNK_BLUE {color:#4d88a1; font-size:13pt;}
.PRG_LNK_YELLOW {color:#7c4d2a; font-size:13pt;}
.PRG_LNK_PINK {color:#4d88a1; font-size:13pt;}
.PRG_LNK_DARK {color:#afc4cc; font-size:13pt;}
/************************* Program resource clipboard ************************/
.PRG_CLIPBOARD
{

View File

@ -93,7 +93,7 @@ void AsgRsc_WriteAssignmentInCrsProgram (long AsgCod,bool PutFormToGo,
// TODO: In the listing of assignments, the page is always the first.
// The page should be that corresponding to the selected assignment.
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneAsg],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -3343,7 +3343,7 @@ void AttRsc_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo,
Att_PutParamAttCod (AttCod);
Att_PutParamsCodGrps (AttCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneAtt],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -5378,7 +5378,7 @@ void Brw_GetLinkToFile (void)
/*****************************************************************************/
void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
struct FileMetadata FileMetadata;
@ -5396,7 +5396,7 @@ void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
Brw_IS_UNKNOWN, // Not used
FileMetadata.FilCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActReqDatSeeDocCrs],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}
@ -5435,7 +5435,7 @@ void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
/*****************************************************************************/
void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
struct FileMetadata FileMetadata;
@ -5453,7 +5453,7 @@ void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
Brw_IS_UNKNOWN, // Not used
FileMetadata.FilCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActReqDatSeeMrkCrs],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -258,9 +258,9 @@ void Brw_SetFullPathInTree (void);
//--------------------------- Program resources -------------------------------
void Brw_GetLinkToFile (void);
void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void BrwRsc_GetFileNameFromFilCod (long FilCod,char *FileName,size_t FileNameSize);
//-----------------------------------------------------------------------------

View File

@ -1734,7 +1734,7 @@ void Cfe_GetLinkToCallForExam (void)
/*****************************************************************************/
void CfeRsc_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
struct Cfe_CallsForExams CallsForExams;
@ -1758,7 +1758,7 @@ void CfeRsc_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
Frm_BeginFormAnchor (ActSeeOneCfe,Anchor);
Cfe_PutHiddenParamExaCod (ExaCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneCfe],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
/* Free anchor string */

View File

@ -129,7 +129,7 @@ void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY
//--------------------------- Program resources -------------------------------
void Cfe_GetLinkToCallForExam (void);
void CfeRsc_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void CfeRsc_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
#endif

View File

@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
TODO: Attach pdf files in multimedia.
*/
#define Log_PLATFORM_VERSION "SWAD 22.20 (2022-09-22)"
#define CSS_FILE "swad22.18.css"
#define Log_PLATFORM_VERSION "SWAD 22.21 (2022-09-22)"
#define CSS_FILE "swad22.21.css"
#define JS_FILE "swad21.100.js"
/*
Version 22.21: Sep 22, 2022 Changes in layout of course program. (331855 lines)
Version 22.20: Sep 22, 2022 Hidden items are not shown in program. (331838 lines)
Copy the following icon to icon public directory:
sudo cp icon/check-circle.svg /var/www/html/swad/icon/

View File

@ -1678,7 +1678,7 @@ void Exa_GetLinkToExam (void)
/*****************************************************************************/
void ExaRsc_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Gam_MAX_BYTES_TITLE + 1];
@ -1692,7 +1692,7 @@ void ExaRsc_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
Frm_BeginForm (ActSeeExa);
Exa_PutParamExamCod (ExaCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeExa],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -90,7 +90,7 @@ void Exa_GetAndShowExamsStats (void);
//--------------------------- Program resources -------------------------------
void Exa_GetLinkToExam (void);
void ExaRsc_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void ExaRsc_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
#endif

View File

@ -3555,7 +3555,7 @@ void For_GetLinkToThread (void)
/*****************************************************************************/
void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
struct For_Forums Forums;
@ -3579,7 +3579,7 @@ void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
Frm_BeginFormAnchor (ActSeePstForCrsUsr,For_FORUM_POSTS_SECTION_ID);
For_PutAllHiddenParamsNewPost (&Forums);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeePstForCrsUsr],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -153,7 +153,7 @@ void For_GetAndShowForumStats (void);
//--------------------------- Program resources -------------------------------
void For_GetLinkToThread (void);
void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void ForRsc_GetTitleFromThrCod (long ThrCod,char *Title,size_t TitleSize);
#endif

View File

@ -2388,7 +2388,7 @@ void Gam_GetLinkToGame (void)
/*****************************************************************************/
void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Gam_MAX_BYTES_TITLE + 1];
@ -2402,7 +2402,7 @@ void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
Frm_BeginForm (ActSeeGam);
Gam_PutParamGameCod (GamCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeGam],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -170,7 +170,7 @@ void Gam_GetAndShowGamesStats (void);
//--------------------------- Program resources -------------------------------
void Gam_GetLinkToGame (void);
void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void GamRsc_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize);
#endif

View File

@ -592,37 +592,36 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
HTM_TD_End ();
/***** Start/end date/time *****/
switch (ListingType)
{
case Prg_PRINT:
HTM_TD_Begin ("class=\"PRG_DATE RT\"");
break;
default:
HTM_TD_Begin ("class=\"PRG_DATE RT %s\"",The_GetColorRows ());
break;
}
UniqueId++;
for (StartEndTime = (Dat_StartEndTime_t) 0;
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
StartEndTime++)
{
if (asprintf (&Id,"scd_date_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
Err_NotEnoughMemoryExit ();
switch (ListingType)
{
case Prg_PRINT:
HTM_TD_Begin ("class=\"PRG_DATE LT\"");
break;
default:
HTM_TD_Begin ("class=\"PRG_DATE LT %s\"",The_GetColorRows ());
break;
}
HTM_DIV_Begin ("id=\"%s\" class=\"%s_%s%s\"",
Id,
Item->Open ? "DATE_GREEN" :
"DATE_RED",
The_GetSuffix (),
IsHidden ? " PRG_HIDDEN" :
"");
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
Gbl.Prefs.DateFormat,Dat_SEPARATOR_BREAK,
true,true,true,0x7);
HTM_DIV_End ();
HTM_TD_End ();
HTM_DIV_Begin ("id=\"%s\" class=\"%s_%s%s\"",
Id,
Item->Open ? "DATE_GREEN" :
"DATE_RED",
The_GetSuffix (),
IsHidden ? " PRG_HIDDEN" :
"");
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
true,true,true,0x7);
HTM_DIV_End ();
free (Id);
}
HTM_TD_End ();
/***** End row *****/
HTM_TR_End ();
@ -631,7 +630,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
HTM_TR_Begin (NULL);
/* Begin text and resources */
ColSpan += 2;
ColSpan++;
switch (ListingType)
{
case Prg_PRINT:
@ -1330,6 +1329,11 @@ void Prg_ResetItem (struct Prg_Item *Item)
Item->TimeUTC[Dat_END_TIME] = (time_t) 0;
Item->Open = false;
Item->Title[0] = '\0';
Prg_ResetResource (Item);
}
void Prg_ResetResource (struct Prg_Item *Item)
{
Item->Resource.Hierarchy.RscCod = -1L;
Item->Resource.Hierarchy.RscInd = 0;
Item->Resource.Hierarchy.Hidden = false;

View File

@ -162,6 +162,7 @@ void Prg_GetListItems (void);
void Prg_FreeListItems (void);
void Prg_ResetItem (struct Prg_Item *Item);
void Prg_ResetResource (struct Prg_Item *Item);
unsigned Prg_GetNumItemFromItmCod (long ItmCod);
long Prg_GetItmCodFromNumItem (unsigned NumItem);

View File

@ -280,9 +280,12 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
/***** Form to create a new resource *****/
if (EditingResourcesOfThisItem)
{
Prg_ResetResource (Item);
PrgRsc_WriteRowNewResource (NumResources,Item,
(ListingType == Prg_EDIT_RESOURCE_LINK &&
SelectedRscCod <= 0)); // Edit this link?
Item->Resource.Hierarchy.RscCod == SelectedRscCod)); // Edit this link?
}
/***** End table *****/
HTM_TBODY_End ();
@ -406,14 +409,14 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
HTM_TD_End ();
/***** Title *****/
HTM_TD_Begin ("class=\"PRG_MAIN PRG_RSC_%s %s\"",
HTM_TD_Begin ("class=\"PRG_MAIN LT PRG_RSC_%s %s\"",
The_GetSuffix (),The_GetColorRows1 (1));
HTM_Txt (Item->Resource.Title);
HTM_BR ();
PrgRsc_WriteLinkName (&Item->Resource.Link,
true, // Put form
Prg_ResourceTypesIcons[Item->Resource.Link.Type],
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
true, // Put form
Prg_ResourceTypesIcons[Item->Resource.Link.Type],
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
HTM_TD_End ();
/***** End row *****/
@ -438,13 +441,14 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
HTM_TD_End ();
/***** Resource number *****/
HTM_TD_Begin ("class=\"PRG_NUM PRG_RSC_%s RT %s\"",
HTM_TD_Begin ("class=\"PRG_NUM LT PRG_RSC_%s RT %s\"",
The_GetSuffix (),The_GetColorRows1 (1));
HTM_Unsigned (NumRsc + 1);
HTM_TD_End ();
/***** Title and link/clipboard *****/
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
HTM_TD_Begin ("class=\"PRG_MAIN LT PRG_RSC_%s %s\"",
The_GetSuffix (),The_GetColorRows1 (1));
/* Title */
Frm_BeginFormAnchor (ActRenPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
@ -941,7 +945,7 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
HTM_LI_Begin ("class=\"DAT_%s\"",The_GetSuffix ());
HTM_LI_Begin ("class=\"PRG_RSC_%s\"",The_GetSuffix ());
HTM_LABEL_Begin (NULL);
/***** Radio selector *****/

View File

@ -3490,7 +3490,7 @@ void Svy_GetLinkToSurvey (void)
/*****************************************************************************/
void SvyRsc_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
const char *Icon,const char *IconTitle)
const char *Icon,const char *IconTitle)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Svy_MAX_BYTES_SURVEY_TITLE + 1];
@ -3504,7 +3504,7 @@ void SvyRsc_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
Frm_BeginForm (ActSeeSvy);
Svy_PutParamSvyCod (SvyCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeSvy],
"class=\"LM BT_LINK PRG_RSC_%s\"",
"class=\"LM BT_LINK PRG_LNK_%s\"",
The_GetSuffix ());
}

View File

@ -120,6 +120,6 @@ void Svy_GetAndShowSurveysStats (void);
//--------------------------- Program resources -------------------------------
void Svy_GetLinkToSurvey (void);
void SvyRsc_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
const char *Icon,const char *IconTitle);
const char *Icon,const char *IconTitle);
void SvyRsc_GetTitleFromSvyCod (long SvyCod,char *Title,size_t TitleSize);
#endif