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