Liking cljdoc? Tell your friends :D

wagoe.admin.core.ui.detail

Entity detail/edit page components: form widgets, field grouping, the entity form, parent-context/related-records tables, and the detail page.

Pure Hiccup generators. Depends on base for URL and field helpers.

Entity detail/edit page components: form widgets, field grouping, the
entity form, parent-context/related-records tables, and the detail page.

Pure Hiccup generators. Depends on `base` for URL and field helpers.
raw docstring

child-rowclj

(child-row rel index values errors & [display])

One child row of a create form: the fields of rel (see forms/nested-relationships) named for row index, and a remove button.

One child row of a create form: the fields of `rel` (see
`forms/nested-relationships`) named for row `index`, and a remove button.
sourceraw docstring

entity-detail-pageclj

(entity-detail-page entity-name
                    entity-config
                    record
                    errors
                    permissions
                    &
                    [opts])

Entity detail/edit page.

Args: entity-name: Keyword entity name entity-config: Entity configuration map record: Entity record (nil for create) errors: Optional validation errors permissions: Permission flags opts: Optional map with :flash, :related-records, :display, :workflow, and :field-options {field [[value label] ...]}, which turns a text input into a select (a foreign key's parent rows, BOU-563), and on a create form :nested [{:rel :rows [[index values]] :row-errors {index errors} :too-few {...}}], the child rows the parent is created with (BOU-570)

Returns: Hiccup page structure

Entity detail/edit page.

Args:
  entity-name: Keyword entity name
  entity-config: Entity configuration map
  record: Entity record (nil for create)
  errors: Optional validation errors
  permissions: Permission flags
  opts: Optional map with :flash, :related-records, :display, :workflow,
        and :field-options {field [[value label] ...]}, which turns a
        text input into a select (a foreign key's parent rows, BOU-563),
        and on a create form :nested [{:rel :rows [[index values]]
        :row-errors {index errors} :too-few {...}}], the child rows the
        parent is created with (BOU-570)

Returns:
  Hiccup page structure
sourceraw docstring

entity-formclj

(entity-form entity-name
             entity-config
             record
             errors
             _permissions
             &
             [cancel-url display prefill nested])

Render entity create/edit form.

Args: entity-name: Keyword entity name entity-config: Entity configuration map record: Entity record (nil for create) errors: Validation errors map permissions: Permission flags prefill: Optional starting values for a create form

Returns: Hiccup form structure

Notes: If :field-groups is configured, renders fields in grouped sections. Otherwise, renders flat list of editable fields.

Render entity create/edit form.

Args:
  entity-name: Keyword entity name
  entity-config: Entity configuration map
  record: Entity record (nil for create)
  errors: Validation errors map
  permissions: Permission flags
  prefill: Optional starting values for a create form

 Returns:
   Hiccup form structure

Notes:
  If :field-groups is configured, renders fields in grouped sections.
  Otherwise, renders flat list of editable fields.
sourceraw docstring

entity-new-pageclj

(entity-new-page entity-name entity-config errors permissions & [opts])

Entity creation page (convenience wrapper).

Args: entity-name: Keyword entity name entity-config: Entity configuration map errors: Optional validation errors permissions: Permission flags opts: Optional map with :flash

Returns: Hiccup page structure

Entity creation page (convenience wrapper).

Args:
  entity-name: Keyword entity name
  entity-config: Entity configuration map
  errors: Optional validation errors
  permissions: Permission flags
  opts: Optional map with :flash

Returns:
  Hiccup page structure
sourceraw docstring

parent-context-bannerclj

(parent-context-banner {:keys [config record]})

Renders a read-only info strip showing key fields from a parent record. Shown at the top of a child entity edit page (e.g. order-item → order).

Args: ctx: {:config {:label "Order" :fields [:order-number :status ...]} :record parent-record-map}

Renders a read-only info strip showing key fields from a parent record.
Shown at the top of a child entity edit page (e.g. order-item → order).

Args:
  ctx: {:config {:label "Order" :fields [:order-number :status ...]}
        :record  parent-record-map}
sourceraw docstring

(related-records-table relationship records & [display])

Render a table of related records for a has-many relationship. When :editable true, adds an Edit link per row and a link to create a child with its :foreign-key set to :parent-id. When :has-more? is set, the records are one page of more, and a link leads to the rest.

Args: relationship: {:label "Order Items" :fields [...] :editable true :foreign-key :order-id :parent-id "..." :return-to "..." :has-more? true :entity-config {...}} — the related entity's config, which gives each cell its field type records: vector of record maps (kebab-case keys) display: Optional display options (zone/date patterns) for value rendering

Returns: Hiccup table structure

Render a table of related records for a has-many relationship.
When :editable true, adds an Edit link per row and a link to create a child
with its :foreign-key set to :parent-id. When :has-more? is set, the
records are one page of more, and a link leads to the rest.

Args:
  relationship: {:label "Order Items" :fields [...] :editable true
                 :foreign-key :order-id :parent-id "..." :return-to "..."
                 :has-more? true
                 :entity-config {...}} — the related entity's config, which
                gives each cell its field type
  records:      vector of record maps (kebab-case keys)
  display:      Optional display options (zone/date patterns) for value
                rendering

Returns:
  Hiccup table structure
sourceraw docstring

render-field-widgetclj

(render-field-widget field-name value field-config errors)
(render-field-widget field-name value field-config errors display)

Render input widget for field based on its configuration.

Args: field-name: Keyword field name value: Current field value field-config: Field configuration map errors: Optional collection of error messages for this field display: Optional display map; a datetime is shown in its zone (BOU-523)

Returns: Hiccup form field structure

Render input widget for field based on its configuration.

Args:
  field-name: Keyword field name
  value: Current field value
  field-config: Field configuration map
  errors: Optional collection of error messages for this field
  display: Optional display map; a datetime is shown in its zone (BOU-523)

Returns:
  Hiccup form field structure
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close