Hide keyboard shortcuts

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 * 

3 

4 

5def tr( 

6 cellContent="", 

7 color=False, 

8 href=False, 

9 popover=False, 

10 span=False): 

11 """ 

12 *Generate a table row - TBS style* 

13 

14 **Key Arguments** 

15 

16 - ``cellContent`` -- the content - either `<td>`s or `<th>`s 

17 - ``color`` -- [ sucess | error | warning | info ] 

18 - ``href`` -- add a link for the whole table row 

19 

20 

21 **Return** 

22 

23 - ``tr`` -- the table row 

24 

25 """ 

26 

27 if isinstance(cellContent, list): 

28 new = "" 

29 for c in cellContent: 

30 new += c 

31 cellContent = new 

32 

33 if color is False: 

34 color = "" 

35 

36 if href is False: 

37 href = "" 

38 link = "" 

39 else: 

40 href = """href="%(href)s" """ % locals() 

41 link = "link" 

42 

43 if popover is False: 

44 popover = "" 

45 

46 if span is False: 

47 span = "" 

48 else: 

49 span = "span%(span)s" % locals() 

50 

51 tr = """<tr %(href)s class="%(link)s %(color)s %(span)s" %(popover)s>%(cellContent)s</tr>""" % locals() 

52 

53 return tr