aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-02-04 17:10:49 +0100
committerChristian Weiske <cweiske@cweiske.de>2016-02-04 17:10:49 +0100
commitdda0b5ec6258b94fdd6cdec81eccba3f2b9513a0 (patch)
treeab704ce4593d2acf8053a2f92dbb4a0bba83168b
parentae2d3a27072b157a9c3df2ba1e8101d6d3a70d4f (diff)
downloadphinde-dda0b5ec6258b94fdd6cdec81eccba3f2b9513a0.tar.gz
phinde-dda0b5ec6258b94fdd6cdec81eccba3f2b9513a0.zip
Show site search reset link
-rw-r--r--data/templates/search/list.htm11
-rw-r--r--www/css/phinde.css4
-rw-r--r--www/index.php3
3 files changed, 13 insertions, 5 deletions
diff --git a/data/templates/search/list.htm b/data/templates/search/list.htm
index 97584d6..46bf4ba 100644
--- a/data/templates/search/list.htm
+++ b/data/templates/search/list.htm
@@ -3,14 +3,15 @@
Sorry, no results for "<tt>{{query}}</tt>".
</p>
{% else %}
- <p>
- Found {{hitcount}} search
+ <p class="resultinfo">
+ {{hitcount}} results
{% if hitcount == 1 %}result{% else %}results{%endif%}
- for "<tt>{{cleanQuery}}</tt>"
+ for "<strong><tt>{{cleanQuery}}</tt></strong>"
{% if site %}
- on <tt>{{site}}</tt>
+ on <strong><tt>{{site}}</tt></strong>
+ &#160;&#160;&#160;|&#160;&#160;&#160;
+ <a href="{{urlNoSite}}">Show all results</a>
{% endif %}
- in {{queryTime}}:
</p>
<ul class="hits">
{% for hit in hits %}
diff --git a/www/css/phinde.css b/www/css/phinde.css
index 6d9ad20..a25aa31 100644
--- a/www/css/phinde.css
+++ b/www/css/phinde.css
@@ -27,4 +27,8 @@
}
.hit em.hl {
font-weight: bold;
+}
+.resultinfo {
+ margin-top: 1ex;
+ margin-bottom: 2ex;
} \ No newline at end of file
diff --git a/www/index.php b/www/index.php
index 12befbc..0412f82 100644
--- a/www/index.php
+++ b/www/index.php
@@ -59,8 +59,10 @@ if (preg_match('#site:([^ ]*)#', $query, $matches)) {
$site = $matches[1];
$cleanQuery = trim(str_replace('site:' . $site, '', $query));
$site = Helper::noSchema($site);
+ $urlNoSite = buildLink('?q=' . urlencode($cleanQuery), $filters, null, null);
} else {
$cleanQuery = $query;
+ $urlNoSite = null;
}
$timeBegin = microtime(true);
@@ -108,6 +110,7 @@ render(
'queryTime' => round($timeEnd - $timeBegin, 2) . 'ms',
'query' => $query,
'cleanQuery' => $cleanQuery,
+ 'urlNoSite' => $urlNoSite,
'site' => $site,
'hitcount' => $res->hits->total,
'hits' => $res->hits->hits,