From 7206f791122677a7f8a8bfff6a4c4cdda082572e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 11 Apr 2016 15:32:59 +0200 Subject: [PATCH] Version 15.192.6 --- css/{swad15.192.css => swad15.192.6.css} | 13 +-- swad_centre.c | 3 +- swad_changelog.h | 6 +- swad_file_browser.c | 3 +- swad_forum.c | 3 +- swad_image.c | 16 ++-- swad_image.h | 4 +- swad_info.c | 3 +- swad_logo.c | 1 - swad_message.c | 3 +- swad_photo.c | 4 +- swad_social.c | 3 +- swad_test.c | 107 +++++++++++------------ swad_test_import.c | 3 +- 14 files changed, 81 insertions(+), 91 deletions(-) rename css/{swad15.192.css => swad15.192.6.css} (99%) diff --git a/css/swad15.192.css b/css/swad15.192.6.css similarity index 99% rename from css/swad15.192.css rename to css/swad15.192.6.css index 5b6346437..0119b882f 100644 --- a/css/swad15.192.css +++ b/css/swad15.192.6.css @@ -1743,12 +1743,13 @@ a:hover img.CENTRE_PHOTO_SHOW .TEST_EXA_LIGHT {color:#A0A0A0; font-size:12pt;} .TEST_EDI {color:#404040; font-size:12pt;} .TEST_EDI_LIGHT {color:#A0A0A0; font-size:12pt;} -.TEST_IMG_SHOW_STEM {width:600px; border-radius:4px; margin:10px 0;} -.TEST_IMG_SHOW_ANS {width:450px; border-radius:4px; margin:10px 0;} -.TEST_IMG_EDIT_LIST_STEM {width:300px; border-radius:2px; margin:5px 0;} -.TEST_IMG_EDIT_LIST_ANS {width:225px; border-radius:2px; margin:5px 0;} -.TEST_IMG_EDIT_ONE_STEM {width:600px; border-radius:4px;} -.TEST_IMG_EDIT_ONE_ANS {width:450px; border-radius:4px;} +.TEST_IMG_SHOW_STEM {width:100%; border-radius:4px; margin:10px 0;} +.TEST_IMG_SHOW_ANS {width:100%; border-radius:4px; margin:10px 0;} +.TEST_IMG_EDIT_LIST_STEM {width:100%; border-radius:2px; margin:5px 0;} +.TEST_IMG_EDIT_LIST_ANS {width:100%; border-radius:2px; margin:5px 0;} +.TEST_IMG_EDIT_ONE_CONTAINER {margin:15px 0; text-align:left; vertical-align:top;} +.TEST_IMG_EDIT_ONE_STEM {width:100%; border-radius:4px;} +.TEST_IMG_EDIT_ONE_ANS {width:100%; border-radius:4px;} .TEST_EDI_ANS_LEFT_COL { box-sizing:border-box; diff --git a/swad_centre.c b/swad_centre.c index 5b419248f..3b4a0bc11 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -2031,8 +2031,7 @@ void Ctr_RequestPhoto (void) fprintf (Gbl.F.Out,"" - "", The_ClassForm[Gbl.Prefs.Theme], Txt_File_with_the_photo, diff --git a/swad_changelog.h b/swad_changelog.h index d2b0c6c46..4ad4d8a90 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -134,13 +134,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.192.5 (2016-04-11)" -#define CSS_FILE "swad15.192.css" +#define Log_PLATFORM_VERSION "SWAD 15.192.6 (2016-04-11)" +#define CSS_FILE "swad15.192.6.css" #define JS_FILE "swad15.190.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 15.192.6: Apr 11, 2016 Changes in layout of test edition. + Changes in forms to upload files. (199359 lines) Version 15.192.5: Apr 11, 2016 Fixed bug in edition of tests. (199369 lines) Version 15.192.4: Apr 11, 2016 Fixed bug when removing messages. (199370 lines) Version 15.192.3: Apr 11, 2016 Fixed bugs when receiving forum image. (199355 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 7092096ee..212d9ffa3 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -7994,8 +7994,7 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow) break; } Brw_ParamListFiles (Brw_IS_FOLDER,Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk,Gbl.FileBrowser.FilFolLnkName); - fprintf (Gbl.F.Out,"", + fprintf (Gbl.F.Out,"", Fil_NAME_OF_PARAM_FILENAME_ORG); /* Button to send */ diff --git a/swad_forum.c b/swad_forum.c index 92e76b5fe..4e1cecbca 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -3848,8 +3848,7 @@ static void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject) " alt=\"%s\" title=\"%s (%s)\"" " class=\"ICON20x20\" />" "" - "" + "" "
", Gbl.Prefs.IconsURL, Txt_Image,Txt_Image,Txt_optional); diff --git a/swad_image.c b/swad_image.c index bd88f7726..23bf0f375 100644 --- a/swad_image.c +++ b/swad_image.c @@ -171,13 +171,6 @@ void Img_GetImageFromForm (unsigned NumOpt,struct Image *Image, /***** Secondly, get the image name and the file *****/ switch (Image->Action) { - case Img_ACTION_NO_IMAGE: // Do not use image (remove current image if exists) - break; - case Img_ACTION_KEEP_IMAGE: // Keep current image unchanged - /***** Get image name *****/ - if (GetImageFromDB) - GetImageFromDB (NumOpt,Image); - break; case Img_ACTION_NEW_IMAGE: // Upload new image /***** Get new image (if present ==> process and create temporary file) *****/ Img_GetAndProcessImageFileFromForm (Image,ParamFile, @@ -189,15 +182,22 @@ void Img_GetImageFromForm (unsigned NumOpt,struct Image *Image, Image->Name[0] = '\0'; } break; + case Img_ACTION_KEEP_IMAGE: // Keep current image unchanged + /***** Get image name *****/ + if (GetImageFromDB != NULL) + GetImageFromDB (NumOpt,Image); + break; case Img_ACTION_CHANGE_IMAGE: // Replace old image by new image /***** Get new image (if present ==> process and create temporary file) *****/ Img_GetAndProcessImageFileFromForm (Image,ParamFile, Width,Height,Quality); if (Image->Status != Img_FILE_PROCESSED && // No new image received-processed successfully - GetImageFromDB) + GetImageFromDB != NULL) /* Get image name */ GetImageFromDB (NumOpt,Image); break; + case Img_ACTION_NO_IMAGE: // Do not use image (remove current image if exists) + break; } /***** By last, get image title from form *****/ diff --git a/swad_image.h b/swad_image.h index a09a3099b..dd6e275da 100644 --- a/swad_image.h +++ b/swad_image.h @@ -41,10 +41,10 @@ #define Img_NUM_ACTIONS 4 typedef enum { - Img_ACTION_NO_IMAGE, // Do not use image (remove current image if exists) - Img_ACTION_KEEP_IMAGE, // Keep current image unchanged Img_ACTION_NEW_IMAGE, // Upload new image + Img_ACTION_KEEP_IMAGE, // Keep current image unchanged Img_ACTION_CHANGE_IMAGE, // Change existing image by a new image + Img_ACTION_NO_IMAGE, // Do not use image (remove current image if exists) } Img_Action_t; /***** Status of an image file *****/ diff --git a/swad_info.c b/swad_info.c index dd95eaa0f..22451e512 100644 --- a/swad_info.c +++ b/swad_info.c @@ -1041,8 +1041,7 @@ void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc) "%s:" "" "" - "" + "" "" "" "", diff --git a/swad_logo.c b/swad_logo.c index aaccb13b4..58c0ac7c4 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -297,7 +297,6 @@ void Log_RequestLogo (Sco_Scope_t Scope) "%s: " "" "", The_ClassForm[Gbl.Prefs.Theme], Txt_File_with_the_logo, diff --git a/swad_message.c b/swad_message.c index 15dfdb2d8..3a1e2174b 100644 --- a/swad_message.c +++ b/swad_message.c @@ -430,8 +430,7 @@ static void Msg_PutFormMsgUsrs (const char *Content) " alt=\"%s\" title=\"%s (%s)\"" " class=\"ICON20x20\" />" "" - "" + "" "
", Gbl.Prefs.IconsURL, Txt_Image,Txt_Image,Txt_optional); diff --git a/swad_photo.c b/swad_photo.c index 18a35b619..ff09c07bb 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -318,13 +318,11 @@ void Pho_ReqPhoto (const struct UsrData *UsrDat,bool PhotoExists,const char *Pho fprintf (Gbl.F.Out,"" - "", The_ClassForm[Gbl.Prefs.Theme], Txt_File_with_the_photo, Fil_NAME_OF_PARAM_FILENAME_ORG, - UsrDat->UsrCod, Gbl.Form.Id); /***** End frame *****/ diff --git a/swad_social.c b/swad_social.c index 435ebdd68..d0ca40bf9 100644 --- a/swad_social.c +++ b/swad_social.c @@ -2035,8 +2035,7 @@ static void Soc_PutTextarea (const char *Placeholder, " alt=\"%s\" title=\"%s (%s)\"" " class=\"ICON20x20\" />" "" - "" + "" "
", Gbl.Prefs.IconsURL, Txt_Image,Txt_Image,Txt_optional); diff --git a/swad_test.c b/swad_test.c index d2a3e318f..a9a695f68 100644 --- a/swad_test.c +++ b/swad_test.c @@ -1062,90 +1062,87 @@ static void Tst_PutFormToEditQstImage (struct Image *Image, bool OptionsDisabled) { extern const char *The_ClassForm[The_NUM_THEMES]; + extern const char *Txt_Image; + extern const char *Txt_optional; extern const char *Txt_No_image; extern const char *Txt_Current_image; extern const char *Txt_Change_image; - extern const char *Txt_Image; - extern const char *Txt_optional; extern const char *Txt_Image_title_attribution; static unsigned UniqueId = 0; /***** Start container *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); - /***** Choice 1: No image *****/ - fprintf (Gbl.F.Out,"Name[0]) - fprintf (Gbl.F.Out," checked=\"checked\""); - if (OptionsDisabled) - fprintf (Gbl.F.Out," disabled=\"disabled\""); - fprintf (Gbl.F.Out," />" - "
", - The_ClassForm[Gbl.Prefs.Theme], - Txt_No_image); - - /***** Choice 2: Current image *****/ - if (Image->Name[0]) { + /* Action to perform on image */ + Par_PutHiddenParamUnsigned ("ImgAct",(unsigned) Img_ACTION_NEW_IMAGE); + + /* File */ + fprintf (Gbl.F.Out,"" + ""); + } + else + { + /***** Choice 1: No image *****/ + fprintf (Gbl.F.Out,"" + "" + "
", + The_ClassForm[Gbl.Prefs.Theme], + Txt_No_image); + + /***** Choice 2: Current image *****/ fprintf (Gbl.F.Out,"" - "", The_ClassForm[Gbl.Prefs.Theme], Txt_Current_image); Img_ShowImage (Image,ClassImg); - } - /***** Choice 3: Change/new image *****/ - UniqueId++; - if (Image->Name[0]) // Image exists - { - /***** Change image *****/ + /***** Choice 3: Change/new image *****/ + UniqueId++; fprintf (Gbl.F.Out,"" - "