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.ndg.security.server.ssoservice.cfg.server/js/toggleDiv.js"/> |
---|
12 | |
---|
13 | <link media="all, screen" href="$g.ndg.security.server.ssoservice.cfg.server/layout/ndg2.css" type="text/css" rel="stylesheet"/> |
---|
14 | <link rel="icon" type="image/ico" href="$g.ndg.security.server.ssoservice.cfg.server/layout/favicon.jpg" /> |
---|
15 | |
---|
16 | </head> |
---|
17 | |
---|
18 | <div py:def="header()"> |
---|
19 | <div id="header"/> |
---|
20 | <div id="logo"><img src="$g.ndg.security.server.ssoservice.cfg.LeftLogo" alt="$g.ndg.security.server.ssoservice.cfg.LeftAlt" /></div> |
---|
21 | </div> |
---|
22 | |
---|
23 | <div py:def="PageTabs(tabv)" id="PageTabs"> |
---|
24 | <div id="PageTabRow"> |
---|
25 | <ul> |
---|
26 | <span py:for="tab in c.pageTabs"> |
---|
27 | <?python |
---|
28 | linkto=True |
---|
29 | if tab[0] == tabv: |
---|
30 | status='current' |
---|
31 | linkto=False |
---|
32 | else: status='hidden' |
---|
33 | ?> |
---|
34 | <li class="$status"><span class="pagetab"> |
---|
35 | ${XML(h.link_to_if(linkto,tab[0],tab[1]))} |
---|
36 | </span></li> |
---|
37 | </span> |
---|
38 | </ul> |
---|
39 | </div> |
---|
40 | <div class="line"/> |
---|
41 | <div class="clear"/> |
---|
42 | </div> |
---|
43 | <py if="c.UpdatePageTabs" py:replace="PageTabs(c.current)"/> |
---|
44 | |
---|
45 | <!-- Page Footer follows --> |
---|
46 | <div py:def="footer(showLoginStatus=True)" id="Footer"> |
---|
47 | <center><table><tbody> |
---|
48 | <tr> |
---|
49 | <td align="left" width="60%"> |
---|
50 | <table><tbody> |
---|
51 | <tr><td><span py:replace="linkimage(g.ndg.security.server.ssoservice.cfg.ndgLink,g.ndg.security.server.ssoservice.cfg.ndgImage,'NDG')"/></td> |
---|
52 | <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a> |
---|
53 | ${g.ndg.security.server.ssoservice.cfg.disclaimer} </td> |
---|
54 | </tr> |
---|
55 | </tbody></table> |
---|
56 | </td> |
---|
57 | <td width="40%" align="center"> |
---|
58 | <div id="loginStatus" py:if="showLoginStatus==True"> |
---|
59 | <!--! now we choose one of the next two (logged in or not) --> |
---|
60 | <div py:if="'ndgSec' in session"><table><tbody><tr><td> |
---|
61 | User [${session['ndgSec']['u']}] logged in at |
---|
62 | ${session['ndgSec']['org']} with roles |
---|
63 | [${len(session['ndgSec']['roles'])==1 and session['ndgSec']['roles'][0] or ', '.join(session['ndgSec']['roles'])}]</td><td> |
---|
64 | <span py:replace="logOut()"/></td></tr></tbody></table></div> |
---|
65 | <div py:if="'ndgSec' not in session">Further services maybe available if you can |
---|
66 | <span py:replace="logIn()"/></div> |
---|
67 | </div> |
---|
68 | </td> |
---|
69 | <td align="right"><span py:replace="linkimage(g.ndg.security.server.ssoservice.cfg.stfcLink,g.ndg.security.server.ssoservice.cfg.stfcImage,'Hosted by the STFC CEDA')"/></td> |
---|
70 | </tr> |
---|
71 | </tbody></table></center> |
---|
72 | </div> |
---|
73 | |
---|
74 | <!-- Utility Functions follow --> |
---|
75 | |
---|
76 | <!-- hyperlinked image --> |
---|
77 | <span py:def="linkimage(linkref,imageref,alttext)"> |
---|
78 | <a href="$linkref"><image src="$imageref" alt="$alttext" title="$alttext"/></a> |
---|
79 | </span> |
---|
80 | |
---|
81 | <!-- Help Icons --> |
---|
82 | <span py:def="helpIcon(value)"> |
---|
83 | <span> |
---|
84 | <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;"> |
---|
85 | <img src="$g.ndg.security.server.ssoservice.cfg.helpIcon" alt="Toggle help" class="helpicon"/></a> |
---|
86 | |
---|
87 | </span> |
---|
88 | </span> |
---|
89 | |
---|
90 | <!-- Login and out buttons --> |
---|
91 | <span py:def="logOut()" class="logOut"> |
---|
92 | <form action="$g.ndg.security.server.ssoservice.cfg.logout"> |
---|
93 | <input type="hidden" name="r" value="${c.b64encReturnTo}"/> |
---|
94 | <input type="submit" value="Logout"/> |
---|
95 | </form> |
---|
96 | </span> |
---|
97 | |
---|
98 | <span py:def="logIn()" class="logIn"> |
---|
99 | <?python |
---|
100 | from base64 import urlsafe_b64encode |
---|
101 | |
---|
102 | # Base 64 encode to enable passing around in 'r' argument of query |
---|
103 | # string for use with login/logout |
---|
104 | c.returnTo = c.requestURL |
---|
105 | c.b64encReturnTo = urlsafe_b64encode(c.requestURL) |
---|
106 | ?> |
---|
107 | <form action="$g.ndg.security.server.ssoservice.cfg.wayfuri"> |
---|
108 | <input type="hidden" name="r" value="${c.b64encReturnTo}"/> |
---|
109 | <input type="submit" value="Login"/> |
---|
110 | </form> |
---|
111 | </span> |
---|
112 | |
---|
113 | |
---|
114 | |
---|
115 | </html> |
---|