diff --git a/swad_changelog.h b/swad_changelog.h index ee5a1d750..f8e44d08e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -148,13 +148,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.21.2 (2016-10-12)" +#define Log_PLATFORM_VERSION "SWAD 16.21.3 (2016-10-12)" #define CSS_FILE "swad15.229.css" #define JS_FILE "swad15.238.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 16.21.3: Oct 12, 2016 Changes in layout of file browser. (205266 lines) Version 16.21.2: Oct 12, 2016 Unused code removed from actions. (205263 lines) Version 16.21.1: Oct 12, 2016 Code refactoring in actions. (205280 lines) Version 16.21: Oct 12, 2016 Code refactoring related with warning about e-mail notifications. diff --git a/swad_file_browser.c b/swad_file_browser.c index 9be13c446..0426b1499 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -1471,7 +1471,7 @@ static void Brw_UpdateLastAccess (void); static void Brw_UpdateGrpLastAccZone (const char *FieldNameDB,long GrpCod); static void Brw_WriteSubtitleOfFileBrowser (void); static void Brw_InitHiddenLevels (void); -static void Brw_ShowSizeOfFileTree (void); +static void Brw_ShowAndStoreSizeOfFileTree (void); static void Brw_StoreSizeOfFileTreeInDB (void); static void Brw_PutParamsContextualLink (void); @@ -3613,11 +3613,7 @@ static void Brw_ShowFileBrowser (void) fprintf (Gbl.F.Out,""); /***** Show and store number of documents found *****/ - if (Brw_FileBrowserIsEditable[Gbl.FileBrowser.Type]) - { - Brw_ShowSizeOfFileTree (); - Brw_StoreSizeOfFileTreeInDB (); - } + Brw_ShowAndStoreSizeOfFileTree (); /***** Put button to show / edit *****/ Brw_PutButtonToShowEdit (IconViewEdit); @@ -3980,7 +3976,7 @@ static void Brw_InitHiddenLevels (void) /************************* Show size of a file browser ***********************/ /*****************************************************************************/ -static void Brw_ShowSizeOfFileTree (void) +static void Brw_ShowAndStoreSizeOfFileTree (void) { extern const char *Txt_level; extern const char *Txt_levels; @@ -3991,28 +3987,38 @@ static void Brw_ShowSizeOfFileTree (void) extern const char *Txt_of_PART_OF_A_TOTAL; char FileSizeStr[Fil_MAX_BYTES_FILE_SIZE_STRING]; - Fil_WriteFileSizeFull ((double) Gbl.FileBrowser.Size.TotalSiz,FileSizeStr); - fprintf (Gbl.F.Out,"
" - "%u %s; %lu %s; %lu %s; %s", - Gbl.FileBrowser.Size.NumLevls, - Gbl.FileBrowser.Size.NumLevls == 1 ? Txt_level : - Txt_levels , - Gbl.FileBrowser.Size.NumFolds, - Gbl.FileBrowser.Size.NumFolds == 1 ? Txt_folder : - Txt_folders, - Gbl.FileBrowser.Size.NumFiles, - Gbl.FileBrowser.Size.NumFiles == 1 ? Txt_file : - Txt_files, - FileSizeStr); - if (Gbl.FileBrowser.Size.MaxQuota) + fprintf (Gbl.F.Out,"
"); + + if (Brw_FileBrowserIsEditable[Gbl.FileBrowser.Type]) { - Fil_WriteFileSizeBrief ((double) Gbl.FileBrowser.Size.MaxQuota,FileSizeStr); - fprintf (Gbl.F.Out," (%.1f%% %s %s)", - 100.0 * ((double) Gbl.FileBrowser.Size.TotalSiz / - (double) Gbl.FileBrowser.Size.MaxQuota), - Txt_of_PART_OF_A_TOTAL, + Fil_WriteFileSizeFull ((double) Gbl.FileBrowser.Size.TotalSiz,FileSizeStr); + fprintf (Gbl.F.Out,"%u %s; %lu %s; %lu %s; %s", + Gbl.FileBrowser.Size.NumLevls, + Gbl.FileBrowser.Size.NumLevls == 1 ? Txt_level : + Txt_levels , + Gbl.FileBrowser.Size.NumFolds, + Gbl.FileBrowser.Size.NumFolds == 1 ? Txt_folder : + Txt_folders, + Gbl.FileBrowser.Size.NumFiles, + Gbl.FileBrowser.Size.NumFiles == 1 ? Txt_file : + Txt_files, FileSizeStr); + + if (Gbl.FileBrowser.Size.MaxQuota) + { + Fil_WriteFileSizeBrief ((double) Gbl.FileBrowser.Size.MaxQuota,FileSizeStr); + fprintf (Gbl.F.Out," (%.1f%% %s %s)", + 100.0 * ((double) Gbl.FileBrowser.Size.TotalSiz / + (double) Gbl.FileBrowser.Size.MaxQuota), + Txt_of_PART_OF_A_TOTAL, + FileSizeStr); + } + + Brw_StoreSizeOfFileTreeInDB (); } + else + fprintf (Gbl.F.Out," "); // Blank to occupy the same space as the text for the browser size + fprintf (Gbl.F.Out,"
"); }