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)*
6:Author:
7 David Young
8"""
9import sys
10import os
11import khufu
14def block_title(
15 log,
16 title,
17 align="left"
18):
19 """block title
21 **Key Arguments**
23 - ``title`` -- the title for the block
24 - ``log`` -- the logger
25 - ``align`` -- False | left | right | center
28 **Return**
30 - ``title`` -- the title for the ticket block
32 """
33 log.debug('starting the ``block_title`` function')
35 thisTitle = khufu.p(
36 content=title,
37 textAlign=align, # [ left | center | right ]
38 color="muted", # [ muted | warning | info | error | success ]
39 )
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 )
51 title = thisTitle
53 log.debug('completed the ``block_title`` function')
54 return title
57def little_label(
58 text="",
59 pull=False,
60 lineBreak=True
61):
62 """little labels for the pessto marshall tickets
64 **Key Arguments**
66 - ``text`` -- the label text
67 - ``lineBreak`` -- add a line break
70 **Return**
72 - ``text`` -- little label
74 """
75 if lineBreak is not False:
76 lineBreak = "<br>   "
77 else:
78 lineBreak = ""
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 )
87 return text