View Source ExTeal.FieldVisibility (ExTeal v0.27.0)

Functions that allow a resource to configure which fields can be displayed on which parts of the resource.

Summary

Functions

Marks the field as safe to render as html

Conditionally render a field on a resource as a whole based on the current request. Helpful for filtering out fields based on the current users permissions.

Field is only visible on Details and Index

Hide field is hidden on the detail

Hide field is hidden on the index

Hide field is hidden when creating a resource

Hide field is hidden when updating a resource

Field is only visible on Details

Field is only visible on Create and New

Field is only visible on Index

Marks a relational field as searchable

Show field on the index

Stack a fields value or form underneath its label

Functions

@spec as_html(ExTeal.Field.t()) :: ExTeal.Field.t()

Marks the field as safe to render as html

@spec can_see?(ExTeal.Field.t(), (Plug.Conn.t() -> boolean())) :: ExTeal.Field.t()

Conditionally render a field on a resource as a whole based on the current request. Helpful for filtering out fields based on the current users permissions.

@spec except_on_forms(ExTeal.Field.t()) :: ExTeal.Field.t()

Field is only visible on Details and Index

@spec hide_from_detail(ExTeal.Field.t()) :: ExTeal.Field.t()

Hide field is hidden on the detail

@spec hide_from_index(ExTeal.Field.t()) :: ExTeal.Field.t()

Hide field is hidden on the index

Link to this function

hide_when_creating(field)

View Source
@spec hide_when_creating(ExTeal.Field.t()) :: ExTeal.Field.t()

Hide field is hidden when creating a resource

Link to this function

hide_when_updating(field)

View Source
@spec hide_when_updating(ExTeal.Field.t()) :: ExTeal.Field.t()

Hide field is hidden when updating a resource

@spec only_on_details(ExTeal.Field.t()) :: ExTeal.Field.t()

Field is only visible on Details

@spec only_on_forms(ExTeal.Field.t()) :: ExTeal.Field.t()

Field is only visible on Create and New

@spec only_on_index(ExTeal.Field.t()) :: ExTeal.Field.t()

Field is only visible on Index

@spec searchable(ExTeal.Field.t()) :: ExTeal.Field.t()

Marks a relational field as searchable

Only applies to many to many relationships

@spec show_on_index(ExTeal.Field.t()) :: ExTeal.Field.t()

Show field on the index

@spec stacked(ExTeal.Field.t()) :: ExTeal.Field.t()

Stack a fields value or form underneath its label