Changeset 682

Show
Ignore:
Timestamp:
06/15/08 16:12:06 (2 months ago)
Author:
sylvain
Message:

Ensured profiles were mounted on startup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • oss/headstock/headstock/example/microblog/design/default/templates/header.mako

    r678 r682  
    99    <link rel="stylesheet" type="text/css" href="/css/reset-fonts-grids.css" /> 
    1010    <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" /> 
    11     <link rel="stylesheet" type="text/css" href="/css/themes/flora/flora.css" media="screen" /> 
    12     <link rel="stylesheet" type="text/css" href="/css/themes/flora/flora.tabs.css" media="screen" /> 
    13  
    14     <script type="application/javascript" src="/js/jquery-1.2.6.js"></script>         
    15     <script type="application/javascript" src="/js/ui/ui.core.js"></script>       
    16     <script type="application/javascript" src="/js/ui/ui.tabs.js"></script>       
    17     <script type="application/javascript" src="/js/microblog.js"></script>       
    18     <script type="application/javascript"> 
    19       $(document).ready(function() { 
    20         $('#container-1 > ul').tabs(); 
    21         $("#container-1 > ul").tabs("select", '${selectedview}'); 
    22  
    23       }); 
    2411    </script> 
    2512  </head> 
  • oss/headstock/headstock/example/microblog/launcher.py

    r678 r682  
    7979        d.add('/', GET=self.webapp.index) 
    8080 
    81         cherrypy.tree.mount(self.webapp, '/', {'/': { 'request.dispatch': d, 
    82                                                       'tools.etags.on': True, 
    83                                                       'tools.etags.autotags': True, 
    84                                                       'tools.sessions.on': True, 
    85                                                       'tools.sessions.storage_type': 'memcached',}, 
    86                                                '/signup': {'tools.openid.on': True,}, 
    87                                                '/profile/feed': {'tools.openid.on': False, 
    88                                                                  'tools.etags.on': True, 
    89                                                                  'tools.etags.autotags': True,}, 
    90                                                '/profile/new': {'tools.openid.on': False, 
    91                                                                 'tools.etags.on': True, 
    92                                                                 'tools.etags.autotags': False,}, 
    93                                                '/js': {'tools.openid.on': False, 
    94                                                        'tools.staticdir.on': True, 
    95                                                        'tools.staticdir.dir': os.path.join(base_dir, 'design',  
    96                                                                                             'default', 'js')}, 
    97                                                '/images': {'tools.openid.on': False, 
    98                                                            'tools.staticdir.on': True, 
    99                                                            'tools.staticdir.dir': os.path.join(base_dir, 'design',  
    100                                                                                                'default', 'images')}, 
    101                                                '/css': {'tools.openid.on': False, 
    102                                                         'tools.staticdir.on': True, 
    103                                                         'tools.staticdir.dir': os.path.join(base_dir, 'design',  
    104                                                                                             'default', 'css')}}) 
     81        for profile_name in self.profiles: 
     82            p = self.profiles[profile_name] 
     83            c = self.atompub.service.get_collection_by_xml_id('collection-%s' % profile_name) 
     84            self.webapp.attach_serving_collection_application(c, p, d) 
     85 
     86        conf = {'/': { 'request.dispatch': d, 
     87                       'tools.etags.on': True, 
     88                       'tools.etags.autotags': True, 
     89                       'tools.sessions.on': True, 
     90                       'tools.sessions.storage_type': 'memcached',}, 
     91                '/signup': {'tools.openid.on': True,}, 
     92                '/profile/feed': {'tools.openid.on': False, 
     93                                  'tools.etags.on': True, 
     94                                  'tools.etags.autotags': True,}, 
     95                '/profile/new': {'tools.openid.on': False, 
     96                                 'tools.etags.on': True, 
     97                                 'tools.etags.autotags': False,}, 
     98                '/js': {'tools.openid.on': False, 
     99                        'tools.staticdir.on': True, 
     100                        'tools.staticdir.dir': os.path.join(base_dir, 'design',  
     101                                                            'default', 'js')}, 
     102                '/images': {'tools.openid.on': False, 
     103                            'tools.staticdir.on': True, 
     104                            'tools.staticdir.dir': os.path.join(base_dir, 'design',  
     105                                                                'default', 'images')}, 
     106                '/css': {'tools.openid.on': False, 
     107                         'tools.staticdir.on': True, 
     108                         'tools.staticdir.dir': os.path.join(base_dir, 'design',  
     109                                                             'default', 'css')}} 
     110 
     111 
     112        cherrypy.tree.mount(self.webapp, '/', conf) 
    105113 
    106114    def setup_web(self):