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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/templates/ndgPage.kid@5948
Revision 5948, 10.4 KB checked in by sdonegan, 10 years ago (diff)

Updates to styles, tweaks etc etc

Line 
1<!-- This is a bunch of named templates for use in pages -->
2
3<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#">
4   
5    <!-- HTML Header and Document header follow -->
6   
7    <head py:def="pagehead()" py:strip="True">
8       
9        <title py:content="c.title">title</title>
10        <!--! The following includes the javascript, note that the XML
11        function is needed to avoid escaping the < character -->
12        ${XML(h.javascript_include_tag(builtins=True))}
13        <script type="text/javascript" src="$g.server/js/toggleDiv.js"/>
14
15        <link media="all, screen" href="$g.server/layout/style/ndg2.css" type="text/css" rel="stylesheet"/>
16    </head>
17   
18    <div py:def="header()">
19        <div py:if="g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled" id="browseheader"/>
20        <div py:if="not (g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled)" id="editorheader"/>
21        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div>
22    </div>
23
24
25    <div py:def="semanticSearch()" id="context">
26    <!-- NB, to use this method, you need to add the queueDeployments script to the calling
27    page - see queueDeployments.js for more details -->
28    <table>
29    <tr>
30    <td width="15%">Alternative searches<span py:replace="helpIcon('semser_help')"/>:</td>
31    <td>
32                <div id="altSearchPlaceholder" />
33        </td>
34        </tr>
35        </table>
36    <div id="semser_help" class="hidden">
37        <div class="helptxt"><p>
38        The semantic search option allows you to see how many hits a search using your current parameters would return if you
39        used a slightly different vocabulary in your search term.
40        </p></div>
41    </div>
42        </div>
43
44    <div py:def="pageControl(state, discoveryURL)" class="resultsBar">
45    <!-- NB, can only have one main page control on the page since it has a form and
46    help div associated with it - for the main control, set the discoveryURL to a valid
47    value, otherwise set to None
48    -->
49            <div>
50                <?python
51                formID = "xyz"
52                if discoveryURL:
53                        formID = "orderByForm"
54                ?>
55                <!-- Make sure that paging works for number of items less than paging -->             
56                <?python
57               
58                if state.hits<10:
59                 
60                  state.pager.upperRange=state.hits
61               
62                ?>
63                <form action="$discoveryURL" name="$formID">
64                <input type="hidden" name="constraints" value="${state.urlformattedconstraints}"/>
65                <a href="${state.constrainedurl}"> Refine search</a><span py:replace="helpIcon('refser_help')"/>
66                <span py:if="state.hits != 0" py:strip="">
67                        <span py:if="discoveryURL" py:strip="">
68                           
69                            |Order By ${XML(h.select('orderBy',option_tags = c.orderByList, onchange="orderByForm.submit()"))}
70                        ${XML(h.select('orderDirection',option_tags = c.orderDirection, onchange="orderByForm.submit()"))}
71                    </span>
72                        | Found ${state.hits}
73                    <span py:if="state.pager.previousPageURL"> | <a href="$state.pager.startPageURL"> &lt;&lt; </a>
74                    | <a href="$state.pager.previousPageURL"> Previous ${state.pager.previousNumber}</a> </span>
75                   
76                                | Showing ${state.pager.lowerRange}-${state.pager.upperRange}
77                               
78                               
79                                 <!--Showing ${state.pager.lowerRange} -->
80                    <span py:if="state.pager.nextPageURL"> | <a href="$state.pager.nextPageURL"> Next ${state.pager.nextNumber}</a>
81                    | <a href="$state.pager.lastPageURL"> &gt;&gt; </a></span>
82                 </span>
83                </form>
84            </div>
85            <div py:if="discoveryURL" id="refser_help" class="hidden">
86                <div class="helptxt"><p>
87                The refined search option allows you to constrain your search by returning you to the advanced search page, but retaining your current search parameters
88                </p></div>
89            </div>
90        </div>
91   
92    <!-- One line search box for top of many pages follows -->
93    <div py:def="searchOneLine(targets=0)" class="searchBar">
94        <table width="100%"><tr><td align="left">
95        <form action="$g.discoveryURL">
96            New text search<span py:replace="helpIcon('nts_help')"/>&nbsp;
97            <input type="text" size="25" name="searchString"/>
98            <select name="textTarget">
99            <option value="Authors">Authors</option>
100            <option value="All" selected="selected">All</option>
101            <option value="Params">Parameters</option>
102            </select>
103            <span py:if="targets"> in
104            <?python
105            sel=[['Discovery','Discovery'],['Browse','Browse'],['Simulation','NumSim']]
106            ?>
107            <select name="searchTarget">
108                ${XML(h.options_for_select(sel,targets))}
109            </select>
110            </span>
111            <input type="submit" value="Search"/>
112         </form>
113         </td><!--<td align="right">
114         <form action="$g.discoveryURL">
115            <input type="submit" value="New Search"/>
116            <span py:replace="helpIcon('ns_help')"/>
117         </form>
118         </td>--><td py:if="not g.standalone" align="right">
119            <span py:if="'ndgSec' in session" id="loginBar">
120            <span py:replace="logOut()"/></span>
121            <span py:if="'ndgSec' not in session" id="loginBar">
122            <span py:replace="logIn()"/></span>
123        </td></tr></table>
124          <div id="nts_help" class="hidden">
125            <div class="helptxt"><p> This will do a completely new text search with no constraints beyond the target of the
126            text search from the drop down list (All, Authors, Parameters) </p></div>
127          </div>
128          <div id="ns_help" class="hidden">
129            <div class="helptxt"><p> This will return you to the new search page</p></div>
130          </div>
131    </div>
132   
133    <div py:def="PageTabs(tabv)" id="PageTabs">
134        <div id="PageTabRow">
135            <ul>
136                <span py:for="tab in c.pageTabs">
137                    <?python
138                    linkto=True
139                    if tab[0] == tabv:
140                        status='current'
141                        linkto=False
142                    else: status='hidden'
143                    ?>
144                    <li class="$status"><span class="pagetab">
145                        ${XML(h.link_to_if(linkto,tab[0],tab[1]))}
146                    </span></li>
147                 </span>
148            </ul>
149        </div>
150        <div class="line"/>
151        <div class="clear"/>
152    </div>
153    <py if="c.UpdatePageTabs" py:replace="PageTabs(c.current)"/>
154
155    <!-- Page Footer follows -->
156    <div py:def="footer()" id="Footer">
157        <center><table><tbody>
158            <tr>
159                <td align="left" width="20%">
160                    <table><tbody>
161                    <tr><td><span py:replace="linkimage(g.ndgLink,g.ndgImage,'NDG')"/></td>
162                    <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a>
163                    ${g.disclaimer} </td>
164                    </tr>
165                    </tbody></table>
166                </td>
167                <td width="20%" align="center">
168                <table><tr><td class="helpText">
169                DDS News</td><td>
170                <a href="$g.server/getFeed/discovery"><img border="0" src="$g.feedIcon" alt="Atom feed for discovery service" title="Atom feed for discovery service"/></a>
171                </td></tr></table>
172               
173                </td>
174                <td width="20%" align="center">
175                    <a href="mailto:$c.helpEmail?subject=NERC Data Discovery Service enquiry">Report problems</a>
176                </td>
177                <td width="20%" align="center">
178                    <a href="$c.oaiPage">Data Providers Login</a>
179                </td>               
180                <td width="20%" align="center">
181                    <div py:if="not g.standalone" id="loginStatus">
182                        <!--! now we choose one of the next two (logged in or not) -->
183                        <div py:if="'ndgSec' in session"><table><tbody><tr><td>
184                        User [${session['ndgSec']['u']}] logged in at
185                        ${session['ndgSec']['org']} with roles
186                        [${len(session['ndgSec']['roles'])==1 and session['ndgSec']['roles'][0] or ', '.join(session['ndgSec']['roles'])}]</td><td>
187                        &nbsp;<span py:replace="logOut()"/></td></tr></tbody></table></div>
188                        <div py:if="'ndgSec' not in session">Further services may be available if you can
189                            <span py:replace="logIn()"/></div>
190                    </div>
191                </td>
192                <td align="right"><span py:replace="linkimage(g.stfcLink,g.stfcImage,'Hosted by the STFC CEDA')"/></td>
193            </tr>
194        </tbody></table></center>
195    </div>
196   
197    <!-- Utility Functions follow -->
198   
199    <!-- hyperlinked image -->
200    <span py:def="linkimage(linkref,imageref,alttext)">
201        <a href="$linkref"><image src="$imageref" alt="$alttext" title="$alttext"/></a>
202    </span>
203   
204    <!-- Help Icons -->
205    <span py:def="helpIcon(value)">
206        <span>
207            <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;">
208            <img src="$g.helpIcon" alt="Toggle help" class="helpicon"/></a>
209     
210        </span>
211    </span>
212   
213   
214    <!-- Login jogin and out buttons --> 
215    <span py:def="logOut()" class="logOut">
216            <?python
217            from base64 import urlsafe_b64encode
218           
219            # Base 64 encode to enable passing around in 'r' argument of query
220            # string for use with login/logout
221            g.ndg.security.common.sso.state.returnToURL = str(c.requestURL)
222            g.ndg.security.common.sso.state.b64encReturnToURL = urlsafe_b64encode(c.requestURL)
223            ?>
224        <form action="$g.logout">
225            <input type="hidden" name="r" value="${g.ndg.security.common.sso.state.b64encReturnToURL}"/>
226            <input type="submit" value="Logout"/>
227        </form>
228    </span>
229   
230    <span py:def="logIn()" class="logIn">
231            <?python
232            from base64 import urlsafe_b64encode
233           
234            # Base 64 encode to enable passing around in 'r' argument of query
235            # string for use with login/logout
236            g.ndg.security.common.sso.state.returnToURL = str(c.requestURL)
237            g.ndg.security.common.sso.state.b64encReturnToURL = urlsafe_b64encode(c.requestURL)
238            ?>
239        <form action="$g.wayfuri">
240            <input type="hidden" name="r" value="${g.ndg.security.common.sso.state.b64encReturnToURL}"/>
241            <input type="submit" value="Login"/>
242        </form>
243    </span>
244   
245   
246   
247</html>
Note: See TracBrowser for help on using the repository browser.