Ticket #897 (closed defect: fixed)

Opened 12 years ago

Last modified 11 years ago

[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.

Change History

comment:1 Changed 12 years ago by mggr

  • Cc rmd@… added

templates/correct.kid (for sending corrections via email):

-    <form action='/correct/$c.uri.uri'>
+    <form action='$g.server/correct/$c.uri.uri'>

comment:2 Changed 12 years ago by lawrence

  • Priority changed from desirable to critical

comment:3 Changed 12 years ago by lawrence

  • Status changed from new to closed
  • Resolution set to fixed

Done, note favicon location in layout directory ... (allowing us to have one in the egg, which you can override from outside). (Not that we've put one in there yet).

comment:4 Changed 11 years ago by lawrence

  • Keywords Delivery added
  • Component changed from T05_Delivery to ndg2

moved to component ndg2 (obsolete) as part of ndg2 cleanup

Note: See TracTickets for help on using tickets.