Ignore:
Timestamp:
9 Aug 2010, 09:34:28 (14 years ago)
Author:
Henrik Bettermann
Message:

Implement skin switch.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/app.py

    r5345 r5407  
    3232        setup = setup_authentication,)
    3333
    34     #: The name of the university.
     34    # The name of the university.
    3535    name=u'Sample University'
     36   
     37    # The default layout.
     38    skin=u'waeuptheme-gray1.css'
    3639   
    3740    @property
     
    5558       
    5659   
    57     def __init__(self, name=u'Sample University', **kw):
     60    def __init__(self, name=name, skin=skin, **kw):
    5861        super(University, self).__init__(**kw)
    5962        self.name = name
     63        self.skin = skin
    6064        self.setup()
    6165
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py

    r5387 r5407  
    103103    def getAppTitle(self):
    104104        return getattr(grok.getSite(), 'name', u'Sample University')
     105       
     106    def getSkin(self):
     107        return getattr(grok.getSite(), 'skin', u'waeuptheme-gray1.css')       
    105108   
    106109    def isAuthenticated(self):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/sitelayout.pt

    r5400 r5407  
    2121          tal:attributes="href static/waeup-base.css" />
    2222    <link rel="stylesheet" type="text/css" href=""
    23           tal:attributes="href static/waeuptheme-red1.css" />
     23          tal:attributes="href string:${static}/${layout/getSkin}" />
    2424
    2525    <link rel="alternate" type="application/rss+xml"
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r5069 r5407  
    3636        title = u'Name of University',
    3737        default = u'Unnamed',
     38        required = True,
     39        )
     40   
     41    skin = schema.Choice(
     42        title = u'Skin',
     43        default = u'waeuptheme-gray1.css',
     44        #values = ['waeuptheme-gray1.css', 'waeuptheme-red1.css'],
     45        vocabulary = SimpleWAeUPVocabulary(
     46            ('Henrik\'s Gray Theme', 'waeuptheme-gray1.css'), ('Uli\'s Red Theme', 'waeuptheme-red1.css')),
    3847        required = True,
    3948        )
Note: See TracChangeset for help on using the changeset viewer.