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

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

Adjusted content and formatting and additional links on main discovery and results pages

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