Changeset 1543 for TI07-MOLES


Ignore:
Timestamp:
01/10/06 21:50:06 (13 years ago)
Author:
lawrence
Message:

Small refactoring of new discovery interface

Location:
TI07-MOLES/trunk/PythonCode/newDiscovery
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/newDiscovery/template.py

    r1536 r1543  
    2121# requires mainLogo, helpAddress and advSearchAddress to be declared in parent 
    2222main=''' 
     23<div class="simpleSearch"> 
     24<form actin="%(discoveryURL)s"> 
    2325<h4> Text Search </h4> 
    2426<table> 
     
    3335<tr><td><a href="%(helpAddress)s">Help</a><td><input type="submit" value="Run Search"/> 
    3436    <td><a href="%(advancedURL)s">Advanced Search</a></td></tr> 
    35 </table>''' 
     37<input type="hidden" value="0" name="advanced"> 
     38</table></form></div>''' 
    3639 
    3740# requires mainLogo, helpAddress, and discoveryURL to be declared in parent 
    3841advanced=''' 
    39 <div class="Advanced"> 
    40     <div class="textSearch"> 
     42<div class="AdvancedSearch"> 
     43    <form action="%(advancedURL)s"> 
     44    <div class="searchMethod"> 
    4145    <h4> Text Search </h4> 
    4246                Search in: <input type="radio" name="textTarget" value="All" checked> Everything 
     
    4549                <br/> 
    4650            <input type="text" size=60 name="searchString"><br/> 
     51            <input type="hidden" value="1" name="advanced"> 
    4752    </div> 
    48     <div class="Time"> 
     53    <div class="searchMethod"> 
    4954        <h4> Refine by Time </h4> 
    5055        <input type="radio" name="timeLimit" value="0" checked> Do not limit by date 
     
    8994        </table> 
    9095    </div> 
    91     <div class="space"> 
     96    <div class="searchMethod"> 
    9297        <h4> Refine by Area </h4> 
    9398        <input type="radio" name="spaceLimit" value="None" checked> Do not limit by area 
     
    106111        </table> 
    107112    </div> 
    108     <div class="source"> 
     113    <div class="searchMethod"> 
    109114        <h4> Refine by Source Data Centre </h4> 
    110115        <input type="radio" name="sourceLimit" value="0" checked> Do not limit by source 
     
    113118    <a href="%(helpAddress)s">Help</a>,  
    114119                <a href="%(discoveryURL)s"> Simple Search </a> 
     120    </form> 
    115121</div>''' 
    116122     
  • TI07-MOLES/trunk/PythonCode/newDiscovery/testtemplate.py

    r1536 r1543  
    11import template 
     2from Utilities import myConfig 
     3from ndgSearch import ndgSearch 
    24 
    35def output(f,s): 
     
    68    ff.close() 
    79 
     10config=myConfig('config.test') 
     11print config.get('SEARCH','discoveryURL') 
    812 
    9 helpAddress="http://localhost:8000/discoveryHelp" 
    10 mainLogo="/layouts/logo" 
    11 discoveryURL="http://localhost:8000/cgi/advSearch" 
    12 advancedURL="http://localhost:8000/cgi/Search" 
     13inputs={} 
     14x=ndgSearch(inputs,config) 
     15print x.message 
     16output("main.html",x.html) 
    1317 
    14 main=template.main% locals() 
    15 advanced=template.advanced % locals() 
    16  
    17 # requires discoveryURL declared in parent, main defined here 
    18 mainForm=''' 
    19 <method="get" action="%s">%s</form> 
    20 '''%(discoveryURL,main) 
    21  
    22 advancedForm=''' 
    23 <method="get" action="%s">%s</form>'''%(advancedURL,advanced) 
    24  
    25 output("main.html",main) 
    26 output("advanced.html",advanced) 
     18inputs={'advanced':'1'} 
     19x=ndgSearch(inputs,config) 
     20print x.message 
     21output("advanced.html",x.html) 
    2722 
    2823 
Note: See TracChangeset for help on using the changeset viewer.