prettify page names, and drop the redunadant url display
[ikiwiki.git] / templates / searchquery.tmpl
1 $set{thousand,$.}$set{decimal,.}$setmap{BN,,Any Country,uk,England,fr,France}
2 ${
3 $def{PREV,
4 $if{$ne{$topdoc,0},<INPUT TYPE=image NAME="&lt;" ALT="&lt;"
5 SRC="/images/xapian-omega/prev.png" BORDER=0 HEIGHT=30 WIDTH=30>,
6 <IMG ALT="" SRC="/images/xapian-omega/prevoff.png" HEIGHT=30 WIDTH=30>}
7 }
8
9 $def{NEXT,
10 $if{$ne{$last,$msize},<INPUT TYPE=image NAME="&gt;" ALT="&gt;"
11 SRC="/images/xapian-omega/next.png" BORDER=0 HEIGHT=30 WIDTH=30>,
12 <IMG ALT="" SRC="/images/xapian-omega/nextoff.png" HEIGHT=30 WIDTH=30>}
13 }
14
15 $def{P,<INPUT TYPE=image NAME="$1" VALUE="$1" SRC="/images/xapian-omega/page-$2.png" BORDER=0$opt{a} ALT="$1">}
16 $def{PAGE,$if{$gt{$1,9},$if{$gt{$1,99},$P{$1,$div{$1,100}}}$P{$1,$mod{$div{$1,10},10}}}$P{$1,$mod{$1,10}}}
17
18 $def{S,<IMG SRC="/images/xapian-omega/page-$2s.png"$opt{a} ALT=$1>}
19 $def{SPAGE,$if{$gt{$1,9},$if{$gt{$1,99},$S{$1,$div{$1,100}}}$S{$1,$mod{$div{$1,10},10}}}$S{$1,$mod{$1,10}}}
20 }
21
22 $def{PREV,$if{$ne{$topdoc,0},<INPUT TYPE=submit NAME="&lt;" VALUE="Previous">}}
23
24 $def{PAGE,<INPUT TYPE=submit NAME="[" VALUE="$1">}
25
26 $def{SPAGE,<INPUT TYPE=submit NAME="[" VALUE="$1" DISABLED=disabled>}
27
28 $def{NEXT,$if{$ne{$last,$msize},<INPUT TYPE=submit NAME="&gt;" VALUE="Next">}}
29
30 <p>
31
32 <FORM NAME=P METHOD=GET 
33 ACTION="$html{$env{CGIURL}}" TARGET="_top">
34 <center>
35 <INPUT NAME=P VALUE="$html{$query}" SIZE=65>
36 <INPUT TYPE=SUBMIT VALUE="Search">
37 <hr>
38 <SELECT NAME=DEFAULTOP>
39 <OPTION VALUE=or $if{$eq{$defaultop,or},SELECTED}>Matching any words
40 <OPTION VALUE=and $if{$eq{$defaultop,and},SELECTED}>Matching all words
41 </SELECT>
42 $if{$opt{topterms},
43  <div title="Suggested terms to add to your query"
44  style="text-align:left;background:#cfc;border:1px solid green;padding:2px;font:11px verdana$. arial$. helvetica$. sans-serif;">
45  $map{$topterms,<span style="white-space:nowrap"><INPUT TYPE=checkbox NAME=X VALUE="$prettyterm{$_}" onClick="C(this)">$prettyterm{$_}</span> }
46  <BR><NOSCRIPT><INPUT TYPE=hidden NAME=ADD VALUE=1></NOSCRIPT>
47  </div>
48 }
49 $or{$html{$error},
50 $if{$eq{$msize,0},
51 $if{$query,No documents match your query,
52 <hr>Searching $nice{$dbsize} documents
53 },
54 $if{$not{$msizeexact},
55  $nice{$add{$topdoc,1}}-$nice{$last} of about $nice{$msize} matches,
56  $if{$and{$eq{$last,$msize},$eq{$topdoc,0}},
57   All $nice{$msize} matches,
58   $nice{$add{$topdoc,1}}$if{$ne{$add{$topdoc,1},$last},-$nice{$last}} of exactly $nice{$msize} matches}
59 }
60 <hr>
61 </center>
62 $list{$map{$queryterms,$list{$html{$uniq{$unstem{$_}}},<b>,</b>/<b>,</b>}:&nbsp;$nice{$freq{$_}}},Term frequencies: ,$. ,}
63 <br><small>Search took $time seconds</small>
64 <table>
65 $hitlist{<tr><td valign=top>
66 ${<IMG SRC="/images/xapian-omega/score-$div{$percentage,10}.png" ALT="$percentage%" HEIGHT=16 WIDTH=32>}
67 <div title="$percentage%" style='float:left;width:60px;height:10px;border:1px solid black;margin-top:4px;'>
68 <div style='width:$div{$mul{$percentage,6},10}px; height:10px; background-color: red;'>
69 </div></div>
70 <div style='float:left;margin-top:2px;font-size:x-small;'>
71 <span title="$html{$date{$field{modtime},%Y-%m-%d %H:%M:%S}}">
72 Modified:<br><b>$html{$date{$field{modtime},%Y-%m-%d}}</b></span><br>
73 $if{$field{language},Language: <b>$html{$field{language}}</b><br>}
74 $if{$field{size},<span title="$html{$field{size}} bytes">Size: <b>$html{$filesize{$field{size}}}</b></span><br>}
75 </div>
76 </td>
77 <td><B><A HREF="$field{url}">$html{$or{$field{caption},$field{title},$field{url},Untitled}}</A></B><BR>
78 <small>$highlight{$field{sample},$terms}$if{$field{sample},...}</small><br>
79 <small>
80 $percentage% relevant$. matching:
81 <i>$list{$map{$terms,$html{$prettyterm{$_}}},$. ,</i> and <i>}</i></small>${for lynx:}<p></td></tr>}
82 </table>
83
84 <br><center>
85
86 ${suppress next, prev, and page links if there's only one page}
87 $if{$ne{$lastpage,1},
88 $set{a,$if{$opt{pagelink_height}, HEIGHT=$opt{pagelink_height}}$if{$opt{pagelink_width}, WIDTH=$opt{pagelink_width}}}
89
90 ${1-W ... X-(this)-Y ...}
91 $set{w,$min{3,$add{$thispage,-1}}}
92 $set{x,$max{$add{$opt{w},1},$add{$thispage,-3}}}
93 $set{y,$min{$lastpage,$add{$thispage,8}}}
94 $PREV
95 $map{$range{1,$opt{w}},$PAGE{$_}}
96 $if{$ne{$add{$opt{w},1},$opt{x}},...}
97 $map{$range{$opt{x},$add{$thispage,-1}},$PAGE{$_}}
98 $SPAGE{$thispage}
99 $map{$range{$add{$thispage,1},$opt{y}},$PAGE{$_}}
100 $if{$ne{$opt{y},$lastpage},...}
101 $NEXT
102 }
103 }}
104 </center><br>
105 $if{$dbname,<INPUT TYPE=hidden NAME=DB VALUE="$html{$dbname}">}
106 $if{$ne{$topdoc,0},<INPUT TYPE=hidden NAME=TOPDOC VALUE=$topdoc>}
107 $if{$ne{$hitsperpage,10},<INPUT TYPE=hidden NAME=HITSPERPAGE VALUE=$hitsperpage>}
108 $if{$fmt,<INPUT TYPE=hidden NAME=FMT VALUE="$html{$fmt}">}
109 $if{$cgi{COLLAPSE},<INPUT TYPE=hidden NAME=COLLAPSE VALUE="$html{$cgi{COLLAPSE}}">}
110 $if{$queryterms,<INPUT TYPE=hidden NAME=xP VALUE="$html{$queryterms}">}
111 <INPUT TYPE=hidden NAME=xDB VALUE="$html{$dbname}">
112 <INPUT TYPE=hidden NAME=xFILTERS VALUE="$html{$filters}">
113 $list{$relevants,<INPUT TYPE=hidden NAME=R VALUE=",.,">}
114 $if{$cgi{THRESHOLD},<INPUT TYPE=hidden NAME=THRESHOLD VALUE="$html{$cgi{THRESHOLD}}">}
115 </FORM>
116 <hr><div align=right><i><small><a href="http://www.xapian.org/">$html{$version}</a></small></i></div>