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#!/usr/local/bin/python 

2# encoding: utf-8 

3""" 

4*Common Utilities for the PESSTO Webapp(s)* 

5 

6:Author: 

7 David Young 

8""" 

9import sys 

10import os 

11import khufu 

12 

13 

14def block_title( 

15 log, 

16 title, 

17 align="left" 

18): 

19 """block title 

20 

21 **Key Arguments** 

22 

23 - ``title`` -- the title for the block 

24 - ``log`` -- the logger 

25 - ``align`` -- False | left | right | center 

26 

27 

28 **Return** 

29 

30 - ``title`` -- the title for the ticket block 

31 

32 """ 

33 log.debug('starting the ``block_title`` function') 

34 

35 thisTitle = khufu.p( 

36 content=title, 

37 textAlign=align, # [ left | center | right ] 

38 color="muted", # [ muted | warning | info | error | success ] 

39 ) 

40 

41 thisTitle = khufu.grid_row( 

42 responsive=True, 

43 columns=thisTitle, 

44 htmlId=False, 

45 htmlClass="ticketBlockTitle", 

46 onPhone=True, 

47 onTablet=True, 

48 onDesktop=True 

49 ) 

50 

51 title = thisTitle 

52 

53 log.debug('completed the ``block_title`` function') 

54 return title 

55 

56 

57def little_label( 

58 text="", 

59 pull=False, 

60 lineBreak=True 

61): 

62 """little labels for the pessto marshall tickets 

63 

64 **Key Arguments** 

65 

66 - ``text`` -- the label text 

67 - ``lineBreak`` -- add a line break 

68 

69 

70 **Return** 

71 

72 - ``text`` -- little label  

73 

74 """ 

75 if lineBreak is not False: 

76 lineBreak = "<br>&nbsp&nbsp&nbsp" 

77 else: 

78 lineBreak = "" 

79 

80 text = khufu.coloredText( 

81 text="%(text)s %(lineBreak)s" % locals(), 

82 color="grey", # [ muted | warning | info | error | success ] 

83 htmlClass="littlelabel", 

84 pull=pull 

85 ) 

86 

87 return text