Edgewall Software

Ticket #9462: shared_htdocs.patch

File shared_htdocs.patch, 1.6 KB (added by itamaro, 2 years ago)

Add shared htdocs_dir directory and return it from Chrome.get_htdocs_dirs()

  • trac/trac/web/chrome.py

     
    208208        """ 
    209209 
    210210    def get_navigation_items(req): 
    211         """Should return an iterable object over the list of navigation items to 
    212         add, each being a tuple in the form (category, name, text). 
     211        """Should return an iterable object over the list of navigation items 
     212        to add, each being a tuple in the form (category, name, text). 
    213213        """ 
    214214 
    215215 
    216216class ITemplateProvider(Interface): 
    217217    """Extension point interface for components that provide their own 
    218     ClearSilver templates and accompanying static resources. 
     218    Genshi templates and accompanying static resources. 
    219219    """ 
    220220 
    221221    def get_htdocs_dirs(): 
     
    264264         
    265265        (''since 0.11'')""") 
    266266 
     267    shared_htdocs_dir = PathOption('inherit', 'htdocs_dir', '', 
     268        """Path to the //shared htdocs directory//. 
     269         
     270        Static resources in that directory are mapped to /chrome/shared 
     271        under the environment URL, in addition to common and site locations. 
     272         
     273        (''since 0.12.1'')""") 
     274 
    267275    auto_reload = BoolOption('trac', 'auto_reload', False, 
    268276        """Automatically reload template files after modification.""") 
    269277     
     
    451459 
    452460    def get_htdocs_dirs(self): 
    453461        return [('common', pkg_resources.resource_filename('trac', 'htdocs')), 
     462                ('shared', self.shared_htdocs_dir), 
    454463                ('site', self.env.get_htdocs_dir())] 
    455464 
    456465    def get_templates_dirs(self):