$httpheader{Content-Type,text/html; charset=utf-8}$set{thousand,$.}$set{decimal,.}<!DOCTYPE html><html lang="en">
<head>
<title>Omega:
$if{$cgi{ID},
Document #$html{$cgi{ID}},
$if{$ne{$msize,0},
Term "$html{$cgi{B}}",
Choose what to Inspect}}
</title>
</head>
<body bgcolor=white>
<form method=get action="$html{$env{SCRIPT_NAME}}">

$if{$cgi{ID},
$setrelevant{$cgi{ID}}
<h1>Document #$html{$cgi{ID}}</h1>

<h2>Terms indexing this document</h2>

<table>
<tr><th>Frequency</th><th align=left>Term</th></tr>
$map{$allterms{$cgi{ID}},
<tr><td align=right>$freq{$_}</td>
<td><a href="$html{$env{SCRIPT_NAME}?$if{$dbname,DB=$url{$dbname}&}FMT=$url{$fmt}&B=$url{$_}}">$html{$_}</a></td></tr>}
</table>

<h2>Document Data</h2>

<pre>$html{$record{$cgi{ID}}}</pre>

<h2>Document Values</h2>

$set{values,$list{$map{$range{0,255},$if{$value{$_,$cgi{ID}},
<tr><td>$_</td><td>$html{$value{$_,$cgi{ID}}}</td></tr>
}},}}
$if{$opt{values},
<table><tr><th>Value#</th><th>Value</th></tr>
$opt{values}
</table>,
<i>No values</i>
}
,
$if{$ne{$msize,0},
$if{$not{$msizeexact},
 $nice{$add{$topdoc,1}}-$nice{$last} of about $nice{$msize} matches,
 $if{$and{$eq{$last,$msize},$eq{$topdoc,0}},
  All $nice{$msize} matches,
  $nice{$add{$topdoc,1}}$if{$ne{$add{$topdoc,1},$last},-$nice{$last}} of exactly $nice{$msize} matches}
}
<hr>
<table>
$hitlist{<tr>
<td align=right><a href="$html{$env{SCRIPT_NAME}?$if{$dbname,DB=$url{$dbname}&}FMT=$url{$fmt}&ID=$id}">#$id</a>&nbsp;</td>
<td><b><small>$html{$date{$field{modtime,$cgi{ID}},%Y-%m-%d %H:%M}}</small>
<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>
<small>$highlight{$field{sample,$cgi{ID}},$terms}$if{$field{sample,$cgi{ID}},...}</small><br>
<a href="$html{$field{url,$cgi{ID}}}">$prettyurl{$html{$field{url,$cgi{ID}}}}</a><br>
<hr></td></tr>}
</table>
${suppress next, prev, and page links if there's only one page}
$if{$ne{$lastpage,1},
<hr>
<input type=hidden name=B value="$html{$cgi{B}}">
<center>
$def{PREV,$if{$ne{$topdoc,0},<input type=submit name="&lt;" value="Previous">}}
$def{PAGE,<input type=submit name="[" value="$1">}
$def{SPAGE,<input type=submit name="[" value="$1" disabled=disabled>}
$def{NEXT,$if{$ne{$last,$msize},<input type=submit name="&gt;" value="Next">}}
${1-W ... X-(this)-Y ...}
$set{w,$min{3,$add{$thispage,-1}}}
$set{x,$max{$add{$opt{w},1},$add{$thispage,-3}}}
$set{y,$min{$lastpage,$add{$thispage,8}}}
$PREV
$map{$range{1,$opt{w}},$PAGE{$_}}
$if{$ne{$add{$opt{w},1},$opt{x}},...}
$map{$range{$opt{x},$add{$thispage,-1}},$PAGE{$_}}
$SPAGE{$thispage}
$map{$range{$add{$thispage,1},$opt{y}},$PAGE{$_}}
$if{$ne{$opt{y},$lastpage},...}
$NEXT
</center>
}
}}
$if{$or{$error,$and{$not{$cgi{ID}},$eq{$msize,0}}},
$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}}">}
Inspect document # <input name=ID size=10>
<input type=submit value="Inspect">
<hr>
Inspect term <input name=B size=10>
<input type=submit value="Inspect">
}
$if{$fmt,<input type=hidden name=FMT value="$html{$fmt}">}
$if{$dbname,<input type=hidden name=DB value="$html{$dbname}">}
<hr><div align=right><i><small>$html{$version}</small></i></div>
</form>
</body>
</html>
