Fix whitespace irregularities in code
[xapian.git] / xapian-applications / omega / templates / godmode
blobba34c230f9f9ebabdf52f2821637779bae9ab5c4
1 $httpheader{Content-Type,text/html; charset=utf-8}$set{thousand,$.}$set{decimal,.}<!DOCTYPE html><html lang="en">
2 <head>
3 <title>Omega:
4 $if{$cgi{ID},
5 Document #$html{$cgi{ID}},
6 $if{$ne{$msize,0},
7 Term "$html{$cgi{B}}",
8 Choose what to Inspect}}
9 </title>
10 </head>
11 <body bgcolor=white>
12 <form method=get action="$html{$env{SCRIPT_NAME}}">
14 $if{$cgi{ID},
15 $setrelevant{$cgi{ID}}
16 <h1>Document #$html{$cgi{ID}}</h1>
18 <h2>Terms indexing this document</h2>
20 <table>
21 <tr><th>Frequency</th><th align=left>Term</th></tr>
22 $map{$allterms{$cgi{ID}},
23 <tr><td align=right>$freq{$_}</td>
24 <td><a href="$html{$env{SCRIPT_NAME}?$if{$dbname,DB=$url{$dbname}&}FMT=$url{$fmt}&B=$url{$_}}">$html{$_}</a></td></tr>}
25 </table>
27 <h2>Document Data</h2>
29 <pre>$html{$record{$cgi{ID}}}</pre>
31 <h2>Document Values</h2>
33 $set{values,$list{$map{$range{0,255},$if{$value{$_,$cgi{ID}},
34 <tr><td>$_</td><td>$html{$value{$_,$cgi{ID}}}</td></tr>
35 }},}}
36 $if{$opt{values},
37 <table><tr><th>Value#</th><th>Value</th></tr>
38 $opt{values}
39 </table>,
40 <i>No values</i>
43 $if{$ne{$msize,0},
44 $if{$not{$msizeexact},
45  $nice{$add{$topdoc,1}}-$nice{$last} of about $nice{$msize} matches,
46  $if{$and{$eq{$last,$msize},$eq{$topdoc,0}},
47   All $nice{$msize} matches,
48   $nice{$add{$topdoc,1}}$if{$ne{$add{$topdoc,1},$last},-$nice{$last}} of exactly $nice{$msize} matches}
50 <hr>
51 <table>
52 $hitlist{<tr>
53 <td align=right><a href="$html{$env{SCRIPT_NAME}?$if{$dbname,DB=$url{$dbname}&}FMT=$url{$fmt}&ID=$id}">#$id</a>&nbsp;</td>
54 <td><b><small>$html{$date{$field{modtime,$cgi{ID}},%Y-%m-%d %H:%M}}</small>
55 <a href="$html{$field{url,$cgi{ID}}}">$html{$or{$field{caption,$cgi{ID}},$field{title,$cgi{ID}},$prettyurl{$field{url,$cgi{ID}}},Untitled}}</a></b><br>
56 <small>$highlight{$field{sample,$cgi{ID}},$terms}$if{$field{sample,$cgi{ID}},...}</small><br>
57 <a href="$html{$field{url,$cgi{ID}}}">$prettyurl{$html{$field{url,$cgi{ID}}}}</a><br>
58 <hr></td></tr>}
59 </table>
60 ${suppress next, prev, and page links if there's only one page}
61 $if{$ne{$lastpage,1},
62 <hr>
63 <input type=hidden name=B value="$html{$cgi{B}}">
64 <center>
65 $def{PREV,$if{$ne{$topdoc,0},<input type=submit name="&lt;" value="Previous">}}
66 $def{PAGE,<input type=submit name="[" value="$1">}
67 $def{SPAGE,<input type=submit name="[" value="$1" disabled=disabled>}
68 $def{NEXT,$if{$ne{$last,$msize},<input type=submit name="&gt;" value="Next">}}
69 ${1-W ... X-(this)-Y ...}
70 $set{w,$min{3,$add{$thispage,-1}}}
71 $set{x,$max{$add{$opt{w},1},$add{$thispage,-3}}}
72 $set{y,$min{$lastpage,$add{$thispage,8}}}
73 $PREV
74 $map{$range{1,$opt{w}},$PAGE{$_}}
75 $if{$ne{$add{$opt{w},1},$opt{x}},...}
76 $map{$range{$opt{x},$add{$thispage,-1}},$PAGE{$_}}
77 $SPAGE{$thispage}
78 $map{$range{$add{$thispage,1},$opt{y}},$PAGE{$_}}
79 $if{$ne{$opt{y},$lastpage},...}
80 $NEXT
81 </center>
84 $if{$or{$error,$and{$not{$cgi{ID}},$eq{$msize,0}}},
85 $if{$error,</form><div style="border:dotted;border-width:1px;padding:.5em;margin:.5em;background-color:yellow">$html{$error}</div><form method=get action="$html{$env{SCRIPT_NAME}}">}
86 Inspect document # <input name=ID size=10>
87 <input type=submit value="Inspect">
88 <hr>
89 Inspect term <input name=B size=10>
90 <input type=submit value="Inspect">
92 $if{$fmt,<input type=hidden name=FMT value="$html{$fmt}">}
93 $if{$dbname,<input type=hidden name=DB value="$html{$dbname}">}
94 <hr><div align=right><i><small>$html{$version}</small></i></div>
95 </form>
96 </body>
97 </html>