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) )
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)
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))