1 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
2 | xmlns:py="http://genshi.edgewall.org/" |
---|
3 | xmlns:xi="http://www.w3.org/2001/XInclude" py:strip=""> |
---|
4 | |
---|
5 | <xi:include href="utils.html" /> |
---|
6 | <?python |
---|
7 | from ndg.common.src.clients.xmldb.eXist.searchclient import SearchClient |
---|
8 | ?> |
---|
9 | <head py:def="pagehead()" py:strip="True"> |
---|
10 | <title py:content="c.title">title</title> |
---|
11 | <!--! The following includes the javascript, note that the XML |
---|
12 | function is needed to avoid escaping the < character --> |
---|
13 | ${Markup(h.javascript_include_tag(builtins=True))} |
---|
14 | <script type="text/javascript" src="$g.server/js/toggleDiv.js"/> |
---|
15 | <link media="all, screen" href="$g.server/layout/style/ndg2.css" type="text/css" rel="stylesheet"/> |
---|
16 | </head> |
---|
17 | |
---|
18 | <div py:def="header()"> |
---|
19 | <div py:if="g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled" id="browseheader"/> |
---|
20 | <div py:if="not (g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled)" id="editorheader"/> |
---|
21 | <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> |
---|
22 | </div> |
---|
23 | |
---|
24 | <!--! One line search box for top of many pages follows --> |
---|
25 | <div py:def="searchOneLine(targets=0)" class="searchBar"> |
---|
26 | <table width="100%"><tr><td align="left"> |
---|
27 | <form action="$g.discoveryURL"> |
---|
28 | Discovery text search<span py:replace="helpIcon('nts_help', 'div')"/> |
---|
29 | <input type="text" size="25" name="searchString"/> |
---|
30 | <select name="textTarget"> |
---|
31 | <option value="Authors">Authors</option> |
---|
32 | <option value="All" selected="selected">All</option> |
---|
33 | <option value="Params">Parameters</option> |
---|
34 | </select> |
---|
35 | <span py:if="targets"> in |
---|
36 | <?python |
---|
37 | sel=[['Discovery','Discovery'],['Browse','Browse'],['Simulation','NumSim']] |
---|
38 | ?> |
---|
39 | <select name="searchTarget"> |
---|
40 | ${Markup(h.options_for_select(sel,targets))} |
---|
41 | </select> |
---|
42 | </span> |
---|
43 | <input type="submit" value="Search"/> |
---|
44 | </form> |
---|
45 | </td> |
---|
46 | <td py:if="not g.standalone" align="right"> |
---|
47 | <span py:if="'ndgSec' in session" id="loginBar"> |
---|
48 | <span py:replace="logOut()"/></span> |
---|
49 | <span py:if="'ndgSec' not in session" id="loginBar"> |
---|
50 | <span py:replace="logIn()"/></span> |
---|
51 | </td></tr></table> |
---|
52 | <div id="nts_help" class="hidden"> |
---|
53 | <div class="helptxt"><p> This will do a completely new discovery text search with no constraints beyond the target of the |
---|
54 | text search from the drop down list (All, Authors, Parameters) </p></div> |
---|
55 | </div> |
---|
56 | <div id="ns_help" class="hidden"> |
---|
57 | <div class="helptxt"><p> This will return you to the new search page</p></div> |
---|
58 | </div> |
---|
59 | </div> |
---|
60 | |
---|
61 | <!--! One line search box for the local browse service --> |
---|
62 | <div py:def="localTextSearch()" class="searchBar"> |
---|
63 | <table width="100%"><tr><td align="left"> |
---|
64 | <form action="$g.discoveryURL"> |
---|
65 | Browse text search<span py:replace="helpIcon('nts_help', 'div')"/> |
---|
66 | <input type="text" size="25" name="searchString"/> |
---|
67 | <input type="submit" value="Search"/> |
---|
68 | <input type="hidden" name="searchTarget" value="Browse"/> |
---|
69 | <input type="hidden" name="textTarget" value="$SearchClient.ATOM_TARGET"/> |
---|
70 | </form> |
---|
71 | </td> |
---|
72 | </tr></table> |
---|
73 | <div id="nts_help" class="hidden"> |
---|
74 | <div class="helptxt"><p> |
---|
75 | This will do a completely new text search against the local browse documents. |
---|
76 | </p></div> |
---|
77 | </div> |
---|
78 | </div> |
---|
79 | |
---|
80 | |
---|
81 | <div py:def="PageTabs(tabv)" id="PageTabs"> |
---|
82 | <div id="PageTabRow"> |
---|
83 | <ul> |
---|
84 | <!--! NB, for some reason, when tabv is cast into a string |
---|
85 | it then is no longer accessible - so store the result in |
---|
86 | a different variable --> |
---|
87 | <span py:with="currentTab = str(tabv)" py:strip=""> |
---|
88 | <span py:for="tab in c.pageTabs"> |
---|
89 | <span py:if="tab[0] == currentTab"> |
---|
90 | <li class="current"> |
---|
91 | <span class="pagetab"> |
---|
92 | ${Markup(h.link_to_if(False,tab[0],tab[1]))} |
---|
93 | </span> |
---|
94 | </li> |
---|
95 | </span> |
---|
96 | <span py:if="tab[0] != currentTab"> |
---|
97 | <li class="hidden"> |
---|
98 | <span class="pagetab"> |
---|
99 | ${Markup(h.link_to_if(True,tab[0],tab[1]))} |
---|
100 | </span> |
---|
101 | </li> |
---|
102 | </span> |
---|
103 | </span> |
---|
104 | </span> |
---|
105 | </ul> |
---|
106 | </div> |
---|
107 | <div class="line"/> |
---|
108 | <div class="clear"/> |
---|
109 | </div> |
---|
110 | |
---|
111 | |
---|
112 | <div py:def="corrections()" id="Corrections"> |
---|
113 | <p py:if="'ndgSec' in session"> Please use this |
---|
114 | <span> |
---|
115 | ${Markup(h.link_to_remote("link", dict(update="Corrections", |
---|
116 | url=h.url_for(controller='trackback/trackback', action='askCorrect'))))} |
---|
117 | </span> |
---|
118 | to enter any errors in the metadata record above. |
---|
119 | </p> |
---|
120 | </div> |
---|
121 | |
---|
122 | |
---|
123 | <!--! Page Footer follows --> |
---|
124 | <div py:def="footer()" id="Footer"> |
---|
125 | <center><table><tbody> |
---|
126 | <tr> |
---|
127 | <td align="left" width="60%"> |
---|
128 | <table><tbody> |
---|
129 | <tr><td><span py:replace="linkimage(g.ndgLink,g.ndgImage,'NDG')"/></td> |
---|
130 | <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a> |
---|
131 | ${g.disclaimer} </td> |
---|
132 | </tr> |
---|
133 | </tbody></table> |
---|
134 | </td> |
---|
135 | <td width="40%" align="center"> |
---|
136 | </td> |
---|
137 | <td align="right"><span py:replace="linkimage(g.stfcLink,g.stfcImage,'Hosted by the STFC CEDA')"/></td> |
---|
138 | </tr> |
---|
139 | </tbody></table></center> |
---|
140 | </div> |
---|
141 | |
---|
142 | <!--! Login and out buttons --> |
---|
143 | <span py:def="logOut()" class="logOut"> |
---|
144 | <?python |
---|
145 | from base64 import urlsafe_b64encode |
---|
146 | |
---|
147 | # Base 64 encode to enable passing around in 'r' argument of query |
---|
148 | # string for use with login/logout |
---|
149 | g.ndg.security.common.sso.state.returnToURL = str(c.requestURL) |
---|
150 | g.ndg.security.common.sso.state.b64encReturnToURL = urlsafe_b64encode(c.requestURL) |
---|
151 | ?> |
---|
152 | <form action="$g.logout"> |
---|
153 | <input type="hidden" name="r" value="${g.ndg.security.common.sso.state.b64encReturnToURL}"/> |
---|
154 | <input type="submit" value="Logout"/> |
---|
155 | </form> |
---|
156 | </span> |
---|
157 | |
---|
158 | <span py:def="logIn()" class="logIn"> |
---|
159 | <?python |
---|
160 | from base64 import urlsafe_b64encode |
---|
161 | |
---|
162 | # Base 64 encode to enable passing around in 'r' argument of query |
---|
163 | # string for use with login/logout |
---|
164 | g.ndg.security.common.sso.state.returnToURL = str(c.requestURL) |
---|
165 | g.ndg.security.common.sso.state.b64encReturnToURL = urlsafe_b64encode(c.requestURL) |
---|
166 | ?> |
---|
167 | <form action="$g.wayfuri"> |
---|
168 | <input type="hidden" name="r" value="${g.ndg.security.common.sso.state.b64encReturnToURL}"/> |
---|
169 | <input type="submit" value="Login"/> |
---|
170 | </form> |
---|
171 | </span> |
---|
172 | |
---|
173 | |
---|
174 | |
---|
175 | |
---|
176 | </html> |
---|