~divmod-dev/divmod.org/dangling-1091

« back to all changes in this revision

Viewing changes to Mantissa/xmantissa/plugins/plaintheme.py

  • Committer: glyph
  • Date: 2005-07-28 22:09:16 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:2
move this repository to a more official-looking URL

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
from zope.interface import classProvides
 
3
 
 
4
from xmantissa.ixmantissa import IWebTheme
 
5
from twisted.plugin import IPlugin
 
6
 
 
7
from nevow.loaders import stan
 
8
from nevow import tags as t
 
9
 
 
10
class PlainTheme(object):
 
11
    classProvides(IWebTheme, IPlugin)
 
12
 
 
13
    themeName = 'plain'
 
14
    priority = 1                # should be 0 on pretty much any other theme
 
15
 
 
16
    cssFiles = []
 
17
 
 
18
    shellTemplate = stan(
 
19
        t.html[
 
20
            t.head[
 
21
                ],
 
22
            t.body[
 
23
                t.table[
 
24
                    t.tr[
 
25
                        t.td[
 
26
                            t.div(render=t.directive("navigation")),
 
27
                            ],
 
28
                        t.td[
 
29
                            t.div(render=t.directive("content"))]]]]])
 
30
 
 
31
    navBoxTemplate = stan(
 
32
        t.ul(render='sequence', data='navigation')[
 
33
            t.li(pattern='item')[
 
34
                t.a(href=t.slot('link'))[
 
35
                    t.slot(name='name')],
 
36
                t.invisible(render='subtabs')
 
37
                ]
 
38
            ])
 
39
 
 
40
    def getDocFactory(self, fragmentName):
 
41
        if fragmentName == 'shell':
 
42
            return self.shellTemplate
 
43
        elif fragmentName == 'navigation':
 
44
            return self.navBoxTemplate