예제 #1
0
 def __init__(self, view, address_book, address_book_ui):
     self.address_book = address_book
     super(AddressBookPanel, self).__init__(view)
     
     self.add_child(H(view, 1, text='Addresses in %s' % address_book.display_name))
     self.add_child(Nav(view).use_layout(TabLayout()).with_bookmarks(self.menu_bookmarks(address_book_ui)))
     self.add_children([AddressBox(view, address) for address in address_book.addresses])
예제 #2
0
 def __init__(self, view, main_bookmarks):
     super().__init__(view)
     self.use_layout(PageLayout(document_layout=Container()))
     contents_layout = ColumnLayout(ColumnOptions('main', ResponsiveSize(lg=6))).with_slots()
     self.layout.contents.use_layout(contents_layout)
     menu = Nav(view).use_layout(TabLayout()).with_bookmarks(main_bookmarks)
     self.layout.header.add_child(menu)
예제 #3
0
 def __init__(self, view, nav_layout=None):
     super(TabbedPanel, self).__init__(view)
     self.tabs = []
     self.nav = self.add_child(
         Nav(view).use_layout(nav_layout or TabLayout()))
     self.content_panel = self.add_child(Div(view))
     self.content_panel.append_class('tab-content')
예제 #4
0
 def __init__(self, view, main_bookmarks):
     super(MenuPage, self).__init__(view)
     self.use_layout(PageLayout(document_layout=Container()))
     contents_layout = ColumnLayout(
         ('main', ResponsiveSize(md=4))).with_slots()
     self.layout.contents.use_layout(contents_layout)
     self.layout.header.add_child(
         Nav(view).use_layout(TabLayout()).with_bookmarks(main_bookmarks))
예제 #5
0
    def __init__(self, view, bookmarks):
        super(MyCustomPage, self).__init__(view)

        self.use_layout(PageLayout(document_layout=Container()))
        contents_layout = ColumnLayout(ColumnOptions('secondary', size=ResponsiveSize(md=3)),
                                       ColumnOptions('main', size=ResponsiveSize(md=9))).with_slots()
        self.layout.contents.use_layout(contents_layout)

        menu = Nav(view).use_layout(TabLayout()).with_bookmarks(bookmarks)
        self.layout.header.add_child(menu)
예제 #6
0
    def __init__(self, view):
        super(HomePanel, self).__init__(view)

        panel = RefreshedPanel(view, 'my_refreshedpanel')
        bookmarks = [panel.get_bookmark(1),
                     panel.get_bookmark(2),
                     panel.get_bookmark(3)]

        self.add_child(H(view, 1, text='Refreshing widget'))
        self.add_child(Nav(view).use_layout(TabLayout()).with_bookmarks(bookmarks))
        self.add_child(panel)
예제 #7
0
    def __init__(self, view, home_bookmark):
        super(AddressAppPage, self).__init__(view)
        self.use_layout(PageLayout(document_layout=Container()))
        contents_layout = ColumnLayout(('main', ResponsiveSize(lg=6))).with_slots()
        self.layout.contents.use_layout(contents_layout)

        login_session = LoginSession.for_current_session()
        if login_session.is_logged_in():
            logged_in_as = login_session.account.email
        else:
            logged_in_as = 'Not logged in'

        self.layout.header.add_child(P(view, text=logged_in_as))
        self.layout.header.add_child(Nav(view).use_layout(TabLayout()).with_bookmarks([home_bookmark]))
예제 #8
0
 def tab_layouts(self):
     """TabLayouts are used to make Navs MenuItems look like a series of tabs."""
     self.layout_css_class = {'nav-tabs'}
     self.layout = TabLayout()
예제 #9
0
 def __init__(self, view, main_bookmarks):
     super(AddressBookPage, self).__init__(view)
     self.body.use_layout(Container())
     self.body.add_child(
         Nav(view).use_layout(TabLayout()).with_bookmarks(main_bookmarks))