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 builtins import range 

3from . import * 

4 

5def formActions( 

6 primaryButton="", 

7 button2=False, 

8 button3=False, 

9 button4=False, 

10 button5=False, 

11 inlineHelpText=False, 

12 blockHelpText=False): 

13 """ 

14 *Generate a formActions - TBS style* 

15 

16 **Key Arguments** 

17 

18 - ``primaryButton`` -- the primary button 

19 - ``button2`` -- another button 

20 - ``button3`` -- another button 

21 - ``button4`` -- another button 

22 - ``button5`` -- another button 

23 - ``inlineHelpText`` -- inline and block level support for help text that appears around form controls 

24 - ``blockHelpText`` -- a longer block of help text that breaks onto a new line and may extend beyond one line 

25  

26 

27 **Return** 

28 

29 - ``formActions`` -- the formActions 

30  

31 """ 

32 falseList = [primaryButton, button2, button3, 

33 button4, button5, inlineHelpText] 

34 

35 for i in range(len(falseList)): 

36 if not falseList[i]: 

37 falseList[i] = "" 

38 

39 [primaryButton, button2, button3, button4, 

40 button5, inlineHelpText] = falseList 

41 

42 if inlineHelpText: 

43 inlineHelpText = """<span class="help-inline">%(inlineHelpText)s</span>""" % locals( 

44 ) 

45 else: 

46 inlineHelpText = "" 

47 

48 if blockHelpText: 

49 blockHelpText = """<span class="help-block">%(blockHelpText)s</span>""" % locals( 

50 ) 

51 else: 

52 blockHelpText = "" 

53 

54 formActions = """ 

55 <div class="form-actions"> 

56 %(primaryButton)s 

57 %(button2)s 

58 %(button3)s 

59 %(button4)s 

60 %(button5)s 

61 </div>%(inlineHelpText)s%(blockHelpText)s""" % locals() 

62 

63 return formActions