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

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

Improve MILK configuration file, to simplify switching on/off the
browse/discovery/editor modes + improve look and feel - according
to mode of operation (inc. add new logos) + remove some obsolete
functionality + hide functions not relevant to the selected mode of
operation.

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