Commits

Olemis Lang committed 988f182

TracMac: Data inserted before processing request. Correct error handling.

Comments (0)

Files changed (3)

tracmacos/htdocs/mac.css

 #content.search #results .author, 
 #results .date {
   color: #006633;
+}
 

tracmacos/templates/mac_theme.html

     </li>
   </ul>
 
-  <py:match path="body" once="true" buffer="false"><body>
+  <py:match path="body" once="true" buffer="false"><body py:with="macos=getattr(req, 'macos') or macos">
     <div id="fixed-wrapper">
       <div id="mainpanel" class="nav">
         <span> 

tracmacos/theme.py

                                     "between each animation step of the "
                                     "'on-Dock' expansion, and the "
                                     "'off-Dock' shrinkage.")
-    tb_count = IntOption('macos', 'tbcount', default=6,
+    tb_count = IntOption('macos', 'tbcount', default=5,
                                 doc="Number of fixed items in toolbar ")
     
     template = htdocs = css = screenshot = True
     
     # IRequestFilter methods
     def pre_process_request(self, req, handler):
-        add_script(req, '/chrome/theme/jquery.jqDock.min.js')
-        return handler
-    
-    def post_process_request(self, req, template, data, content_type):
         def to_text(fragment):
           if isinstance(fragment, (Element, Fragment, Markup)):
             return striptags(unicode(fragment))
           for x in stream.select('a[@href]') :
             if x[0] == 'START' :
                return x[1][1].get('href')
-            
-        data['macos'] = {
+        
+        add_script(req, '/chrome/theme/jquery.jqDock.min.js')
+        req.macos = {
               'opts' : {
                   'coefficient' : self.dock_coefficient,
                   'distance' : self.dock_distance,
                   'dock' : self.dock_images,
                   },
             }
+        return handler
+    
+    def post_process_request(self, req, template, data, content_type):
         return template, data, content_type
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.