Coverage for khufu/forms/horizontalFormControlGroup.py : 92%

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 builtins import range
3from . import *
5def horizontalFormControlGroup(
6 content="",
7 validationLevel=False,
8 hidden=False):
9 """
10 *Generate a horizontal form control group (row) - TBS style*
12 **Key Arguments**
14 - ``content`` -- the content
15 - ``validationLevel`` -- validation level [ warning | error | info | success ]
16 - ``hidden`` -- hide the CG from the user?
19 **Return**
21 - ``horizontalFormControlGroup`` -- the horizontal form control group
23 """
24 falseList = [validationLevel, ]
26 for i in range(len(falseList)):
27 if not falseList[i]:
28 falseList[i] = ""
30 [validationLevel, ] = falseList
32 if hidden:
33 hidden = """hidden"""
34 else:
35 hidden = ""
37 horizontalFormControlGroup = """
38 <div class="control-group %(validationLevel)s %(hidden)s">
39 %(content)s
40 </div>""" % locals()
42 return horizontalFormControlGroup