def collections(): c = collections([ badge(new=False, href='#!', num=1, name='Alan'), badge(new=True, href='#!', num=4, name='Alan'), badge(href='#!', name='Alan'), badge(new=False, href='#!', num=14, name='Alan') ]) return Page(Seq('<br>' * 3, c)).gen()
def collapsibles(): main = container() collap = collapsible([(icon('filter_drama'), badge(href='#!', name="First"), "<p>Lorem ipsum dolor sit amet.</p>"), (icon('place'), badge(href='#!', name="Second"), "place")]) main.contains(collap) return Page(main).gen()
def dropdown(): main = container() c = globals()['dropdown']([ badge(new=False, href='#!', num=1, name='Alan'), badge(new=True, href='#!', num=4, name='Alan'), badge(href='#!', name='Alan'), badge(new=False, href='#!', num=14, name='Alan') ], name='a dropdown list', id='someid') main.contains(c) return Page(Seq('<br>' * 3, main)).gen()
def raised(): raised = globals()['raised'] more = raised(icon=icon('cloud'), name=" More", href='https://www.zhihu.com') a_row = row(more) right_align(a_row) more.cons_class(color('green').gen()) collection=\ collections([badge(new=True, href='#!', num=1, name='今日新闻'), badge(new=True, href='#!', num=4, name='鬼畜专区'), badge(href='#!', name='哲学论坛'), badge(new=False, href='#!', num=14, name='血条众筹'), ]) main = container() main.contains(Seq(collection, a_row)) return Page(main).gen()
def myPage(name): main = container() welcome = blockquote(f"Welcome to Incantation, {name}!") title = blockquote("Incantation使用者的评价反馈") users = table(["姓名", "评价", "日期"], [["Misakawa", "我自己做的,还能不给自己好评吗?完美的抽象!10/10分!", "2017-10-28"], ["Thautwarm", "上面那个是我小号...", "2017-10-28"], ["Ruikowa", "十分 and 我是被小号的。", "2017-10-29"]]) side = collections([ badge(new=True, href='#!', num=1, name='关注'), badge(new=True, href='#!', num=4, name='评论'), badge(href='#!', name='私信'), badge(new=False, href='#!', num=6, name='你的组织'), badge(href='#!', name='用户设置'), badge(href='#!', name='帮助反馈'), ]) main.contains( Seq( welcome, divider(), "<br>", row( Seq( col(side, grid(l=3, s=3, m=3)), col(Seq(title, users), grid(l=8, s=8, m=8)), )))) page = Page(main) return page.gen()
def test(): main = container() content1 = \ collections([badge(href='#!', num=1, name='今日新闻'), badge(href='#!', num=4, name='鬼畜专区'), badge(href='#!', name='哲学论坛'), badge(href='#!', num=14, name='血条众筹'), ]) content2 = \ collapsible([(icon('filter_drama'),badge(href = '#!', name = "First") , "<p>Lorem ipsum dolor sit amet.</p>"), (icon('place'), badge(href = '#!', name = "Second"), "place") ]) side = col(sidenav([content2, content1]), grid(l=2).loffset(6)) main.contains(side) return Page(main).gen()
from incantation.Module.Component.Navbar import navbar # create a container main = container() # create a navbar nav = navbar([ dict(href='https://baidu.com', name='link1'), dict(href='https://google.com', name='link2') ], href='https://github.com/thautwarm', name='Logo') # create collections collect = collections([ badge(new=False, href='#!', num=1, name='Alan'), badge(new=True, href='#!', num=4, name='Alan'), badge(href='#!', name='Alan'), badge(new=False, href='#!', num=14, name='Alan') ], ) # create a dropdown dd = dropdown([ badge(new=False, href='#!', num=1, name='Alan'), badge(new=True, href='#!', num=4, name='Alan'), badge(href='#!', name='Alan'), badge(new=False, href='#!', num=14, name='Alan') ], name='a dropdown list', id='someid')