示例#1
0
def long_error_alert(title, *content):
    ''' Returns the HTML code for a long, red error message. '''

    return long_alert(
        title,
        *extract_attributes(classes(ALERT_ERROR_CLASS), *content)
    )
示例#2
0
def long_info_alert(title, *content):
    ''' Returns the HTML code for a long, light-blue info message. '''

    return long_alert(
        title,
        *extract_attributes(classes(ALERT_INFO_CLASS), *content)
    )
示例#3
0
def long_success_alert(title, *content):
    ''' Returns the HTML code for a long, green success message. '''

    return long_alert(
        title,
        *extract_attributes(classes(ALERT_SUCCESS_CLASS), *content)
    )
示例#4
0
def media(img_url, title, link_url, *content):
    ''' Returns the HTML for a basic formatter for a "media object" like a video
    or something. It kind of looks like a Facebook post. '''

    return classed_div(MEDIA_CLASS,
        *media_content(img_url, title, link_url, *content
    )


def media_list(*content):
    ''' A list that handles media items (even nested!) gracefully. Use
    media_list_item to generate them. '''

    return classed_ul(MEDIA_LIST_CLASS, *content)


def media_list_item(img_url, title, link_url, *content):
    ''' A single list item in a media list (see media_list() for something that
    is designed to gracefully hold them). '''

    return classed_li(MEDIA_CLASS,
        *media_content(img_url, title, link_url, *content)
    )


def media_content(img_url, title, link_url, *content):
    ''' Returns the content to a media block. Should only be used internally,
    use media() or media_list() + media_list_item(). '''

    return [
        classed_a(PULL_LEFT, href(link_url),
            img({"src": img_url, "class": MEDIA_OBJECT_CLASS})
        ),
        classed_div(MEDIA_BODY_CLASS,
            h4(classes(MEDIA_HEADING_CLASS), title),
            *content
        )
    ]
示例#5
0
def pills(*content):
    ''' Returns the HTML code for a set of "pill" navigaiton elements using the
    set of given tabs. '''

    return generic_nav(classes(NAV_PILLS_CLASS), *content)
示例#6
0
def small_pagination(*content):
    ''' Returns the HTML for a small pagination element. Fill with an unordered
    list to display properly. '''

    return pagination(classes(PAGINATION_SMALL_CLASS), *content)
示例#7
0
def mini_pagination(*content):
    ''' Returns the HTML for a tiny pagination element. Fill with an unordered
    list to display properly. '''

    return pagination(classes(PAGINATION_MINI_CLASS), *content)
示例#8
0
def important_label(*content):
    ''' Returns the HTML code for a red AHHHHHHHHH! label. '''

    return default_label(classes(LABEL_IMPORTANT_CLASS), *content)
示例#9
0
def large_pagination(*content):
    ''' Returns the HTML for a huge pagination element. Fill with an unordered
    list to display properly. '''

    return pagination(classes(PAGINATION_LARGE_CLASS), *content)
示例#10
0
def long_error_alert(title, *content):
    ''' Returns the HTML code for a long, red error message. '''

    return long_alert(
        title, *extract_attributes(classes(ALERT_ERROR_CLASS), *content))
示例#11
0
def vertical_button_group(*content):
    ''' Returns the HTML code for a vertical button group that contains the
    given buttons. '''

    return button_group(classes(BUTTON_GROUP_CLASS), *content)
示例#12
0
def info_badge(*content):
    ''' Returns the HTML code for a light blue info badge. '''

    return default_badge(classes(BADGE_INFO_CLASS), *content)
示例#13
0
def inverse_badge(*content):
    ''' Returns the HTML code for a black badge with a white number. '''

    return default_badge(classes(BADGE_INVERSE_CLASS), *content)
示例#14
0
def warning_badge(*content):
    ''' Returns the HTML code for an orange warning badge. '''

    return default_badge(classes(BADGE_WARNING_CLASS), *content)
示例#15
0
def important_badge(*content):
    ''' Returns the HTML code for a red AHHHHHHHHH! badge. '''

    return default_badge(classes(BADGE_IMPORTANT_CLASS), *content)
示例#16
0
def success_badge(*content):
    ''' Returns the HTML code for a successfully-green coloured badge. '''

    return default_badge(classes(BADGE_SUCCESS_CLASS), *content)
示例#17
0
def inverse_label(*content):
    ''' Returns the HTML code for a black label with white text. '''

    return default_label(classes(LABEL_INVERSE_CLASS), *content)
示例#18
0
def info_label(*content):
    ''' Returns the HTML code for a light blue info label. '''

    return default_label(classes(LABEL_INFO_CLASS), *content)
示例#19
0
def stacked():
    return classes(NAV_STACKED_CLASS)
示例#20
0
def success_label(*content):
    ''' Returns the HTML code for a successfully-green coloured label. '''

    return default_label(classes(LABEL_SUCCESS_CLASS), *content)
示例#21
0
def long_success_alert(title, *content):
    ''' Returns the HTML code for a long, green success message. '''

    return long_alert(
        title, *extract_attributes(classes(ALERT_SUCCESS_CLASS), *content))
示例#22
0
def small_pagination(*content):
    ''' Returns the HTML for a small pagination element. Fill with an unordered
    list to display properly. '''

    return pagination(classes(PAGINATION_SMALL_CLASS), *content)
示例#23
0
def long_info_alert(title, *content):
    ''' Returns the HTML code for a long, light-blue info message. '''

    return long_alert(title,
                      *extract_attributes(classes(ALERT_INFO_CLASS), *content))
示例#24
0
def mini_pagination(*content):
    ''' Returns the HTML for a tiny pagination element. Fill with an unordered
    list to display properly. '''

    return pagination(classes(PAGINATION_MINI_CLASS), *content)
示例#25
0
def large_pagination(*content):
    ''' Returns the HTML for a huge pagination element. Fill with an unordered
    list to display properly. '''

    return pagination(classes(PAGINATION_LARGE_CLASS), *content)
示例#26
0
def warning_label(*content):
    ''' Returns the HTML code for an orange warning label. '''

    return default_label(classes(LABEL_WARNING_CLASS), *content)