コード例 #1
0
ファイル: style_bootstrap.py プロジェクト: bgrundmann/iommi
from iommi.style import (
    Style,
)
from iommi.style_font_awesome_4 import font_awesome_4
from iommi.style_base import base
from iommi.asset import Asset

bootstrap_base = Style(
    base,
    assets=dict(
        css=Asset.css(
            attrs=dict(
                href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css',
                integrity='sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh',
                crossorigin='anonymous',
            ),
        ),
        popper_js=Asset.js(
            attrs=dict(
                src='https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js',
                integrity='sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo',
                crossorigin='anonymous',
            )
        ),
        js=Asset.js(
            attrs=dict(
                src='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js',
                integrity='sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6',
                crossorigin='anonymous',
            )
        ),
コード例 #2
0
          $(".navbar-burger").click(function() {

              // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
              $(".navbar-burger").toggleClass("is-active");
              $(".navbar-menu").toggleClass("is-active");

          });
    });
</script>
"""))

bulma_base = Style(
    base,
    root__assets=dict(
        css=Asset.css(
            attrs__href=
            'https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css', ),
        navbar_burger_click_js=navbar_burger_click_js,
    ),
    sub_styles__horizontal=dict(Field=dict(
        attrs__class={
            'mr-4': True,
        },
        label__attrs__class={
            'mt-2': True,
            'mr-1': True,
        },
    ), ),
    Header__attrs__class={
        'title': True,
        'is-1': lambda fragment, **_: fragment.tag == 'h1',
コード例 #3
0
ファイル: style_water.py プロジェクト: bgrundmann/iommi
from iommi.style import Style
from iommi.style_base import base
from iommi.asset import Asset

water = Style(
    base,
    assets__css=Asset.css(
        attrs=dict(
            href='https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/dark.min.css',
        ),
    ),
)
コード例 #4
0
ファイル: style_foundation.py プロジェクト: TriOptima/iommi
             },
             boolean_tristate__attrs__class={
                 'medium-2': True,
                 'medium-4': False
             },
         ),
         attrs__class={
             'medium-4': True,
             'cell': True,
         },
     ),
 ),
 root__assets=dict(
     css=Asset.css(attrs=dict(
         href=
         'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/foundation.min.css',
         integrity='sha256-ogmFxjqiTMnZhxCqVmcqTvjfe1Y/ec4WaRj/aQPvn+I=',
         crossorigin='anonymous',
     ), ),
     js=Asset.
     js(attrs__src=
        'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/foundation.min.js'
        ),
 ),
 Container=dict(
     tag='div',
     attrs__class={
         'grid-container': True,
     },
 ),
 Action=dict(shortcuts=dict(
     button__attrs__class__button=True,
コード例 #5
0
from iommi.debug import (
    endpoint__debug_tree,
    iommi_debug_on,
)
from iommi.style import Style
from iommi.asset import Asset

select2_assets = dict(
    select2_js=Asset.js(
        attrs__src=
        'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js',
    ),
    select2_css=Asset.css(attrs=dict(
        href=
        'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css',
    )),
)

base = Style(
    internal=True,
    base_template='iommi/base.html',
    content_block='content',
    root=dict(
        endpoints__debug_tree=dict(
            include=lambda endpoint, **_: iommi_debug_on(),
            func=endpoint__debug_tree,
        ),
        assets=dict(
            jquery=Asset.js(
                attrs=dict(
                    src='https://code.jquery.com/jquery-3.4.1.js',
コード例 #6
0
ファイル: style_base.py プロジェクト: bgrundmann/iommi
from iommi.style import Style
from iommi.asset import Asset

select2_assets = dict(
    select2_js=Asset.js(
        attrs__src='https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js',
    ),
    select2_css=Asset.css(
        attrs=dict(
            href='https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css',
        )
    ),
)

base = Style(
    base_template='iommi/base.html',
    content_block='content',
    assets=dict(
        jquery=Asset.js(
            attrs=dict(
                src='https://code.jquery.com/jquery-3.4.1.js',
                integrity='sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=',
                crossorigin='anonymous',
            ),
            after=-1,
        ),
    ),
    Form=dict(
        template='iommi/form/form.html',
        actions_template='iommi/form/actions.html',
    ),