From aa9ebdb87e374880ff15a32f061900e37f8347a7 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sun, 4 Dec 2011 13:40:22 +0000 Subject: [PATCH] + * Add "First" and "Last" arrows in the search result page (ID: 3442313) --- src/common/kiwix/searcher.cpp | 3 +++ src/common/kiwix/searcher.h | 1 + static/results.tmpl | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/src/common/kiwix/searcher.cpp b/src/common/kiwix/searcher.cpp index 2d95a8ac5..26ab55e0c 100644 --- a/src/common/kiwix/searcher.cpp +++ b/src/common/kiwix/searcher.cpp @@ -43,6 +43,7 @@ namespace kiwix { estimatedResultCount(0), resultStart(0), resultEnd(0), + resultRange(20), protocolPrefix("zim://"), searchProtocolPrefix("search://?") { } @@ -213,6 +214,8 @@ namespace kiwix { oData["searchPattern"] = this->searchPattern; oData["resultStart"] = this->resultStart + 1; oData["resultEnd"] = (this->resultEnd > this->estimatedResultCount ? this->estimatedResultCount : this->resultEnd); + oData["resultRange"] = this->resultRange; + oData["resultLastPageStart"] = this->estimatedResultCount - this->resultRange; oData["protocolPrefix"] = this->protocolPrefix; oData["searchProtocolPrefix"] = this->searchProtocolPrefix; diff --git a/src/common/kiwix/searcher.h b/src/common/kiwix/searcher.h index 1ed7afaa3..bdc0700cb 100644 --- a/src/common/kiwix/searcher.h +++ b/src/common/kiwix/searcher.h @@ -91,6 +91,7 @@ namespace kiwix { unsigned int resultEnd; std::string protocolPrefix; std::string searchProtocolPrefix; + unsigned int resultRange; }; } diff --git a/static/results.tmpl b/static/results.tmpl index 5734502b8..a6711f80e 100644 --- a/static/results.tmpl +++ b/static/results.tmpl @@ -114,9 +114,15 @@