1 | <!-- This is a bunch of named templates for use in pages --> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> |
---|
3 | |
---|
4 | <!-- HTML Header and Document header follow --> |
---|
5 | |
---|
6 | <head py:def="pagehead()" py:strip="True"> |
---|
7 | <title py:content="c.title">title</title> |
---|
8 | <!--! The following includes the javascript, note that the XML |
---|
9 | function is needed to avoid escaping the < character --> |
---|
10 | ${XML(h.javascript_include_tag(builtins=True))} |
---|
11 | <script type="text/javascript" src="/js/toggleDiv.js"/> |
---|
12 | |
---|
13 | <link media="all, screen" href="/layout/ndg2.css" type="text/css" rel="stylesheet"/> |
---|
14 | |
---|
15 | </head> |
---|
16 | |
---|
17 | <div py:def="header1(searchBox)"> |
---|
18 | <div id="header"/> |
---|
19 | <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> |
---|
20 | </div> |
---|
21 | |
---|
22 | <div py:def="header()"> |
---|
23 | <div id="header"/> |
---|
24 | <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> |
---|
25 | </div> |
---|
26 | |
---|
27 | <!-- One line search box for top of many pages follows --> |
---|
28 | |
---|
29 | <div py:def="searchOneLine(targets=0)" class="searchBar"> |
---|
30 | <table width="100%"><tr><td align="left"> |
---|
31 | <form action="$g.discoveryURL"> |
---|
32 | New text search<span py:replace="helpIcon('nts_help')"/> |
---|
33 | <input type="text" size="25" name="searchString"/> |
---|
34 | <select name="textTarget"> |
---|
35 | <option value="Authors">Authors</option> |
---|
36 | <option value="All" selected="selected">All</option> |
---|
37 | <option value="Params">Parameters</option> |
---|
38 | </select> |
---|
39 | <span py:if="targets"> in |
---|
40 | <?python |
---|
41 | sel=[['Discovery','Discovery'],['Browse','Browse'],['Simulation','NumSim']] |
---|
42 | ?> |
---|
43 | <select name="searchTarget"> |
---|
44 | ${XML(h.options_for_select(sel,targets))} |
---|
45 | </select> |
---|
46 | </span> |
---|
47 | <input type="submit" value="Search"/> |
---|
48 | </form> |
---|
49 | </td><!--<td align="right"> |
---|
50 | <form action="$g.discoveryURL"> |
---|
51 | <input type="submit" value="New Search"/> |
---|
52 | <span py:replace="helpIcon('ns_help')"/> |
---|
53 | </form> |
---|
54 | </td>--><td align="right"> |
---|
55 | <span py:if="'ndgSec' in session" id="loginBar"> |
---|
56 | <span py:replace="logOut()"/></span> |
---|
57 | <span py:if="'ndgSec' not in session" id="loginBar"> |
---|
58 | <span py:replace="logIn()"/></span> |
---|
59 | </td></tr></table> |
---|
60 | <div id="nts_help" class="hidden"> |
---|
61 | <div class="helptxt"><p> This will do a completely new text search with no constraints beyond the target of the |
---|
62 | text search from the drop down list (All, Authors, Parameters) </p></div> |
---|
63 | </div> |
---|
64 | <div id="ns_help" class="hidden"> |
---|
65 | <div class="helptxt"><p> This will return you to the new search page</p></div> |
---|
66 | </div> |
---|
67 | </div> |
---|
68 | |
---|
69 | <div py:def="PageTabs(tabv)" id="PageTabs"> |
---|
70 | <div id="PageTabRow"> |
---|
71 | <ul> |
---|
72 | <span py:for="tab in c.pageTabs"> |
---|
73 | <?python |
---|
74 | linkto=True |
---|
75 | if tab[0] == tabv: |
---|
76 | status='current' |
---|
77 | linkto=False |
---|
78 | else: status='hidden' |
---|
79 | ?> |
---|
80 | <li class="$status"><span class="pagetab"> |
---|
81 | ${XML(h.link_to_if(linkto,tab[0],tab[1]))} |
---|
82 | </span></li> |
---|
83 | </span> |
---|
84 | <!--<li py:for="i in enumerate()" class="${status[i[0]]}"> |
---|
85 | <span class="pagetab">${i[1]}</span> |
---|
86 | </li>--> |
---|
87 | <!-- <li class="${status[i[0]]}"> |
---|
88 | <span class="pagetab"> ${i[1]}</span> |
---|
89 | </li> |
---|
90 | <li> $i </li> |
---|
91 | </span>--> |
---|
92 | </ul> |
---|
93 | </div> |
---|
94 | <div class="line"/> |
---|
95 | <div class="clear"/> |
---|
96 | </div> |
---|
97 | <py if="c.UpdatePageTabs" py:replace="PageTabs(c.current)"/> |
---|
98 | |
---|
99 | <!-- History and Shopping Cart follow --> |
---|
100 | |
---|
101 | <div py:def="leftpanel()" id="Left"> |
---|
102 | <div py:if="session['panelView']=='History'"> |
---|
103 | <div class="tabhdr"> |
---|
104 | <ul> |
---|
105 | <li class="current"> <span class="tabhdri">History</span></li> |
---|
106 | <li class="hidden"><span class="tabhdri">${XML(h.link_to_remote("Selected",dict(update="Left", url=h.url_for(controller="tabs", action="update",value="Selection"))))}</span></li> |
---|
107 | </ul> |
---|
108 | </div> |
---|
109 | <div class="tabcontent"> |
---|
110 | <p> Dataset History </p> |
---|
111 | <ul py:if="'history' in session"> |
---|
112 | <li py:for="item in session['history']"> |
---|
113 | ${XML(h.link_to(item[0],item[1]))}</li> |
---|
114 | </ul> |
---|
115 | </div> |
---|
116 | </div> |
---|
117 | <div py:if="session['panelView']=='Selection'"> |
---|
118 | <div class="tabhdr"> |
---|
119 | <ul> |
---|
120 | <li class="hidden"><span class="tabhdri">${XML(h.link_to_remote("History",dict(update="Left", url=h.url_for(controller="tabs", action="update",value="History"))))}</span></li> |
---|
121 | <li class="current"><span class="tabhdri">Selection</span></li> |
---|
122 | </ul> |
---|
123 | </div> |
---|
124 | <div class="tabcontent"> |
---|
125 | <p> Selected Datasets </p> |
---|
126 | <ul py:if="'selection' in session"> |
---|
127 | <li py:for="item in session['selection']"> |
---|
128 | ${XML(h.link_to(item[1],item[0]))}</li> |
---|
129 | </ul> |
---|
130 | ${XML(h.link_to_remote("Clear",dict(update="Left", url=h.url_for(controller="tabs", action="clear",value="Selection"))))} |
---|
131 | </div> |
---|
132 | </div> |
---|
133 | </div> |
---|
134 | |
---|
135 | <!-- Page Footer follows --> |
---|
136 | |
---|
137 | <div py:def="footer()" id="Footer"> |
---|
138 | <center><table><tbody> |
---|
139 | <tr> |
---|
140 | <td align="left" width="60%"> |
---|
141 | <table><tbody> |
---|
142 | <tr><td><span py:replace="linkimage(g.ndgLink,g.ndgImage,'NDG')"/></td> |
---|
143 | <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a> |
---|
144 | ${g.disclaimer} </td> |
---|
145 | </tr> |
---|
146 | </tbody></table> |
---|
147 | </td> |
---|
148 | <td width="40%" align="center"> |
---|
149 | <div py:if="not g.standalone" id="loginStatus"> |
---|
150 | <!--! now we choose one of the next two (logged in or not) --> |
---|
151 | <div py:if="'ndgSec' in session"><table><tbody><tr><td> |
---|
152 | User [${session['ndgSec']['u']}] logged in at |
---|
153 | ${session['ndgSec']['org']} with roles |
---|
154 | [${len(session['ndgSec']['roles'])==1 and session['ndgSec']['roles'][0] or ', '.join(session['ndgSec']['roles'])}]</td><td> |
---|
155 | <span py:replace="logOut()"/></td></tr></tbody></table></div> |
---|
156 | <div py:if="'ndgSec' not in session">Further services maybe available if you can |
---|
157 | <span py:replace="logIn()"/></div> |
---|
158 | </div> |
---|
159 | </td> |
---|
160 | <td align="right"><span py:replace="linkimage(g.stfcLink,g.stfcImage,'Hosted by the STFC CEDA')"/></td> |
---|
161 | </tr> |
---|
162 | </tbody></table></center> |
---|
163 | </div> |
---|
164 | |
---|
165 | <!-- Utility Functions follow --> |
---|
166 | |
---|
167 | <!-- hyperlinked image --> |
---|
168 | <span py:def="linkimage(linkref,imageref,alttext)"> |
---|
169 | <a href="$linkref"><image src="$imageref" alt="$alttext" title="$alttext"/></a> |
---|
170 | </span> |
---|
171 | |
---|
172 | <!-- Help Icons --> |
---|
173 | <span py:def="helpIcon(value)"> |
---|
174 | <span> |
---|
175 | <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;"> |
---|
176 | <img src="$g.helpIcon" alt="Toggle help" class="helpicon"/></a> |
---|
177 | |
---|
178 | </span> |
---|
179 | </span> |
---|
180 | |
---|
181 | <!-- Login and out buttons --> |
---|
182 | <span py:def="logOut()" class="logOut"> |
---|
183 | <form action="$g.logout"> |
---|
184 | <input type="hidden" name="r" value="${c.b64encRequestURL}"/> |
---|
185 | <input type="submit" value="Logout"/> |
---|
186 | </form> |
---|
187 | </span> |
---|
188 | |
---|
189 | <span py:def="logIn()" class="logIn"> |
---|
190 | <form action="$g.wayfuri"> |
---|
191 | <input type="hidden" name="r" value="${c.b64encRequestURL}"/> |
---|
192 | <input type="submit" value="Login"/> |
---|
193 | </form> |
---|
194 | </span> |
---|
195 | |
---|
196 | |
---|
197 | |
---|
198 | </html> |
---|