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

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

#!/usr/bin/python 

# -*- coding: utf-8 -*- 

 

""" _dryxTBS_addons 

=============================== 

:Summary: 

    addon partial for the dryxTwitterBootstrap module 

 

:Author: 

    David Young 

 

:Date Created: 

    20130508 

 

:dryx syntax: 

    - ``xxx`` = come back here and do some more work 

    - ``_someObject`` = a 'private' object that should only be changed for debugging 

 

:Notes: 

    - If you have any questions requiring this code please email me: d.r.young@qub.ac.uk """ 

 

# from . import * 

 

################################################################### 

# CLASSES                                                         # 

################################################################### 

################################################################### 

# PUBLIC FUNCTIONS                                                # 

################################################################### 

## LAST MODIFIED : 20130508 

## CREATED : 20130508 

## AUTHOR : DRYX 

def mediaObject( 

    displayType='div', 

    img='', 

    headlineText='', 

    nestedMediaObjects=False, 

    ): 

    """ Generate an abstract object style for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content. 

 

    **Key Arguments:** 

        - ``displayType`` -- the display style of the media object [ "div" | "li" ] 

        - ``img`` -- the image to include 

        - ``headlineText`` -- the headline text for the object 

        - ``nestedMediaObjects`` -- nested media objects to be appended 

 

    **Return:** 

        - ``media`` -- the media object """ 

 

    falseList = [nestedMediaObjects] 

 

    for i in range(len(falseList)): 

        if not falseList[i]: 

            falseList[i] = "" 

 

    [nestedMediaObjects] = falseList 

 

    mediaObject = \ 

        """ 

        <%s class="media" id="  "> 

            %s 

            <div class="media-body"> 

                <h4 class="media-heading">%s</h4> 

                ... 

 

                <!-- Nested media object --> 

                %s 

            </div> 

        </%s>""" \ 

        % ( 

        displayType, 

        img, 

        headlineText, 

        nestedMediaObjects, 

        displayType, 

        ) 

    return mediaObject 

 

 

## LAST MODIFIED : 20130508 

## CREATED : 20130508 

## AUTHOR : DRYX 

 

def well(wellText='', wellSize='default'): 

    """Get well. Use the well as a simple effect on an element to give it an inset effect. 

 

    **Key Arguments:** 

        - ``wellText`` -- the text to be displayed in the well 

        - ``wellSize`` -- the size of the well [ "default" | "large" | "small" ] 

 

    **Return:** 

        - ``well`` -- the well """ 

 

    if wellSize == 'default': 

        wellSize = '' 

    else: 

        wellSize = 'well-%s' % (wellSize, ) 

    well = """ 

        <div class="well" id="  "> 

            %s 

        </div>""" % (content, ) 

    return well 

 

 

## LAST MODIFIED : 20130508 

## CREATED : 20130508 

## AUTHOR : DRYX 

 

def closeIcon(): 

    """Get close icon. The generic close icon for dismissing content like modals and alerts. 

 

    **Key Arguments:** 

 

    **Return:** 

        - ``closeIcon`` -- the closeIcon """ 

 

    closeIcon = """<button class="close">&times;</button>""" 

    return closeIcon 

 

 

################################################################### 

# PRIVATE (HELPER) FUNCTIONS                                      # 

################################################################### 

################################################################### 

# TEMPLATE FUNCTIONS                                              # 

###################################################################