source: TI07-MOLES/trunk/PythonCode/newDiscovery/template.py @ 1536

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI07-MOLES/trunk/PythonCode/newDiscovery/template.py@1536
Revision 1536, 5.2 KB checked in by lawrence, 15 years ago (diff)

Initial (html) templates for the new discovery interface

Line 
1######################################################################################################
2# This python template is for providing the search interface to the NDG.
3# It's been laid out to have the minimum of python in it to aid in porting to other languages
4#
5# They key python construct is that we have some local variables which are available in the module
6# imports this one ... for example, in the calling module we have
7#      helpAddress="http://somehost.somewhere"
8# and here we have
9#      somestring='stuff <a href="%(helpAddress)s"> more stuff'
10# In the calling module we do newstring=template.somestring % locals()
11# which results in newstring being: 'stuff <a href="http://somehost.somewhere"> more stuff'
12#
13# Note that this has been deliberately laid out to be used inside some other page driving format
14# including headers, footers etc, and css ...
15#
16# V0.0, Bryan Lawrence, September 28, 2006.
17#
18#########################################################################################################
19
20
21# requires mainLogo, helpAddress and advSearchAddress to be declared in parent
22main='''
23<h4> Text Search </h4>
24<table>
25<tr>
26<td colspan="3">
27Search in: <input type="radio" name="textTarget" value="All" checked> Everything
28                <input type="radio" name="textTarget" value="Authors"> Authors
29                <input type="radio" name="textTarget" value="Params"> Parameters
30                </td></tr>
31<tr><td colspan="3"><input type="text" size=60 name="searchString"/></td></tr>
32<tr></tr>
33<tr><td><a href="%(helpAddress)s">Help</a><td><input type="submit" value="Run Search"/>
34    <td><a href="%(advancedURL)s">Advanced Search</a></td></tr>
35</table>'''
36
37# requires mainLogo, helpAddress, and discoveryURL to be declared in parent
38advanced='''
39<div class="Advanced">
40    <div class="textSearch">
41    <h4> Text Search </h4>
42                Search in: <input type="radio" name="textTarget" value="All" checked> Everything
43                <input type="radio" name="textTarget" value="Authors"> Authors
44                <input type="radio" name="textTarget" value="Params"> Parameters
45                <br/>
46            <input type="text" size=60 name="searchString"><br/>
47    </div>
48    <div class="Time">
49        <h4> Refine by Time </h4>
50        <input type="radio" name="timeLimit" value="0" checked> Do not limit by date
51        <input type="radio" name="timeLimit" value="1"> Limit by following date range
52        <table>
53        <tr>    <td>Start date: </td>
54                <td><input type=text value="1" size="2" name="startDateDay"/></td>
55                <td><select name="startDateMon">
56                    <option value="1"> Jan
57                    <option value="2"> Feb
58                    <option value="3"> Mar
59                    <option value="4"> Apr
60                    <option value="5"> May
61                    <option value="6"> Jun
62                    <option value="7"> Jul
63                    <option value="8"> Aug
64                    <option value="9"> Sep
65                    <option value="10"> Oct
66                    <option value="11"> Nov
67                    <option value="12"> Dec
68                    </select></td>
69                 <td><input type=text value="2000" name="startDateYear" size="4"/>
70        </tr>     
71        <tr>    <td>End date: </td>
72                <td><input type=text value="31" size="2" name="endDateDay"/></td>
73                <td><select name="endDateMon">
74                    <option value="1"> Jan
75                    <option value="2"> Feb
76                    <option value="3"> Mar
77                    <option value="4"> Apr
78                    <option value="5"> May
79                    <option value="6"> Jun
80                    <option value="7"> Jul
81                    <option value="8"> Aug
82                    <option value="9"> Sep
83                    <option value="10"> Oct
84                    <option value="11"> Nov
85                    <option value="12" selected> Dec
86                    </select></td>
87                 <td><input type=text value="2001" name="endDateYear" size="4"/>
88        </tr>
89        </table>
90    </div>
91    <div class="space">
92        <h4> Refine by Area </h4>
93        <input type="radio" name="spaceLimit" value="None" checked> Do not limit by area
94        <input type="radio" name="spaceLimit" value="BBOX"> Limit by Bounding Box
95        <table>
96        <tr><td>Northerly Latitude:</td>
97            <td colspan="2" align="center">
98            <input size="7" value="+90.00" name="bboxN"/></td></tr>
99        <tr><td>Longitudinal Extent:</td>
100            <td><input size="8" value="-180.00" name="bboxW"/></td>
101            <td><input size="8" value="+180.00" name="bboxE"/></td> </tr>
102        <tr><td> Southerly Latitude:</td>
103            <td colspan="2" align="center">
104            <input size="7"value="-90.00" name="bboxS"></td></tr>
105        <tr><td colspan="3"> (Units: degrees, north and east positive)</td></tr>
106        </table>
107    </div>
108    <div class="source">
109        <h4> Refine by Source Data Centre </h4>
110        <input type="radio" name="sourceLimit" value="0" checked> Do not limit by source
111    </div>
112    <input type="submit" value="Run Search"/>
113    <a href="%(helpAddress)s">Help</a>,
114                <a href="%(discoveryURL)s"> Simple Search </a>
115</div>'''
116   
Note: See TracBrowser for help on using the repository browser.