コード例 #1
0
def buttons_crispies():
    return [
        Row(
            Column(ButtonGroup(Submit('submit',
                                      _('Submit'),
                                      css_class='success'),
                               Button('cancel', _('Cancel')),
                               Button('dummy', _('Delete'), css_class='alert'),
                               css_class='radius right'),
                   css_class='clearfix'), ),
        Row(
            Column(
                Panel(ButtonGroup(Submit('submit',
                                         _('Submit'),
                                         css_class='success'),
                                  Button('cancel', _('Cancel')),
                                  Button('dummy',
                                         _('Delete'),
                                         css_class='alert'),
                                  css_class='radius right'),
                      css_class='clearfix')), ),
    ]
コード例 #2
0
def buttons_crispies(pack=None):
    box = Panel
    if pack == 'foundation-6':
        box = Callout
    return [
        Row(
            Column(ButtonGroup(Submit('submit',
                                      _('Submit'),
                                      css_class='success'),
                               Reset('cancel', _('Cancel')),
                               Button('dummy', _('Delete'), css_class='alert'),
                               css_class='radius right'),
                   css_class='clearfix'), ),
        Row(
            Column(
                box(HTML("""<p>As &lt;input/&gt;</p>"""),
                    ButtonGroup(Submit('submit',
                                       _('Submit'),
                                       css_class='success'),
                                Reset('cancel', _('Cancel')),
                                Button('dummy', _('Delete'),
                                       css_class='alert'),
                                css_class='radius right'),
                    css_class='clearfix')), ),
        Row(
            Column(
                box(HTML("""<p>As &lt;button/&gt;</p>"""),
                    ButtonGroup(ButtonSubmit('submit',
                                             _('Submit'),
                                             css_class='success'),
                                ButtonReset('cancel', _('Cancel')),
                                ButtonElement(
                                    'button-label',
                                    'button-value',
                                    css_class='alert',
                                    content="""<span>&lt;Doh/&gt;</span>"""),
                                css_class='radius right'),
                    css_class='clearfix')), ),
    ]
コード例 #3
0
def buttons_crispies(pack=None):
    box = Panel
    if pack == 'foundation-6':
        box = Callout
    return [
        Row(
            Column(ButtonGroup(Submit('submit',
                                      _('Submit'),
                                      css_class='success'),
                               Button('cancel', _('Cancel')),
                               Button('dummy', _('Delete'), css_class='alert'),
                               css_class='radius right'),
                   css_class='clearfix'), ),
        Row(
            Column(
                box(ButtonGroup(Submit('submit',
                                       _('Submit'),
                                       css_class='success'),
                                Button('cancel', _('Cancel')),
                                Button('dummy', _('Delete'),
                                       css_class='alert'),
                                css_class='radius right'),
                    css_class='clearfix')), ),
    ]
コード例 #4
0
def test_buttongroup(output_test_path, rendered_template, helper, client):
    form = BasicInputForm()
    pack = helper.template_pack

    helper.layout = Layout(
        'simple',
        ButtonGroup(
            Submit('Save', 'Save'),
            Button('Cancel', 'Cancel'),
        )
    )

    rendered = rendered_template(form, helper=helper)

    attempted = read_output(output_test_path, pack, "test_buttongroup.html")
    #write_output(output_test_path, pack, "test_buttongroup.html", rendered)

    assert rendered == attempted