Version 20.33.6: Feb 22, 2021 Code refactoring related to writing a timeline note.

This commit is contained in:
acanas 2021-02-22 10:52:00 +01:00
parent 05e8fd6276
commit e84b341ebf
2 changed files with 22 additions and 10 deletions

View File

@ -553,7 +553,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 20.33.5 (2021-02-22)"
#define Log_PLATFORM_VERSION "SWAD 20.33.6 (2021-02-22)"
#define CSS_FILE "swad20.8.css"
#define JS_FILE "swad20.6.2.js"
/*
@ -601,6 +601,7 @@ TODO: DNI de un estudiante sale err
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
TODO: Salvador Romero Cortés: @acanas opción para editar posts
Version 20.33.6: Feb 22, 2021 Code refactoring related to writing a timeline note. (304898 lines)
Version 20.33.5: Feb 22, 2021 Code refactoring related to writing a timeline note. (304889 lines)
Version 20.33.4: Feb 22, 2021 Some actions renamed. (304883 lines)
Version 20.33.3: Feb 22, 2021 Code refactoring in timeline related to forms. (304882 lines)

View File

@ -69,6 +69,7 @@ extern struct Globals Gbl;
/*****************************************************************************/
static void TL_Not_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod);
static void TL_Not_ShowAuthorPhoto (struct UsrData *UsrDat);
static void TL_Not_GetAndWriteNoteNotPost (const struct TL_Not_Note *Not);
static void TL_Not_GetLocationInHierarchy (const struct TL_Not_Note *Not,
@ -196,8 +197,6 @@ void TL_Not_WriteNote (struct TL_Timeline *Timeline,
{
struct UsrData AuthorDat;
bool IAmTheAuthor;
bool ShowPhoto = false;
char PhotoURL[PATH_MAX + 1];
unsigned NumComments;
char IdNewComment[Frm_MAX_BYTES_ID + 1];
static unsigned NumDiv = 0; // Used to create unique div id for fav and shared
@ -241,12 +240,7 @@ void TL_Not_WriteNote (struct TL_Timeline *Timeline,
IAmTheAuthor = Usr_ItsMe (AuthorDat.UsrCod);
/***** Left: write author's photo *****/
HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\"");
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&AuthorDat,PhotoURL);
Pho_ShowUsrPhoto (&AuthorDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM,true); // Use unique id
HTM_DIV_End ();
TL_Not_ShowAuthorPhoto (&AuthorDat);
/***** Right: author's name, time, summary and buttons *****/
/* Begin right container */
@ -276,7 +270,7 @@ void TL_Not_WriteNote (struct TL_Timeline *Timeline,
/* Put icon to add a comment */
HTM_DIV_Begin ("class=\"TL_BOTTOM_LEFT\"");
if (Not->Unavailable) // Unavailable notes can not be commented
if (Not->Unavailable) // Unavailable notes can not be commented
TL_Com_PutIconCommentDisabled ();
else
TL_Com_PutIconToToggleComment (IdNewComment);
@ -376,6 +370,23 @@ static void TL_Not_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod
Usr_UsrDataDestructor (&PublisherDat);
}
/*****************************************************************************/
/*********************** Show photo of author of a note **********************/
/*****************************************************************************/
static void TL_Not_ShowAuthorPhoto (struct UsrData *UsrDat)
{
bool ShowPhoto = false;
char PhotoURL[PATH_MAX + 1];
HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\"");
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM,true); // Use unique id
HTM_DIV_End ();
}
/*****************************************************************************/
/*************** Write name and nickname of author of a note *****************/
/*****************************************************************************/