コード例 #1
0
ファイル: alerts.py プロジェクト: cnvandev/zwitscher-maschine
def alert_factory(is_long, title, *content):
    ''' Returns the HTML code for a generic alert message. Really only to be
    used internally, use alert() or long_alert()

    '''

    return classed_div(ALERT_CLASS, *content,
        prepend=[classed_button(CLOSE_CLASS,
            {
                "type": BUTTON_CLASS,
                "data-dismiss": ALERT_CLASS
            },
            "x"
        ),
        strong(title) if is_long else h4(title)],
    )
コード例 #2
0
def alert_factory(is_long, title, *content):
    ''' Returns the HTML code for a generic alert message. Really only to be
    used internally, use alert() or long_alert()

    '''

    return classed_div(
        ALERT_CLASS,
        *content,
        prepend=[
            classed_button(CLOSE_CLASS, {
                "type": BUTTON_CLASS,
                "data-dismiss": ALERT_CLASS
            }, "x"),
            strong(title) if is_long else h4(title)
        ],
    )
コード例 #3
0
def caret_button():
    """ Returns the HTML code for a caret indicating a dropdown/dropup menu. """

    return classed_button([BUTTON_CLASS, DROPDOWN_TOGGLE_CLASS], toggle(DROPDOWN_CLASS), classed_span("caret"))
コード例 #4
0
def zm_button(text):
    ''' Returns the HTML code for a Twitter Bootstrap-ready button. '''

    return classed_button(BUTTON_CLASS, *content)
コード例 #5
0
def caret_button():
    ''' Returns the HTML code for a caret indicating a dropdown/dropup menu. '''

    return classed_button([BUTTON_CLASS, DROPDOWN_TOGGLE_CLASS],
                          toggle(DROPDOWN_CLASS), classed_span("caret"))