From 81984793d123cfc1f5255c6752997db22cf28763 Mon Sep 17 00:00:00 2001 From: Ian Ibbotson Date: Thu, 16 Jun 2016 16:18:27 +0100 Subject: [PATCH] Work on jump to page control --- server/gokb/application.properties | 8 +- .../org/gokb/SearchController.groovy | 7 ++ .../grails-app/views/search/_pagination.gsp | 91 ++++++++++--------- .../grails-app/views/search/_qberesult.gsp | 22 +++-- 4 files changed, 73 insertions(+), 55 deletions(-) diff --git a/server/gokb/application.properties b/server/gokb/application.properties index 9301f833..7c48dc29 100644 --- a/server/gokb/application.properties +++ b/server/gokb/application.properties @@ -1,11 +1,11 @@ #Grails Metadata file -#Thu Jun 16 11:43:32 BST 2016 +#Thu Jun 16 16:17:24 BST 2016 app.buildDate=Jun 16, 2016 -app.buildNumber=2647 -app.buildProfile=production +app.buildNumber=2656 +app.buildProfile=development app.grails.version=2.4.5 app.name=gokb app.servlet.version=2.5 app.version=7.0.4 -extension.build.date=1466073811838 +extension.build.date=1466090243620 extension.build.tag=TEST_CLIENT_5.1-beta7 diff --git a/server/gokb/grails-app/controllers/org/gokb/SearchController.groovy b/server/gokb/grails-app/controllers/org/gokb/SearchController.groovy index 9a8ff512..c3a39f91 100644 --- a/server/gokb/grails-app/controllers/org/gokb/SearchController.groovy +++ b/server/gokb/grails-app/controllers/org/gokb/SearchController.groovy @@ -28,6 +28,10 @@ class SearchController { result.max = params.max ? Integer.parseInt(params.max) : ( user.defaultPageSize ?: 10 ); result.offset = params.offset ? Integer.parseInt(params.offset) : 0; + + if ( params.jumpToPage ) { + result.offset = ( ( params.int('jumpToPage') - 1 ) * result.max ) + } result.hide = params.list("hide") ?: [] @@ -143,6 +147,9 @@ class SearchController { } } + result.withoutJump = params.clone() + result.withoutJump.remove('jumpToPage'); + // log.debug("leaving SearchController::index..."); log.debug("Search completed after ${System.currentTimeMillis() - start_time}"); diff --git a/server/gokb/grails-app/views/search/_pagination.gsp b/server/gokb/grails-app/views/search/_pagination.gsp index 5b27d046..22736ad9 100644 --- a/server/gokb/grails-app/views/search/_pagination.gsp +++ b/server/gokb/grails-app/views/search/_pagination.gsp @@ -3,50 +3,51 @@ - diff --git a/server/gokb/grails-app/views/search/_qberesult.gsp b/server/gokb/grails-app/views/search/_qberesult.gsp index 41b3d8fb..671392be 100644 --- a/server/gokb/grails-app/views/search/_qberesult.gsp +++ b/server/gokb/grails-app/views/search/_qberesult.gsp @@ -3,7 +3,9 @@ + + @@ -61,10 +63,12 @@
- - - + + + + + + @@ -143,6 +147,12 @@
- -
+
+
+ +