diff --git a/css/swad16.181.css b/css/swad16.184.css similarity index 99% rename from css/swad16.181.css rename to css/swad16.184.css index 27cfd9e5b..6f6a2bb83 100644 --- a/css/swad16.181.css +++ b/css/swad16.184.css @@ -2909,6 +2909,38 @@ a:hover img.CENTRE_PHOTO_SHOW .BM0 {width:20px; text-align:center; vertical-align:middle; background-color:#F4F2EA;} .BM1 {width:20px; text-align:center; vertical-align:middle; background-color:#FBFAF7;} +/******************************** Pagination *********************************/ +.PAG + { + display:inline-block; + box-sizing:border-box; + margin:4px 2px; + padding:2px 8px; + border-style:solid; + border-width:1px; + border-radius:4px; + border-color:#C0DAE4; + } +a.PAG:hover, .PAG_CUR + { + display:inline-block; + box-sizing:border-box; + margin:4px 2px; + padding:2px 8px; + border-style:solid; + border-width:1px; + border-radius:4px; + border-color:#C0DAE4; + background-color:#DDECF1; + text-decoration:none; + } +.PAG_TXT + { + font-size:13pt; + font-weight:bold; + color:#4D88A1; + } + /***************************** Calls for exams *******************************/ .CONV_TIT { diff --git a/swad_changelog.h b/swad_changelog.h index 908badba6..4aced666e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -214,13 +214,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.183.1 (2017-04-18)" -#define CSS_FILE "swad16.181.css" +#define Log_PLATFORM_VERSION "SWAD 16.184 (2017-04-18)" +#define CSS_FILE "swad16.184.css" #define JS_FILE "swad16.181.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.184: Apr 18, 2017 Changes in layout of page numbers. (217724 lines) Version 16.183.1: Apr 18, 2017 Changes in layout of forums. (217719 lines) Version 16.183: Apr 18, 2017 Code refactoring in forums. (217738 lines) Version 16.182: Apr 18, 2017 Code refactoring in forums and pagination. (217678 lines) diff --git a/swad_pagination.c b/swad_pagination.c index 507c75d30..085f8c196 100644 --- a/swad_pagination.c +++ b/swad_pagination.c @@ -126,7 +126,7 @@ void Pag_WriteLinksToPagesCentered (Pag_WhatPaginate_t WhatPaginate, fprintf (Gbl.F.Out,"
"); Pag_WriteLinksToPages (WhatPaginate, ThrCod, - Pagination,true,NULL,"TIT",false); + Pagination,true,NULL,"PAG_TXT",false); fprintf (Gbl.F.Out,"
"); } @@ -140,14 +140,15 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, bool FirstMsgEnabled,const char *Subject,const char *Font, bool LinkToPagCurrent) { - extern const char *Txt_Page; - extern const char *Txt_See_page_X_of_Y; + extern const char *Txt_Page_X_of_Y; extern const char *Txt_Post_banned; unsigned NumPage; + char LinkStyle[64]; /***** Link to page 1, including a text *****/ if (Subject) { + fprintf (Gbl.F.Out,"
"); if (LinkToPagCurrent) { switch (WhatPaginate) @@ -217,7 +218,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Usr_PutParamOtherUsrCodEncrypted (); break; } - sprintf (Gbl.Title,Txt_See_page_X_of_Y, + sprintf (Gbl.Title,Txt_Page_X_of_Y, 1,Pagination->NumPags); Act_LinkFormSubmit (Gbl.Title,Font,NULL); } @@ -226,8 +227,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, if (FirstMsgEnabled) fprintf (Gbl.F.Out,"%s",Subject); else - fprintf (Gbl.F.Out,"[%s]", - Txt_Post_banned); + fprintf (Gbl.F.Out,"[%s]",Txt_Post_banned); if (LinkToPagCurrent) { fprintf (Gbl.F.Out,""); @@ -235,23 +235,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, } else fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
"); } + /***** Links to several pages start here *****/ if (Pagination->MoreThanOnePage) { - /***** Links to several pages start here *****/ - fprintf (Gbl.F.Out,"" - "" - "", - Font,Txt_Page); + sprintf (LinkStyle,"PAG %s",Font); /***** Possible link to page 1 *****/ if (Pagination->StartPage > 1) { - fprintf (Gbl.F.Out,""); if (Pagination->LeftPage > 2) - fprintf (Gbl.F.Out,"", - Font); + fprintf (Gbl.F.Out,"",Font); } /***** Posible link to page left *****/ if (Pagination->LeftPage > 1 && Pagination->LeftPage < Pagination->StartPage) { - fprintf (Gbl.F.Out,""); if (Pagination->LeftPage < Pagination->StartPage - 1) - fprintf (Gbl.F.Out,"", - Font); + fprintf (Gbl.F.Out,"",Font); } /***** Loop to put links to the pages around the current one *****/ @@ -425,10 +410,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, NumPage <= Pagination->EndPage; NumPage++) { - fprintf (Gbl.F.Out,""); } /***** Posible link to page right *****/ @@ -513,12 +498,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Pagination->RightPage < Pagination->NumPags) { if (Pagination->RightPage > Pagination->EndPage + 1) - fprintf (Gbl.F.Out,"", - Font); - fprintf (Gbl.F.Out,""); } /***** Possible link to last page *****/ if (Pagination->EndPage < Pagination->NumPags) { if (Pagination->NumPags > Pagination->RightPage + 1) - fprintf (Gbl.F.Out,"", - Font); - fprintf (Gbl.F.Out,""); } - fprintf (Gbl.F.Out,"" - "
" - "%s" - "", - Font); switch (WhatPaginate) { case Pag_ASSIGNMENTS: @@ -319,25 +313,20 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Usr_PutParamOtherUsrCodEncrypted (); break; } - sprintf (Gbl.Title,Txt_See_page_X_of_Y, + sprintf (Gbl.Title,Txt_Page_X_of_Y, 1,Pagination->NumPags); - Act_LinkFormSubmit (Gbl.Title,Font,NULL); - fprintf (Gbl.F.Out,"1"); + Act_LinkFormSubmit (Gbl.Title,LinkStyle,NULL); + fprintf (Gbl.F.Out,"1" + ""); Act_FormEnd (); - fprintf (Gbl.F.Out,"" - "…" - "", - Font); switch (WhatPaginate) { case Pag_ASSIGNMENTS: @@ -405,19 +394,15 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Usr_PutParamOtherUsrCodEncrypted (); break; } - sprintf (Gbl.Title,Txt_See_page_X_of_Y, + sprintf (Gbl.Title,Txt_Page_X_of_Y, Pagination->LeftPage, Pagination->NumPags); - Act_LinkFormSubmit (Gbl.Title,Font,NULL); + Act_LinkFormSubmit (Gbl.Title,LinkStyle,NULL); fprintf (Gbl.F.Out,"%u", Pagination->LeftPage); Act_FormEnd (); - fprintf (Gbl.F.Out,"" - "…" - "", - Font); + sprintf (Gbl.Title,Txt_Page_X_of_Y, + NumPage,Pagination->NumPags); if (!LinkToPagCurrent && NumPage == Pagination->CurrentPage) - fprintf (Gbl.F.Out,"%u",NumPage); + fprintf (Gbl.F.Out,"" + "%u" + "", + Gbl.Title,Font,NumPage); else { switch (WhatPaginate) @@ -498,14 +486,11 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Usr_PutParamOtherUsrCodEncrypted (); break; } - sprintf (Gbl.Title,Txt_See_page_X_of_Y, - NumPage,Pagination->NumPags); - Act_LinkFormSubmit (Gbl.Title,Font,NULL); + Act_LinkFormSubmit (Gbl.Title,LinkStyle,NULL); fprintf (Gbl.F.Out,"%u", NumPage); Act_FormEnd (); } - fprintf (Gbl.F.Out,"" - "…" - "", - Font); + fprintf (Gbl.F.Out,"",Font); switch (WhatPaginate) { case Pag_ASSIGNMENTS: @@ -586,24 +566,18 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Usr_PutParamOtherUsrCodEncrypted (); break; } - sprintf (Gbl.Title,Txt_See_page_X_of_Y, + sprintf (Gbl.Title,Txt_Page_X_of_Y, Pagination->RightPage,Pagination->NumPags); - Act_LinkFormSubmit (Gbl.Title,Font,NULL); + Act_LinkFormSubmit (Gbl.Title,LinkStyle,NULL); fprintf (Gbl.F.Out,"%u",Pagination->RightPage); Act_FormEnd (); - fprintf (Gbl.F.Out,"" - "…" - "", - Font); + fprintf (Gbl.F.Out,"",Font); switch (WhatPaginate) { case Pag_ASSIGNMENTS: @@ -671,15 +645,12 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Usr_PutParamOtherUsrCodEncrypted (); break; } - sprintf (Gbl.Title,Txt_See_page_X_of_Y, + sprintf (Gbl.Title,Txt_Page_X_of_Y, Pagination->NumPags,Pagination->NumPags); - Act_LinkFormSubmit (Gbl.Title,Font,NULL); + Act_LinkFormSubmit (Gbl.Title,LinkStyle,NULL); fprintf (Gbl.F.Out,"%u",Pagination->NumPags); Act_FormEnd (); - fprintf (Gbl.F.Out,"
"); } } diff --git a/swad_text.c b/swad_text.c index 36ee8183e..c96c134ce 100644 --- a/swad_text.c +++ b/swad_text.c @@ -28389,7 +28389,7 @@ const char *Txt_out_of_PART_OF_A_SCORE = // Example: score is 2 out of 10 #elif L==9 "out of"; #endif - +/* TODO: Remove if not used const char *Txt_Page = #if L==1 "Pàg."; @@ -28410,7 +28410,7 @@ const char *Txt_Page = #elif L==9 "Pág."; #endif - +*/ const char *Txt_page = #if L==1 "pàg."; @@ -28432,6 +28432,27 @@ const char *Txt_page = "pág."; #endif +const char *Txt_Page_X_of_Y = // Warning: it is very important to include two %u in the following sentences +#if L==1 + "Pàgina %u de %u"; +#elif L==2 + "Seite %u von %u"; +#elif L==3 + "Page %u of %u"; +#elif L==4 + "Página %u de %u"; +#elif L==5 + "Page %u de %u"; +#elif L==6 + "Página %u de %u"; // Okoteve traducción +#elif L==7 + "Pagina %u di %u"; +#elif L==8 + "Strona %u z %u"; +#elif L==9 + "Página %u de %u"; +#endif + const char *Txt_PAGE1_Page_generated_in = #if L==1 "Pàgina generada en"; @@ -36165,27 +36186,6 @@ const char *Txt_See_notifications = "Veja notificações"; #endif -const char *Txt_See_page_X_of_Y = // Warning: it is very important to include two %u in the following sentences -#if L==1 - "Ver página %u de %u"; // Necessita traduccio -#elif L==2 - "Siehe Seite %u von %u"; -#elif L==3 - "See page %u of %u"; -#elif L==4 - "Ver página %u de %u"; -#elif L==5 - "Voir page %u de %u"; -#elif L==6 - "Ver página %u de %u"; // Okoteve traducción -#elif L==7 - "Vedi pagina %u di %u"; -#elif L==8 - "See page %u of %u"; // Potrzebujesz tlumaczenie -#elif L==9 - "Veja página %u de %u"; -#endif - const char *Txt_Select_another_country = #if L==1 "Seleccionar un altre país";