import current xml dump
[irspy-moved-to-github.git] / web / htdocs / chrome / layout.mc
1 %# $Id: layout.mc,v 1.38 2007-07-17 13:07:57 mike Exp $
2 <%args>
3 $debug => undef
4 $title
5 $component
6 </%args>
7 <%once>
8 use URI::Escape qw(uri_escape uri_escape_utf8);
9 use ZOOM;
10 use ZOOM::IRSpy::Web;
11 use ZOOM::IRSpy::Utils qw(utf8param isodate xml_encode cql_target cql_quote
12                           irspy_xpath_context irspy_make_identifier
13                           irspy_record2identifier
14                           irspy_identifier2target modify_xml_document
15                           bib1_access_point);
16 </%once>
17 % $r->content_type("text/html; charset=utf-8");
18 % my $text = $m->scomp($component, %ARGS);
19 <?xml version="1.0" encoding="UTF-8"?>
20 <!DOCTYPE html 
21      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
22     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
23 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
24  <head>
25   <title>IRSpy: <% xml_encode($title) %></title>
26   <link rel="stylesheet" type="text/css" href="/style.css"/>
27  </head>
28  <body>
29   <table border="0" cellpadding="0" cellspacing="0" width="100%">
30    <tr class="banner">
31     <td>
32      <table width="100%">
33       <tr>
34        <td align="left">
35         <br/>
36         <h1><a class="logo" href="/">IRSpy</a></h1>
37        </td>
38        <td align="right">
39         <br/>
40         <h1 class="title"><% xml_encode($title) %></h1>
41        </td>
42       </tr>
43      </table>
44     </td>
45    </tr>
46   </table>
47   <table border="0" cellpadding="0" cellspacing="0" width="100%">
48    <tr class="panel3">
49     <td align="left">
50      &nbsp; <!-- Force display -->
51      <!-- Lmenu left -->
52     </td>
53     <td>
54      <!-- Lmenu middle -->
55     </td>
56     <td align="right">
57      <!-- Lmenu right -->
58     </td>
59    </tr>
60   </table>
61   <p></p>
62   <table border="0" cellpadding="0" cellspacing="0" width="100%">
63    <tr>
64     <td valign="top" class="panel1">
65      <p>
66       <a href="/"><b>Home</b></a><br/>
67       <a href="/admin/all.html">Test&nbsp;all&nbsp;targets</a><br/>
68       <a href="/find.html">Find a target</a><br/>
69       <a href="/add.html">Add a target</a><br/>
70       <a href="/upload.html">Upload a target</a><br/>
71       <a href="/stats.html">Statistics</a><br/>
72      </p>
73      <p>
74       <b>Show targets</b>
75       <br/>
76 % foreach my $i ('a' .. 'z') {
77       <a href="/find.html?dc.title=^<% $i %>*&amp;_sort=dc.title&amp;_count=9999&amp;_search=Search"><tt><% uc($i) %></tt></a>
78 % }
79       <a href="/find.html?cql.allRecords=1+not+dc.title+=/regexp/firstInField+[a-z].*&amp;_sort=dc.title&amp;_count=9999&amp;_search=Search">[Others]</a>
80      </p>
81 <%perl>
82 # Find the identifier to use in the record-specific menu, if any.  If
83 # the identifier components are all present (e.g. because a record has
84 # just been edited or copied) we make an ID from those; otherwise we
85 # use the "id" parameter, if specified.
86 my $id = utf8param($r, "id");
87 {
88     # Make up ID for newly created records.
89     my $protocol = utf8param($r, "protocol");
90     my $host = utf8param($r, "host");
91     my $port = utf8param($r, "port");
92     my $dbname = utf8param($r, "dbname");
93     #warn "id='$id', protocol='$protocol' host='$host', port='$port', dbname='$dbname'";
94     #warn "%ARGS = {\n" . join("", map { "\t'$_' => '" . $ARGS{$_} . ",'\n" } sort keys %ARGS) . "}\n";
95     if (defined $protocol && defined $host &&
96         defined $port && defined $dbname) {
97         $id = irspy_make_identifier($protocol, $host, $port, $dbname);
98         #warn "id set to '$id'";
99     }
100 }
101 </%perl>
102 % if (defined $id) {
103      <div class="panel2">
104       <b>This Target</b>
105       <br/>
106       <a href="<% xml_encode("/full.html?id=" . uri_escape($id)) %>">Show details</a>
107       <br/>
108       <a href="<% xml_encode("/admin/edit.html?op=edit&id=" . uri_escape($id)) %>">Edit details</a>
109       <br/>
110       <a href="<% xml_encode("/admin/edit.html?op=copy&id=" . uri_escape($id)) %>">Copy target</a>
111       <br/>
112       <a href="<% xml_encode("/admin/delete.html?id=" . uri_escape($id)) %>">Delete target</a>
113       <p>
114        <a href="<% xml_encode("/admin/check.html?id=" . uri_escape($id)) . "&amp;test=Quick" %>">Quick Test</a>
115        <br/>
116        <a href="<% xml_encode("/admin/check.html?id=" . uri_escape($id)) . "&amp;test=Main" %>">Full Test</a>
117       </p>
118       <p>
119        <a href="<% xml_encode("/raw.html?id=" . uri_escape($id)) %>">XML</a>
120       </p>
121 <%doc><!-- Maybe this would be too heavyweight -->
122       <br/>
123 % my $host = "bagel.indexdata.dk";
124 % my $port = 210;
125       <a href="/find.html?net.host=<% $host %>&net.port=<% $port %>&_search=Search"
126         >All databases on this server</a>
127 </%doc>
128      </div>
129 % }
130      <p>
131       <b>Documentation</b>
132       <br/>
133       <a href="/doc.html">Contents</a>
134      </p>
135      <p>&nbsp;</p>
136      <p>
137       <a href="http://validator.w3.org/check?uri=referer"><img
138         src="/valid-xhtml10.png"
139         alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
140       <br/>
141       <a href="http://jigsaw.w3.org/css-validator/"><img
142         src="/vcss.png"
143         alt="Valid CSS!" height="31" width="88" /></a>
144      </p>
145     </td>
146     <td class="spacer">&nbsp;</td>
147     <td valign="top">
148 % print $text;
149     </td>
150    </tr>
151   </table>
152   <p/>
153   <hr/>
154   <div class="right">
155    <small>
156     Powered by <a style="text-decoration: none"
157         href="http://indexdata.com/"
158         >Index&nbsp;Data</a>.
159     <br/>
160     Report errors and omissions to <a style="text-decoration: none"
161         href="mailto:irspy@indexdata.com"
162                     >irspy@indexdata.com</a>
163    </small>
164   </div>
165  </body>
166 </html>