from htmlUtilities import * def fancybox(content): ''' Provides a round cornered box ''' html='''

%s
'''%content return html def renderPage(contentHTML,historyHTML,selectHTML,name,config): ''' Renders the content of a browse page, using information from the entity and history rendering, and the config file. This routine has all the installation dependent layout ''' #Note layout images and stylesheets should be in the layout directory ... #following should come from a config file localLink=config.get('layout','localLink',None) localImage=config.get('layout','localImage',None) localAlt=config.get('layout','localAlt','Visit Local Site') ndgLink=config.get('layout','ndgLink','http://ndg.nerc.ac.uk') ndgImage=config.get('layout','ndgImage',None) ndgAlt=config.get('layout','ndgAlt','Visit NDG') PageLogo=config.get('layout','pageLogo',None) selImage=config.get('layout','selectI',None) #set up search box form ... searchBox='''
Discovery Search
''' #set up html header html=''' Browse: %s '''%name #now get the banner section #note we have to escape the % ... banner='''
%s

Browse Datasets

%s
'''%(ndgLink,ndgImage,ndgAlt,localLink,localImage,localAlt) html+='
%s
'%banner #html+=''+fancybox(banner) gotoA=image(selImage,'DataService') #left column content leftcol='''
%s

Browse History

%s

%s Selected Items

%s
'''%(searchBox,historyHTML,gotoA,selectHTML) #now layout the main parts of the page (importing relevant HTML) html+='''
%s
%s
'''%(fancybox(leftcol),fancybox(contentHTML)) return html