source: MILK/trunk/milk_server/milk_server/templates/ndgPage.kid @ 4472

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/templates/ndgPage.kid@4992
Revision 4472, 6.9 KB checked in by cbyrom, 11 years ago (diff)

Strip out code not relevant to MILK - mainly WCS and WMS stuff - also including the CSML server code + trackback code
Also tidy up structure of 'public' dir - setting up new 'style' dir and
centralising icons in icons dir + remove all unused icons, javascript and stylesheets.
Also strip out testcase code and populate new test directory structure.

Line 
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="$g.server/js/toggleDiv.js"/>
12
13        <link media="all, screen" href="$g.server/layout/style/ndg2.css" type="text/css" rel="stylesheet"/>
14    </head>
15
16    <div py:def="header1(searchBox)">
17        <div id="header"/>
18        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div>
19    </div>
20   
21    <div py:def="header()">
22        <div id="header"/>
23        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div>
24    </div>
25   
26    <!-- One line search box for top of many pages follows -->
27   
28    <div py:def="searchOneLine(targets=0)" class="searchBar">
29        <table width="100%"><tr><td align="left">
30        <form action="$g.discoveryURL">
31            New text search<span py:replace="helpIcon('nts_help')"/>&nbsp;
32            <input type="text" size="25" name="searchString"/>
33            <select name="textTarget">
34            <option value="Authors">Authors</option>
35            <option value="All" selected="selected">All</option>
36            <option value="Params">Parameters</option>
37            </select>
38            <span py:if="targets"> in
39            <?python
40            sel=[['Discovery','Discovery'],['Browse','Browse'],['Simulation','NumSim']]
41            ?>
42            <select name="searchTarget">
43                ${XML(h.options_for_select(sel,targets))}
44            </select>
45            </span>
46            <input type="submit" value="Search"/>
47         </form>
48         </td><!--<td align="right">
49         <form action="$g.discoveryURL">
50            <input type="submit" value="New Search"/>
51            <span py:replace="helpIcon('ns_help')"/>
52         </form>
53         </td>--><td py:if="not g.standalone" align="right">
54            <span py:if="'ndgSec' in session" id="loginBar">
55            <span py:replace="logOut()"/></span>
56            <span py:if="'ndgSec' not in session" id="loginBar">
57            <span py:replace="logIn()"/></span>
58        </td></tr></table>
59          <div id="nts_help" class="hidden">
60            <div class="helptxt"><p> This will do a completely new text search with no constraints beyond the target of the
61            text search from the drop down list (All, Authors, Parameters) </p></div>
62          </div>
63          <div id="ns_help" class="hidden">
64            <div class="helptxt"><p> This will return you to the new search page</p></div>
65          </div>
66    </div>
67   
68    <div py:def="PageTabs(tabv)" id="PageTabs">
69        <div id="PageTabRow">
70            <ul>
71                <span py:for="tab in c.pageTabs">
72                    <?python
73                    linkto=True
74                    if tab[0] == tabv:
75                        status='current'
76                        linkto=False
77                    else: status='hidden'
78                    ?>
79                    <li class="$status"><span class="pagetab">
80                        ${XML(h.link_to_if(linkto,tab[0],tab[1]))}
81                    </span></li>
82                 </span>
83            </ul>
84        </div>
85        <div class="line"/>
86        <div class="clear"/>
87    </div>
88    <py if="c.UpdatePageTabs" py:replace="PageTabs(c.current)"/>
89
90    <!-- Page Footer follows -->
91    <div py:def="footer()" id="Footer">
92        <center><table><tbody>
93            <tr>
94                <td align="left" width="60%">
95                    <table><tbody>
96                    <tr><td><span py:replace="linkimage(g.ndgLink,g.ndgImage,'NDG')"/></td>
97                    <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a>
98                    ${g.disclaimer} </td>
99                    </tr>
100                    </tbody></table>
101                </td>
102                <td width="40%" align="center">
103                    <div py:if="not g.standalone" id="loginStatus">
104                        <!--! now we choose one of the next two (logged in or not) -->
105                        <div py:if="'ndgSec' in session"><table><tbody><tr><td>
106                        User [${session['ndgSec']['u']}] logged in at
107                        ${session['ndgSec']['org']} with roles
108                        [${len(session['ndgSec']['roles'])==1 and session['ndgSec']['roles'][0] or ', '.join(session['ndgSec']['roles'])}]</td><td>
109                        &nbsp;<span py:replace="logOut()"/></td></tr></tbody></table></div>
110                        <div py:if="'ndgSec' not in session">Further services may be available if you can
111                            <span py:replace="logIn()"/></div>
112                    </div>
113                </td>
114                <td align="right"><span py:replace="linkimage(g.stfcLink,g.stfcImage,'Hosted by the STFC CEDA')"/></td>
115            </tr>
116        </tbody></table></center>
117    </div>
118   
119    <!-- Utility Functions follow -->
120   
121    <!-- hyperlinked image -->
122    <span py:def="linkimage(linkref,imageref,alttext)">
123        <a href="$linkref"><image src="$imageref" alt="$alttext" title="$alttext"/></a>
124    </span>
125   
126    <!-- Help Icons -->
127    <span py:def="helpIcon(value)">
128        <span>
129            <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;">
130            <img src="$g.helpIcon" alt="Toggle help" class="helpicon"/></a>
131     
132        </span>
133    </span>
134   
135    <!-- Login and out buttons --> 
136    <span py:def="logOut()" class="logOut">
137            <?python
138            from base64 import urlsafe_b64encode
139           
140            # Base 64 encode to enable passing around in 'r' argument of query
141            # string for use with login/logout
142            g.ndg.security.common.sso.state.returnToURL = str(c.requestURL)
143            g.ndg.security.common.sso.state.b64encReturnToURL = urlsafe_b64encode(c.requestURL)
144            ?>
145        <form action="$g.logout">
146            <input type="hidden" name="r" value="${g.ndg.security.common.sso.state.b64encReturnToURL}"/>
147            <input type="submit" value="Logout"/>
148        </form>
149    </span>
150   
151    <span py:def="logIn()" class="logIn">
152            <?python
153            from base64 import urlsafe_b64encode
154           
155            # Base 64 encode to enable passing around in 'r' argument of query
156            # string for use with login/logout
157            g.ndg.security.common.sso.state.returnToURL = str(c.requestURL)
158            g.ndg.security.common.sso.state.b64encReturnToURL = urlsafe_b64encode(c.requestURL)
159            ?>
160        <form action="$g.wayfuri">
161            <input type="hidden" name="r" value="${g.ndg.security.common.sso.state.b64encReturnToURL}"/>
162            <input type="submit" value="Login"/>
163        </form>
164    </span>
165   
166   
167   
168</html>
Note: See TracBrowser for help on using the repository browser.