source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ndgPage.kid @ 3421

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ndgPage.kid@3421
Revision 3421, 8.0 KB checked in by cbyrom, 12 years ago (diff)

Implement 'Selections' tab - a shopping cart type function to
allow the storing of different DIF selections together. Functionality
implemented to allow users to select/unselect DIFs from the results
screen and also to remove them, and remove everything, from the
Selections tab. Also, if KML is available for the DIF, icons are
provided to allow the user to open the file - currently valid for
the GoogleEarth? option but not the ConTerra?. Lastly, checkboxes
are provided - together with a 'select all' one - to allow selection
of multiple DIFs when viewing the associated KML. NB, this latter
functionality is not yet implemented.

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