Exemplo n.º 1
0
 def __init__(self, subhead='subhead', **args):
     Table.__init__(self, width='100%', _class='mainfooter', **args)
     self.anchors = []
 
     home = Anchor('Home', href='/')
     up = Anchor('Up', href='index')
     rel = Anchor('Reload', href='javascript:document.location.reload()')
     row = TableRow()
     row.extend(map(TableCell, [home, rel, up]))
     self._subhead = TableCell(subhead, colspan=3)
     head = TableRow(self._subhead)
     self.extend([head, row])
Exemplo n.º 2
0
class MainFooterNew(Table):
    def __init__(self, subhead='subhead', **args):
        Table.__init__(self, width='100%', _class='mainfooter', **args)
        self.a_home = Anchor('Home', href='/')
        self.a_up = Anchor('Up', href='index')
        self.a_reload = Anchor('Reload', href='javascript:document.location.reload()')
        self.mainrow = TableRow()
        self.cell_subhead = TableCell(subhead)
        self.headrow = TableRow(self.cell_subhead)
        self.extend([self.headrow, self.mainrow])
        self.reset_nav_anchors()
        
    def reset_nav_anchors(self):
        anchors = [self.a_home, self.a_reload, self.a_up]
        self.mainrow.clear()
        self.mainrow.extend(anchors)
        
    def set_subhead(self, subhead):
        self.cell_subhead.set(subhead)