Commits

Olemis Lang committed 14177a7

TracMac: Reusing `trac.metanav` option to select metanav items displayed in toolbar

Comments (0)

Files changed (3)

 
 Outstanding tasks are :
 
+- Search box overlaps logo & desc if width is small.
 - Implement meta items as config option.
 - Implement meta items admin panel.
 - Implement meta items preferences panel.

tracmacos/templates/mac_theme.html

             </ul>
           <hr />
         </span>
-        <span py:with="metaitems = ('login', 'openidlogin', 'logout', 'prefs', 'help', 'about')" 
+        <span py:with="metaitems = macos.metanav" 
               id="metanav" class="nav">
           <ul py:if="chrome.nav['metanav']">
             <li py:for="idx, item in  enumerate(chrome.nav['metanav'])" py:if="item.name in metaitems"

tracmacos/theme.py

 from trac.config import Option, IntOption, ListOption
 from trac.util.translation import _
 from trac.web.api import IRequestFilter, IRequestHandler, RequestDone
-from trac.web.chrome import add_script, add_stylesheet
+from trac.web.chrome import add_script, add_stylesheet, Chrome
 
 from genshi.builder import Markup, Element, Fragment, tag
 from genshi.input import XML
                   'dock_default' : self.dock_default,
                   'dock' : self.dock_images,
                   },
+              'metanav' : Chrome(self.env).metanav_order
             }
     
     def _prepare_chrome_for_fail(self, req):