Include all statically named components inline, since they were not
[irspy-moved-to-github.git] / web / htdocs / chrome / layout.mc
1 %# $Id: layout.mc,v 1.20 2006-12-14 15:39:06 mike Exp $
2 <%args>
3 $debug => undef
4 $title
5 $component
6 </%args>
7 <%once>
8 use URI::Escape;
9 use ZOOM;
10 use ZOOM::IRSpy::Web;
11 use ZOOM::IRSpy::Utils qw(isodate xml_encode cql_quote cql_target
12                           irspy_xpath_context modify_xml_document);
13 </%once>
14 % $r->content_type("text/html; charset=utf-8");
15 <?xml version="1.0" encoding="UTF-8"?>
16 <!DOCTYPE html 
17      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
18     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
19 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
20  <head>
21   <title>IRSpy: <% xml_encode($title) %></title>
22   <link rel="stylesheet" type="text/css" href="/style.css"/>
23  </head>
24  <body>
25   <table border="0" cellpadding="0" cellspacing="0" width="100%">
26    <tr class="banner">
27     <td align="left">
28      <br/>
29      <h1><a class="logo" href="/">IRSpy</a></h1>
30     </td>
31     <td align="right">
32      <br/>
33      <h1 class="title"><% xml_encode($title) %></h1>
34     </td>
35    </tr>
36   </table>
37   <table border="0" cellpadding="0" cellspacing="0" width="100%">
38    <tr class="panel3">
39     <td align="left">
40      &nbsp; <!-- Force display -->
41      <!-- Lmenu left -->
42     </td>
43     <td>
44      <!-- Lmenu middle -->
45     </td>
46     <td align="right">
47      <!-- Lmenu right -->
48     </td>
49    </tr>
50   </table>
51   <p></p>
52   <table border="0" cellpadding="0" cellspacing="0" width="100%">
53    <tr>
54     <td valign="top" class="panel1">
55      <p>
56       <a href="/"><b>Home</b></a><br/>
57       <a href="/all.html">Test&nbsp;all&nbsp;targets</a><br/>
58       <a href="/find.html">Find a target</a><br/>
59       <a href="/edit.html?op=new">Add a target</a><br/>
60       <a href="/stats.html">Statistics</a><br/>
61      </p>
62      <p>
63       <b>Show targets</b>
64       <br/>
65 % foreach my $i ('a' .. 'z') {
66       <a href="/find.html?dc.title=^<% $i %>*&amp;_sort=dc.title&amp;_count=9999&amp;_search=Search"><tt><% uc($i) %></tt></a>
67 % }
68      </p>
69 <%perl>
70 my $id = $r->param("id");
71 {
72     # Make up ID for newly created records.  It would be more
73     # rigorously correct, but insanely inefficient, to submit the
74     # record to Zebra and then search for it; but since we know the
75     # formula for IDs anyway, we just build one by hand.
76     my $id = $r->param("id");
77     my $host = $r->param("host");
78     my $port = $r->param("port");
79     my $dbname = $r->param("dbname");
80     #warn "id='$id', host='$host', port='$port', dbname='$dbname'";
81     #warn "%ARGS = {\n" . join("", map { "\t'$_' => '" . $ARGS{$_} . ",'\n" } sort keys %ARGS) . "}\n";
82     if ((!defined $id || $id eq "") &&
83         defined $host && defined $port && defined $dbname) {
84         $id = "$host:$port/$dbname";
85         #warn "id set to '$id'";
86     }
87 }
88 </%perl>
89 % if (defined $id && $r->param("op") ne "copy") {
90      <div class="panel2">
91       <b>This Target</b>
92       <br/>
93       <a href="<% xml_encode("/full.html?id=" . uri_escape($id)) %>">Show details</a>
94       <br/>
95       <a href="<% xml_encode("/edit.html?op=edit&id=" . uri_escape($id)) %>">Edit details</a>
96       <br/>
97       <a href="<% xml_encode("/edit.html?op=copy&id=" . uri_escape($id)) %>">Copy target</a>
98       <p>
99        <a href="<% xml_encode("/check.html?id=" . uri_escape($id)) . "&amp;test=Quick" %>">Quick Test</a>
100        <br/>
101        <a href="<% xml_encode("/check.html?id=" . uri_escape($id)) . "&amp;test=Main" %>">Full Test</a>
102       </p>
103       <p>
104        <a href="<% xml_encode("/raw.html?id=" . uri_escape($id)) %>">XML</a>
105       </p>
106 <%doc><!-- Maybe this would be too heavyweight -->
107       <br/>
108 % my $host = "bagel.indexdata.dk";
109 % my $port = 210;
110       <a href="/find.html?net.host=<% $host %>&net.port=<% $port %>&_search=Search"
111         >All databases on this server</a>
112 </%doc>
113      </div>
114 % }
115      <p>
116       <b>Documentation</b>
117       <br/>
118       <a href="/doc.html">Contents</a>
119      </p>
120      <p>&nbsp;</p>
121      <p>
122       <a href="http://validator.w3.org/check?uri=referer"><img
123         src="/valid-xhtml10.png"
124         alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
125       <br/>
126       <a href="http://jigsaw.w3.org/css-validator/"><img
127         src="/vcss.png"
128         alt="Valid CSS!" height="31" width="88" /></a>
129      </p>
130     </td>
131     <td class="spacer">&nbsp;</td>
132     <td valign="top">
133 <& $component, %ARGS &>
134     </td>
135    </tr>
136   </table>
137   <p/>
138   <hr/>
139   <div class="right">
140    <small>
141     Powered by <a style="text-decoration: none"
142         href="http://indexdata.com/"
143         >Index&nbsp;Data</a>
144    </small>
145   </div>
146  </body>
147 </html>