Ticket #897 (closed defect: fixed)
[WG] Hard coded path fixes
Reported by: | mggr | Owned by: | lawrence |
---|---|---|---|
Priority: | critical | Milestone: | PROD Final |
Component: | ndg2 | Version: | |
Keywords: | Delivery | Cc: | rmd@… |
Description
There are a couple of hardcoded paths still in a few of the templates (ignoring .css files). These are mostly to do with Javascript and CSS locations and affects PML and BODC installs (since we foolishly don't have them at the top level of the document root).
Here's a quote from a patch I use to fix them up:
diff -ru ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/ndgPage.kid ows_server-0.0.0dev_r2832-py2.4.egg/ows_server/templates/ndgPage.kid --- ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/ndgPage.kid 2007-10-11 16:55:56.000000000 +0100 +++ ows_server-0.0.0dev_r2832-py2.4.egg/ows_server/templates/ndgPage.kid 2007-10-04 10:37:20.000000000 +0100 @@ -8,9 +8,10 @@ <!--! The following includes the javascript, note that the XML function is needed to avoid escaping the < character --> ${XML(h.javascript_include_tag(builtins=True))} - <script type="text/javascript" src="/js/toggleDiv.js"/> + <script type="text/javascript" src="/projects/ndg/js/toggleDiv.js"/> - <link media="all, screen" href="/layout/ndg2.css" type="text/css" rel="stylesheet"/> + <link media="all, screen" href="/projects/ndg/layout/ndg2.css" type="text/css" rel="stylesheet"/> + <link rel="icon" type="image/ico" href="/projects/ndg/favicon.jpg" /> </head> diff -Naur ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/advanced.kid ows_server-0.0.0dev_r2832-py2.4.egg/ows_server/templates/advanced.kid --- ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/advanced.kid 2007-10-11 16:55:56.000000000 +0100 +++ ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/advanced.kid 2007-10-11 18:32:29.000000000 +0100 @@ -3,9 +3,9 @@ <head> <replace py:replace="pagehead()"/> - <script src="/js/OpenLayers.js"/> - <script src="/js/openlayers-x.js"/> - <script src="/js/OLMapBox.js"/> + <script src="/projects/ndg/js/OpenLayers.js"/> + <script src="/projects/ndg/js/openlayers-x.js"/> + <script src="/projects/ndg/js/OLMapBox.js"/> <script type="text/javascript"> var app = null; function initOLMapBox() { @@ -114,4 +114,4 @@ <div py:replace="footer()"/> </div> </body> -</html> \ No newline at end of file +</html> diff -Naur ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/visualise.kid ows_server-0.0.0dev_r2832-py2.4.egg/ows_server/templates/visualise.kid --- ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/visualise.kid 2007-10-11 16:55:56.000000000 +0100 +++ ows_server-0.0.0dev_r2938-py2.4.egg/ows_server/templates/visualise.kid 2007-10-11 18:32:21.000000000 +0100 @@ -189,12 +189,12 @@ <replace py:replace="pagehead()" /> <link type="text/css" rel="stylesheet" href="/layout/tabber.css"/> - <script src="/js/OpenLayers.js"/> - <script src="/js/openlayers-x.js"/> - <script src="/js/VisMapBox.js"/> + <script src="/projects/ndg/js/OpenLayers.js"/> + <script src="/projects/ndg/js/openlayers-x.js"/> + <script src="/projects/ndg/js/VisMapBox.js"/> <!--! granuleMetadata sets tabberOptions so include it first --> <replace py:replace="granuleMetadata(c.selections)"/> - <script src="/js/tabber.js"/> + <script src="/projects/ndg/js/tabber.js"/> </head>
I think in most cases, the "/projects/ndg/" part could be replaced with $g.server (not tested - didn't know what I was doing at the time ;) ).
The only other thing we add is a favicon line in ndgPage.kid, e.g.: <link rel="icon" type="image/ico" href="/projects/ndg/favicon.jpg" /> (included in diff above). This might be a nice extra.
templates/correct.kid (for sending corrections via email):