physics_workload.app.pages.components.suffixes

Classes

SuffixCreate

Suffix for pages that create a file.

SuffixCreateTaskLead

Suffix for pages that create a unit lead post.

SuffixCreateFullTime

Suffix for pages that create a full-time post.

SuffixEdit

Suffix for pages that create a file.

SuffixDelete

Suffix for pages that create a file.

SuffixHistory

Module Contents

class physics_workload.app.pages.components.suffixes.SuffixCreate(text=None, **kwargs)

Bases: iommi.Fragment

Suffix for pages that create a file.

class Meta
tag = 'span'
attrs__class
children__text = ' / Create '
children__icon
class physics_workload.app.pages.components.suffixes.SuffixCreateTaskLead(text=None, **kwargs)

Bases: iommi.Fragment

Suffix for pages that create a unit lead post.

class Meta
tag = 'span'
attrs__class
children__text = ' / Create Lead '
children__icon
class physics_workload.app.pages.components.suffixes.SuffixCreateFullTime(text=None, **kwargs)

Bases: iommi.Fragment

Suffix for pages that create a full-time post.

class Meta
tag = 'span'
attrs__class
children__text = ' / Create Full-Time '
children__icon
class physics_workload.app.pages.components.suffixes.SuffixEdit(text=None, **kwargs)

Bases: iommi.Fragment

Suffix for pages that create a file.

class Meta
tag = 'span'
attrs__class
children__text = ' / Edit '
children__icon
class physics_workload.app.pages.components.suffixes.SuffixDelete(text=None, **kwargs)

Bases: iommi.Fragment

Suffix for pages that create a file.

class Meta
tag = 'span'
attrs__class
children__text = ' / Delete '
children__icon
class physics_workload.app.pages.components.suffixes.SuffixHistory(text=None, **kwargs)

Bases: iommi.Fragment

Fragment is a class used to build small HTML fragments that plug into iommi’s structure.

# @test
from iommi.fragment import Fragment
# @end

h1 = Fragment(children__text='Tony', tag='h1')

# There is also a shorthand version that is identical to the above:
h1 = Fragment('Tony', tag='h1')

It’s easiest to use via the html builder:

h1 = html.h1('Tony')

Fragments are useful because attrs, template and tag are evaluated, so if you have a Page with a fragment in it you can configure it later:

class MyPage(Page):
    header = html.h1(
        'Hi!',
        attrs__class__staff=
            lambda request, **_: request.user.is_staff,
    )

Rendering a MyPage will result in a <h1>, but if you do MyPage(parts__header__tag=’h2’) it will be rendered with a <h2>.

class Meta
tag = 'span'
attrs__class
children__text = ' / History '
children__icon