class HomeView(DashboardView): template_name = "main.html" crumbs = ( {'url': 'admin:index', 'name': _('Home')}, ) grid = Grid(Row(Column(User(), width=4), Column(Authentication(), width=4), Column(SettledEnterprise(), width=4), Column(Signatures(), width=4), Column(Evidences(), width=4)))
def test_main(self): """Main test method.""" box = Box(widgets=[Widget(template='_.html')]) grid = Grid(Row(Column(width=12))) view = DashboardView.as_view() assert box assert grid assert view
def test_main(self): """Main test method.""" box = Box(items=[Item()]) grid = Grid(Row(Column(width=12))) view = DashboardView() assert box assert grid assert view
class HomeView(DashboardView): template_name = 'suit_dashboard/template.html' crumbs = ({'url': 'admin:index', 'name': _('Home')},) grid = Grid( Row(Column()), # default width=12 (maximum) Row(Column(width=6), Column(width=1), Column(width=4)), Row(Column( # nested rows and columns Row(Column(width=10), Column(width=2)), Row(Column(width=4), Column(width=6)), width=5),Column(width=6) ) )
class HomeView(DashboardView): template_name = 'dashboard/main.html' crumbs = ( {'url': 'admin:index', 'name': _('Home')}, ) grid = Grid( Row( Column(BoxMachineBasicInfo(), width=6), Column(BoxMachineBasicInfoChart(), width=6), Column(BoxMinionStatusChart(), width=12) ) )
class DashboardStatisticsView(DashboardView): # template_name = 'dashboard/main.html' # model = User # These next two lines tell the view to index lookups by username # slug_field = 'username' # slug_url_kwarg = 'username' # grid = Grid(Row(Column(BoxMachine(), width=12))) grid = Grid( Row( Column( Box(html_id='allitems',title=1,description='All Items'), width=1), Column( Box(html_id='services',title=1,description='Services'), width=1), Column( Box(html_id='insurance',title='2',description='Insurance'), width=1), Column( Box(html_id='filing',title='3',description='Filings & Permits'), width=1), Column( Box(html_id='violation',title='1',description='Violations & Suits'), width=1), Column( Box(html_id='current',title='20',description='Current'), width=1), Column( Box(html_id='attention',title='0',description='Coming Due'), width=1), Column( Box(html_id='pastdue',title='0',description='Past Due'), width=1), ), Row( Column( Box(), width=12), ), Row( Column(Row( Column( Box(html_id='filtertitle', title='Showing :', description=''), width=1), Column( Box(html_id='showfilters', title='All Items'), width=1))), ), )
class LineView(DashboardView): template_name = 'data.html' crumbs = ( {'url': 'admin:data', 'name': _('数据')}, ) grid = Grid(Row(Column(BasicLine(), width=12)))
def test_grid_columns_type(self): """Test raising of errors when items type are wrong.""" with pytest.raises(TypeError) as e: Grid(1) assert 'All elements of Grid must be Row instances' in str(e.value)
class EvidView(DashboardView): template_name = 'data.html' crumbs = ({'url': 'admin:evid', 'name': _('用户取证次数')}, ) grid = Grid(Row(Column(EvidLine(), width=12)))
class SignView(DashboardView): template_name = 'data.html' crumbs = ({'url': 'admin:sign', 'name': _('用户签名次数')}, ) grid = Grid(Row(Column(SignLine(), width=12)))
class SetEnView(DashboardView): template_name = 'data.html' crumbs = ({'url': 'admin:seten', 'name': _('总入驻企业数量')}, ) grid = Grid(Row(Column(SetEnLine(), width=12)))
class AutionView(DashboardView): template_name = 'data.html' crumbs = ({'url': 'admin:aution', 'name': _('已认证用户量')}, ) grid = Grid(Row(Column(AutionLine(), width=12)))