mirror of https://github.com/acanas/swad-core.git
Version 23.50.1: Nov 28, 2023 Responsive design in announcements and notices.
This commit is contained in:
parent
33cd1e8bfe
commit
ae559a39c2
|
@ -1925,7 +1925,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
|||
/********************************** Notice ***********************************/
|
||||
.NOTICE_CONT
|
||||
{
|
||||
padding:10px 0;
|
||||
padding:4px;
|
||||
}
|
||||
.NOTICE_HIGHLIGHT {animation:fadeinnotice 2s linear forwards;}
|
||||
@keyframes fadeinnotice
|
|
@ -103,8 +103,6 @@ static void HTM_TEXTAREA_BeginWithoutAttr (void);
|
|||
|
||||
static void HTM_SELECT_BeginWithoutAttr (void);
|
||||
|
||||
static void HTM_SPTxt (const char *Txt);
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************* Begin/end title *****************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1922,7 +1920,7 @@ void HTM_TxtF (const char *fmt,...)
|
|||
}
|
||||
}
|
||||
|
||||
static void HTM_SPTxt (const char *Txt)
|
||||
void HTM_SPTxt (const char *Txt)
|
||||
{
|
||||
HTM_Txt (" ");
|
||||
HTM_Txt (Txt);
|
||||
|
|
|
@ -222,6 +222,7 @@ void HTM_U_End (void);
|
|||
void HTM_BR (void);
|
||||
|
||||
void HTM_TxtF (const char *fmt,...);
|
||||
void HTM_SPTxt (const char *Txt);
|
||||
void HTM_Txt (const char *Txt);
|
||||
void HTM_TxtColon (const char *Txt);
|
||||
void HTM_TxtSemicolon (const char *Txt);
|
||||
|
|
|
@ -107,7 +107,7 @@ void Ann_ShowAllAnnouncements (void)
|
|||
NumAnnouncements = Ann_DB_GetAnnouncementsForUnknownUsers (&mysql_res);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin ("550px",Txt_Announcements,
|
||||
Box_BoxBegin (NULL,Txt_Announcements,
|
||||
ICanEdit ? Ann_PutIconToAddNewAnnouncement :
|
||||
NULL,NULL,
|
||||
Hlp_COMMUNICATION_Announcements,Box_NOT_CLOSABLE);
|
||||
|
@ -243,66 +243,68 @@ static void Ann_DrawAnAnnouncement (struct Ann_Announcement *Announcement,
|
|||
bool SomeRolesAreSelected;
|
||||
|
||||
/***** Begin yellow note *****/
|
||||
HTM_DIV_Begin ("class=\"%s\"",ContainerClass[Announcement->Status]);
|
||||
HTM_DIV_Begin ("class=\"NOTICE_CONT\"");
|
||||
HTM_DIV_Begin ("class=\"%s\"",ContainerClass[Announcement->Status]);
|
||||
|
||||
if (ICanEdit == Ann_I_CAN_EDIT)
|
||||
{
|
||||
/***** Icon to remove announcement *****/
|
||||
Ico_PutContextualIconToRemove (ActRemAnn,NULL,
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod);
|
||||
|
||||
/***** Icon to hide/unhide the announcement *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,NULL, // TODO: Put anchor
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod,
|
||||
Announcement->Status == Ann_OBSOLETE_ANNOUNCEMENT ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE);
|
||||
}
|
||||
|
||||
/***** Write the subject of the announcement *****/
|
||||
HTM_DIV_Begin ("class=\"NOTICE_SUBJECT NOTICE_SUBJECT_%s\"",
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Announcement->Subject);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Write the content of the announcement *****/
|
||||
HTM_DIV_Begin ("class=\"NOTICE_TEXT NOTICE_TEXT_%s\"",
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Announcement->Content);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Write announcement foot *****/
|
||||
/* Begin container for foot */
|
||||
HTM_DIV_Begin ("class=\"NOTICE_USERS\"");
|
||||
|
||||
switch (ShowAll)
|
||||
if (ICanEdit == Ann_I_CAN_EDIT)
|
||||
{
|
||||
case Ann_DONT_SHOW_ALL:
|
||||
/***** Put form to mark announcement as seen *****/
|
||||
Lay_PutContextualLinkIconText (ActAnnSee,NULL,
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod,
|
||||
"times.svg",Ico_BLACK,
|
||||
Txt_Do_not_show_again,NULL);
|
||||
break;
|
||||
case Ann_SHOW_ALL:
|
||||
/* Users' roles who can view this announcement */
|
||||
HTM_TxtColon (Txt_Users);
|
||||
for (Role = Rol_UNK, SomeRolesAreSelected = false;
|
||||
Role <= Rol_TCH;
|
||||
Role++)
|
||||
if (Announcement->Roles & (1 << Role))
|
||||
{
|
||||
if (SomeRolesAreSelected)
|
||||
HTM_Comma ();
|
||||
SomeRolesAreSelected = true;
|
||||
HTM_TxtF (" %s",Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
|
||||
}
|
||||
break;
|
||||
/***** Icon to remove announcement *****/
|
||||
Ico_PutContextualIconToRemove (ActRemAnn,NULL,
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod);
|
||||
|
||||
/***** Icon to hide/unhide the announcement *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,NULL, // TODO: Put anchor
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod,
|
||||
Announcement->Status == Ann_OBSOLETE_ANNOUNCEMENT ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE);
|
||||
}
|
||||
|
||||
/* End container for foot */
|
||||
HTM_DIV_End ();
|
||||
/***** Write the subject of the announcement *****/
|
||||
HTM_DIV_Begin ("class=\"NOTICE_SUBJECT NOTICE_SUBJECT_%s\"",
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Announcement->Subject);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** End yellow note *****/
|
||||
/***** Write the content of the announcement *****/
|
||||
HTM_DIV_Begin ("class=\"NOTICE_TEXT NOTICE_TEXT_%s\"",
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Announcement->Content);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Write announcement foot *****/
|
||||
/* Begin container for foot */
|
||||
HTM_DIV_Begin ("class=\"NOTICE_USERS\"");
|
||||
|
||||
switch (ShowAll)
|
||||
{
|
||||
case Ann_DONT_SHOW_ALL:
|
||||
/***** Put form to mark announcement as seen *****/
|
||||
Lay_PutContextualLinkIconText (ActAnnSee,NULL,
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod,
|
||||
"times.svg",Ico_BLACK,
|
||||
Txt_Do_not_show_again,NULL);
|
||||
break;
|
||||
case Ann_SHOW_ALL:
|
||||
/* Users' roles who can view this announcement */
|
||||
HTM_TxtColon (Txt_Users);
|
||||
for (Role = Rol_UNK, SomeRolesAreSelected = false;
|
||||
Role <= Rol_TCH;
|
||||
Role++)
|
||||
if (Announcement->Roles & (1 << Role))
|
||||
{
|
||||
if (SomeRolesAreSelected)
|
||||
HTM_Comma ();
|
||||
SomeRolesAreSelected = true;
|
||||
HTM_SPTxt (Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* End container for foot */
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** End yellow note *****/
|
||||
HTM_DIV_End ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
|
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
|||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.50 (2023-11-28)"
|
||||
#define CSS_FILE "swad23.48.2.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.50.1 (2023-11-28)"
|
||||
#define CSS_FILE "swad23.50.1.css"
|
||||
#define JS_FILE "swad23.47.3.js"
|
||||
/*
|
||||
Version 23.50.1: Nov 28, 2023 Responsive design in announcements and notices. (335630 lines)
|
||||
Version 23.50: Nov 28, 2023 Code refactoring in hierarchy. (335634 lines)
|
||||
Version 23.49: Nov 27, 2023 Code refactoring in highlighting. (335774 lines)
|
||||
Version 23.48.3: Nov 27, 2023 Code refactoring in notices. (335746 lines)
|
||||
|
|
|
@ -66,12 +66,6 @@ extern struct Globals Gbl;
|
|||
|
||||
#define Not_MAX_CHARS_ON_NOTICE 40 // Maximum number of characters in notices (when not expanded)
|
||||
|
||||
static const unsigned Not_ContainerWidth[Not_NUM_TYPES_LISTING] =
|
||||
{
|
||||
[Not_LIST_BRIEF_NOTICES] = 148 + 50,
|
||||
[Not_LIST_FULL_NOTICES ] = 500 + 50,
|
||||
};
|
||||
|
||||
static const unsigned Not_MaxCharsURLOnScreen[Not_NUM_TYPES_LISTING] =
|
||||
{
|
||||
[Not_LIST_BRIEF_NOTICES] = 15,
|
||||
|
@ -317,7 +311,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod)
|
|||
extern const char *Txt_Notices;
|
||||
extern const char *Txt_No_notices;
|
||||
MYSQL_RES *mysql_res;
|
||||
char StrWidth[Cns_MAX_DECIMAL_DIGITS_UINT + 2 + 1];
|
||||
// char StrWidth[Cns_MAX_DECIMAL_DIGITS_UINT + 2 + 1];
|
||||
struct Not_Notice Notice;
|
||||
unsigned NumNot;
|
||||
unsigned NumNotices = 0; // Initialized to avoid warning
|
||||
|
@ -338,9 +332,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod)
|
|||
NumNotices = Not_DB_GetAllNotices (&mysql_res);
|
||||
|
||||
/***** Begin box *****/
|
||||
snprintf (StrWidth,sizeof (StrWidth),"%upx",
|
||||
Not_ContainerWidth[Not_LIST_FULL_NOTICES] + 50);
|
||||
Box_BoxBegin (StrWidth,Txt_Notices,
|
||||
Box_BoxBegin (NULL,Txt_Notices,
|
||||
Not_PutIconsListNotices,NULL,
|
||||
Hlp_COMMUNICATION_Notices,Box_NOT_CLOSABLE);
|
||||
if (!NumNotices)
|
||||
|
|
Loading…
Reference in New Issue