Coverage for khufu/scaffolding/grid_row.py : 76%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# encoding: utf-8
2from . import *
4def grid_row(
5 responsive=True,
6 columns='',
7 htmlId=False,
8 htmlClass=False,
9 onPhone=True,
10 onTablet=True,
11 onDesktop=True,
12):
13 """ *Create a row using the Twitter Bootstrap static layout grid.
14 The static Bootstrap grid system utilizes 12 columns.*
16 **Key Arguments**
18 - ``responsive`` -- fluid layout if true, fixed if false
19 - ``columns`` -- coulmns to be included in this row
20 - ``htmlId`` -- the id of the row
21 - ``htmlClass`` -- the class of the row
22 - ``onPhone`` -- does this row get displayed on a phone sized screen
23 - ``onTablet`` -- does this row get displayed on a tablet sized screen
24 - ``onDesktop`` -- does this row get displayed on a desktop sized screen
27 **Return**
29 - ``row`` -- the row """
32 if responsive:
33 responsive = '-fluid'
34 else:
35 responsive = ''
36 if htmlId:
37 htmlId = """id="%(htmlId)s" """ % locals()
38 else:
39 htmlId = ''
40 if not htmlClass:
41 htmlClass = ''
42 if onPhone:
43 onPhone = ''
44 else:
45 onPhone = 'hidden-phone'
46 if onTablet:
47 onTablet = ''
48 else:
49 onTablet = 'hidden-tablet'
50 if onDesktop:
51 onDesktop = ''
52 else:
53 onDesktop = 'hidden-desktop'
54 row = """
55 <div class="row%(responsive)s %(htmlClass)s %(onPhone)s %(onTablet)s %(onDesktop)s" %(htmlId)s>
56 %(columns)s
57 </div>
58 """ % locals()
59 return row