Exemple #1
0
def element(*content):
    ''' A single navigational element for a tab, pill, or navbar navigation
    system. Pass it a link to make this work properly.

    '''

    return li(*extract_attributes(*content))
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)
    )
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)
    )
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)
    )
Exemple #5
0
def navbar(*content):
    ''' A navigation bar element that spans the available width. Use by filling
    with either a nav element (see nav.py) or (something else I forgot while
    writing this comment).

    '''

    # Gross little hack - we have to wrap the content (regardless of an
    # attributes hash) with a div(). We can do this because we know
    # extract_attributes() will return a hash first, since we're giving it one.
    merged_content = extract_attributes(classes(NAVBAR_CLASS), *content)
    attributes = merged_content[0:1]
    merged_content = classed_div(NAVBAR_INNER_CLASS, *merged_content[1:])
    return div(*merged_content)
Exemple #6
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))
Exemple #7
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))
Exemple #8
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))