← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 274: show only page numbers that are in range

 

------------------------------------------------------------
revno: 274
git commit: 6005af6b66bf59c9520a4bdc7286e854f107f20a
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Sat 2012-06-23 18:26:42 +0100
message:
  show only page numbers that are in range 
modified:
  interfaces/web/wui/index.html


--
lp:alfanous
https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git

Your team Alfanous team is subscribed to branch lp:alfanous.
To unsubscribe from this branch go to https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git/+edit-subscription
=== modified file 'interfaces/web/wui/index.html'
--- interfaces/web/wui/index.html	2012-06-23 17:03:24 +0000
+++ interfaces/web/wui/index.html	2012-06-23 17:26:42 +0000
@@ -5,7 +5,6 @@
 	<!-- 	TODO clickable-floating-panel with options and user feedback! 
 			TODO: show prev_aya and next_aya [WUI]
 			TODO: replace suggested word in the  previous query [WUI] 
-			TODO: show only 9 pages with previous page button and next page button [WUI]
 			-->
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 
@@ -170,15 +169,24 @@
 				// Pages control
 				results_pages += "<br />";
 				results_pages += "<div class='pages'>\n<img src='images/prev.gif' alt='الصفحة السابقة' title = 'الصفحة السابقة' /><div style=' display:inline-block; position:relative; top:-8px;'>\n";
-				for( i = 1; i <= nb_pages; i++) {
+				for( i = 1;  i <= nb_pages ; i++) 
+				{
 					if (i == page)
 					{
 						results_pages += " "+ i;
 					}
-					else
+					else if ((i <= page + 7 )  && (i >= page - 3) ) // pages  in range [-3,+7]
 					{
 						results_pages += " <a href=''>"+ i+ "</a>";
 					}
+					else if (i==1)  // first page
+					{
+						results_pages += " <a href=''>"+ i+ "</a> ..";
+					}
+					else if (i==nb_pages)  // last page
+					{
+						results_pages += " .. <a href=''>"+ i+ "</a>";
+					}
 				}
 				results_pages += "</div><img src='images/next.gif' alt='الصفحة التالية' title = 'الصفحة التالية' />\n</div>\n";