Liking cljdoc? Tell your friends :D

wagoe.user.core.ui

User-specific UI components based on User schema.

This namespace contains pure functions for generating user-related Hiccup structures. Components are derived from the User schema and handle user-specific business logic for display and forms.

User-specific UI components based on User schema.

This namespace contains pure functions for generating user-related Hiccup
structures. Components are derived from the User schema and handle
user-specific business logic for display and forms.
raw docstring

action-badgeclj

(action-badge action)

Display action type with appropriate styling.

Args: action - keyword action type (:create, :update, :delete, etc.)

Returns: Hiccup span with styled badge

Pure: true

Display action type with appropriate styling.

Args:
  action - keyword action type (:create, :update, :delete, etc.)
  
Returns:
  Hiccup span with styled badge
  
Pure: true
sourceraw docstring

audit-count-badgeclj

(audit-count-badge total-count)

The toolbar's entry count. The table fragment carries it out of band, so it follows the filters.

The toolbar's entry count. The table fragment carries it out of band, so
it follows the filters.
sourceraw docstring

audit-detail-modalclj

(audit-detail-modal)

The modal a row's detail button opens; admin-ux.js fills it from the button's data attributes.

The modal a row's detail button opens; admin-ux.js fills it from the
button's data attributes.
sourceraw docstring

audit-filtersclj

(audit-filters filters)

The toolbar's filters. Each re-queries the table as it changes, sending the others and the table's sort along, and pushes the URL.

Pure: true

The toolbar's filters. Each re-queries the table as it changes, sending
the others and the table's sort along, and pushes the URL.

Pure: true
sourceraw docstring

audit-log-rowclj

(audit-log-row audit-log)

Generate audit log table row.

Args: audit-log - audit log entity map

Returns: Hiccup table row

Pure: true

Generate audit log table row.

Args:
  audit-log - audit log entity map

Returns:
  Hiccup table row

Pure: true
sourceraw docstring

audit-logs-tableclj

(audit-logs-table audit-logs table-query total-count filters)

The audit table, its pagination or an empty state, in the container the page's controls re-render. They request /web/audit and push it, so the address bar holds sort, filters and page.

Args: audit-logs - collection of audit log entity maps table-query - normalized TableQuery total-count - total number of audit logs filters - map of parsed search filters

Pure: true

The audit table, its pagination or an empty state, in the container the
page's controls re-render. They request `/web/audit` and push it, so the
address bar holds sort, filters and page.

Args:
  audit-logs - collection of audit log entity maps
  table-query - normalized TableQuery
  total-count - total number of audit logs
  filters - map of parsed search filters

Pure: true
sourceraw docstring

audit-pageclj

(audit-page audit-logs table-query total-count filters opts)

The audit trail in the admin shell: a toolbar of filters over the table.

Args: audit-logs - collection of audit log entity maps table-query - normalized TableQuery total-count - total number of audit logs filters - map of parsed search filters opts - :user and :flash

Pure: false (the shell reads the request's navigation)

The audit trail in the admin shell: a toolbar of filters over the table.

Args:
  audit-logs - collection of audit log entity maps
  table-query - normalized TableQuery
  total-count - total number of audit logs
  filters - map of parsed search filters
  opts - :user and :flash

Pure: false (the shell reads the request's navigation)
sourceraw docstring

audit-table-fragmentclj

(audit-table-fragment audit-logs table-query total-count filters)

What the table's controls get back: the table, and the count out of band.

What the table's controls get back: the table, and the count out of band.
sourceraw docstring

audit-urlclj

source

create-user-formclj

(create-user-form)
(create-user-form data errors)
(create-user-form data errors password-violations policy)
(create-user-form data errors password-violations policy opts)

Generate a form for creating new users based on CreateUserRequest schema.

Args: data: Optional form data map for pre-filling errors: Optional validation errors map password-violations: Optional password violations from policy check policy: Optional password policy configuration opts: Optional map with :return-to URL for post-create redirect

Returns: Hiccup structure for create user form

Generate a form for creating new users based on CreateUserRequest schema.

Args:
  data: Optional form data map for pre-filling
  errors: Optional validation errors map
  password-violations: Optional password violations from policy check
  policy: Optional password policy configuration
  opts: Optional map with :return-to URL for post-create redirect

Returns:
  Hiccup structure for create user form
sourceraw docstring

create-user-pageclj

(create-user-page & [data errors opts])

Complete create user page.

Args: data: Optional form data for pre-filling errors: Optional validation errors opts: Optional page options. Supports :return-to for the 'Back to users' button target and to thread through the form as a hidden field so the HTMX POST handler can redirect to the same URL on success, and :password-policy for the rules the form lists — the shell reads that from config, so the page and the failed POST advertise the same set.

Returns: Complete HTML page for creating users

Complete create user page.

Args:
  data: Optional form data for pre-filling
  errors: Optional validation errors
  opts: Optional page options. Supports :return-to for the 'Back to users'
        button target and to thread through the form as a hidden field so
        the HTMX POST handler can redirect to the same URL on success, and
        :password-policy for the rules the form lists — the shell reads that
        from config, so the page and the failed POST advertise the same set.

Returns:
  Complete HTML page for creating users
sourceraw docstring

default-password-policyclj

source

error-pageclj

(error-page {:keys [status message correlation-id user refusal]})

The page a browser sees for a failed request: the error's own message for a client error, the generic sentence for a server one, and the reference to quote when reporting it.

The page a browser sees for a failed request: the error's own message for a
client error, the generic sentence for a server one, and the reference to
quote when reporting it.
sourceraw docstring

format-audit-timestampclj

(format-audit-timestamp timestamp)

Format timestamp for audit log display.

Args: timestamp - java.time.Instant or similar

Returns: Formatted timestamp string like '2026-02-01 07:39:15'

Pure: true

Format timestamp for audit log display.

Args:
  timestamp - java.time.Instant or similar

Returns:
  Formatted timestamp string like '2026-02-01 07:39:15'

Pure: true
sourceraw docstring

format-ipclj

(format-ip ip)

An IP address as the audit trail shows it: no URL brackets, IPv6 short, loopback named.

Pure: true

An IP address as the audit trail shows it: no URL brackets, IPv6 short,
loopback named.

Pure: true
sourceraw docstring

format-relative-time*clj

(format-relative-time* timestamp now zone-id)

Format a timestamp as relative time (e.g., '2 hours ago', 'just now').

Args: timestamp - java.time.Instant or similar now - java.time.Instant supplied by the shell

Returns: String describing time relative to the explicit reference time

Pure: true

Format a timestamp as relative time (e.g., '2 hours ago', 'just now').

Args:
  timestamp - java.time.Instant or similar
  now - java.time.Instant supplied by the shell
  
Returns:
  String describing time relative to the explicit reference time
  
Pure: true
sourceraw docstring

login-formclj

(login-form data errors)

Login form for email/password sign-in.

Args: data - map with optional :email / :remember / :return-to; :registration? false hides the link to /web/register errors - map of field keyword -> vector of error messages

Login form for email/password sign-in.

Args:
   data   - map with optional :email / :remember / :return-to; :registration?
            false hides the link to /web/register
   errors - map of field keyword -> vector of error messages
sourceraw docstring

login-pageclj

(login-page & [data errors opts])

Complete login page.

Args: data - form data map (may be empty) errors - validation errors (may be nil) opts - page options (user context, flash messages, return-to URL, etc.)

Complete login page.

Args:
  data   - form data map (may be empty)
  errors - validation errors (may be nil)
  opts   - page options (user context, flash messages, return-to URL, etc.)
sourceraw docstring

mfa-enrolment-done-pageclj

(mfa-enrolment-done-page backup-codes opts)

The backup codes, once the second factor is on, and the way back to sign in.

The backup codes, once the second factor is on, and the way back to sign in.
sourceraw docstring

mfa-enrolment-pageclj

(mfa-enrolment-page {:keys [secret qr-code-url issuer account-name
                            backup-codes]}
                    errors
                    opts)

The authenticator setup for a user who signed in with the right password but must enrol first. setup is what setup-mfa returned.

The authenticator setup for a user who signed in with the right password
but must enrol first. `setup` is what `setup-mfa` returned.
sourceraw docstring

mfa-enrolment-pathclj

Where a user the app requires a second factor of, who has none, sets one up before signing in.

Where a user the app requires a second factor of, who has none, sets one up
before signing in.
sourceraw docstring

mfa-login-formclj

(mfa-login-form data errors)

Form for entering MFA code during login.

Args: data - map with :email, :password, :remember, :return-to errors - map of field keyword -> vector of error messages

Form for entering MFA code during login.

Args:
   data   - map with :email, :password, :remember, :return-to
   errors - map of field keyword -> vector of error messages
sourceraw docstring

mfa-login-pageclj

(mfa-login-page & [data errors opts])

Complete MFA login page (shown after successful password verification).

Args: data - form data map (must contain :email and :password) errors - validation errors (may be nil) opts - page options (user context, flash messages, return-to URL, etc.)

Complete MFA login page (shown after successful password verification).

Args:
  data   - form data map (must contain :email and :password)
  errors - validation errors (may be nil)
  opts   - page options (user context, flash messages, return-to URL, etc.)
sourceraw docstring

oidc-continue-pageclj

(oidc-continue-page location opts)

Body of the answer to a provider callback that signed someone in; the handler's Refresh header moves the browser on.

Body of the answer to a provider callback that signed someone in; the
handler's Refresh header moves the browser on.
sourceraw docstring

oidc-mfa-pageclj

(oidc-mfa-page errors opts)

The second-factor prompt after a provider sign-in. The pending sign-in is in a cookie, so the form carries only the code.

The second-factor prompt after a provider sign-in. The pending sign-in is
in a cookie, so the form carries only the code.
sourceraw docstring

parse-user-agentclj

(parse-user-agent user-agent)

Extract browser and device information from user-agent string.

Args: user-agent - user-agent string

Returns: A translation marker rendering as 'Chrome on Desktop' or 'Safari on Mobile', or nil for no user-agent.

A marker rather than a string: word order differs between languages, so the browser and device names are passed as parameters and the sentence lives in the catalogue. The parameters are themselves markers — the renderer resolves those first, so each name is translated before the sentence is assembled.

The :user/browser-* and :user/device-* keys already existed in the catalogue, unreferenced. They were added for this and never wired up.

Pure: true

Extract browser and device information from user-agent string.

Args:
  user-agent - user-agent string

Returns:
  A translation marker rendering as 'Chrome on Desktop' or 'Safari on
  Mobile', or nil for no user-agent.

  A marker rather than a string: word order differs between languages, so
  the browser and device names are passed as parameters and the sentence
  lives in the catalogue. The parameters are themselves markers — the
  renderer resolves those first, so each name is translated before the
  sentence is assembled.

  The :user/browser-* and :user/device-* keys already existed in the
  catalogue, unreferenced. They were added for this and never wired up.

Pure: true
sourceraw docstring

password-requirement-itemclj

(password-requirement-item requirement)

Display a single password requirement with status indicator.

Args: requirement - map with :met?, :message. A nil :met? means the state is not known — the server cannot see what is in the field — and renders as a neutral bullet rather than a ✓ or a ✗.

Returns: Hiccup list item with status indicator

Pure: true

Display a single password requirement with status indicator.

Args:
  requirement - map with :met?, :message. A nil :met? means the state is not
                known — the server cannot see what is in the field — and
                renders as a neutral bullet rather than a ✓ or a ✗.

Returns:
  Hiccup list item with status indicator

Pure: true
sourceraw docstring

password-requirements-listclj

(password-requirements-list violations policy)

Display list of password requirements with current status.

Args: violations - vector of violation maps from meets-password-policy?, or nil when nothing has been checked. nil is not an empty list: a password box is never pre-filled, so on a re-render the server has no idea what is in it, and the rules render as neither met nor unmet. Reading nil as "no violations" ticked every rule green above an empty field (BOU-381). policy - password policy configuration map

Returns: Hiccup list of requirements

Pure: true

Display list of password requirements with current status.

Args:
  violations - vector of violation maps from meets-password-policy?, or nil
               when nothing has been checked. nil is not an empty list: a
               password box is never pre-filled, so on a re-render the server
               has no idea what is in it, and the rules render as neither met
               nor unmet. Reading nil as "no violations" ticked every rule
               green above an empty field (BOU-381).
  policy     - password policy configuration map

Returns:
  Hiccup list of requirements

Pure: true
sourceraw docstring

password-strength-indicatorclj

(password-strength-indicator violations)

Display password strength meter based on violation count.

Args: violations - vector of violation maps

Returns: Hiccup structure for strength meter

Pure: true

Display password strength meter based on violation count.

Args:
  violations - vector of violation maps
  
Returns:
  Hiccup structure for strength meter
  
Pure: true
sourceraw docstring

register-formclj

(register-form data errors)
(register-form data errors password-violations policy)

Form for self-service account creation.

Args: data - map with optional :name / :email / :return-to errors - map of field keyword -> vector of error messages password-violations - optional password violations from policy check policy - optional password policy configuration

Form for self-service account creation.

Args:
  data   - map with optional :name / :email / :return-to
  errors - map of field keyword -> vector of error messages
  password-violations - optional password violations from policy check
  policy - optional password policy configuration
sourceraw docstring

register-pageclj

(register-page & [data errors opts])

Complete self-service registration page.

Args: data - form data map (may be empty) errors - validation errors (may be nil) opts - page options (user context, flash messages, etc.)

Complete self-service registration page.

Args:
  data   - form data map (may be empty)
  errors - validation errors (may be nil)
  opts   - page options (user context, flash messages, etc.)
sourceraw docstring

result-badgeclj

(result-badge result)

Display result status with appropriate styling.

Args: result - keyword result (:success or :failure)

Returns: Hiccup span with styled badge

Pure: true

Display result status with appropriate styling.

Args:
  result - keyword result (:success or :failure)
  
Returns:
  Hiccup span with styled badge
  
Pure: true
sourceraw docstring

session-rowclj

(session-row session current-session-id user-id current-time zone-id)

Single row in the sessions table.

Args: session - session map with :id, :ip-address, :user-agent, :created-at, :last-accessed-at current-session-id - id of the session making the request (marked current) user-id - user ID for action URLs

Returns: Hiccup table row

Pure: true

Single row in the sessions table.

Args:
  session            - session map with :id, :ip-address, :user-agent, :created-at, :last-accessed-at
  current-session-id - id of the session making the request (marked current)
  user-id            - user ID for action URLs

Returns:
  Hiccup table row

Pure: true
sourceraw docstring

sessions-listclj

(sessions-list sessions current-session-id user-id current-time zone-id)

Table displaying all user sessions.

Args: sessions - collection of session maps current-session-id - id of the session making the request user-id - user ID for action URLs

Returns: Hiccup table

Pure: true

Table displaying all user sessions.

Args:
  sessions      - collection of session maps
  current-session-id - id of the session making the request
  user-id       - user ID for action URLs
  
Returns:
  Hiccup table
  
Pure: true
sourceraw docstring

user-created-successclj

(user-created-success user)

Generate success message for user creation based on User schema.

Args: user: Created User entity map

Returns: Hiccup structure showing success message

Generate success message for user creation based on User schema.

Args:
  user: Created User entity map
  
Returns:
  Hiccup structure showing success message
sourceraw docstring

user-rowclj

(user-row user)

The cells of a user's row: name, email, role and status, the badges styled as the admin's enum cells.

Args: user: User entity map (from User schema)

Returns: Vector of cell values for table row (some as Hiccup structures)

The cells of a user's row: name, email, role and status, the badges
styled as the admin's enum cells.

Args:
  user: User entity map (from User schema)

Returns:
  Vector of cell values for table row (some as Hiccup structures)
sourceraw docstring

user-sessions-pageclj

(user-sessions-page user sessions current-session-id opts)

Complete page for managing user sessions.

Args: user - user map sessions - collection of session maps current-session-id - id of the session making the request opts - page options (user context, flash messages, etc.)

Returns: Complete page hiccup

Pure: false

Complete page for managing user sessions.

Args:
  user          - user map
  sessions      - collection of session maps
  current-session-id - id of the session making the request
  opts          - page options (user context, flash messages, etc.)

Returns:
  Complete page hiccup

Pure: false
sourceraw docstring

user-validation-errorsclj

(user-validation-errors errors)

Generate validation error display for user forms based on User schema.

Args: errors: Map of field -> error messages from user validation

Returns: Hiccup structure for validation errors

Generate validation error display for user forms based on User schema.

Args:
  errors: Map of field -> error messages from user validation
  
Returns:
  Hiccup structure for validation errors
sourceraw docstring

users-pageclj

(users-page users)
(users-page users opts)
(users-page users total-count opts)

Complete users listing page.

Arities:

  • ([users]) ; infer total-count and no extra options
  • ([users opts]) ; infer total-count, with page options
  • ([users total-count opts]) ; full control

Args (3-arity): users: Collection of User entities total-count: Total number of users opts: Optional page options (user context, flash messages, etc.) May contain :table-query for sorting/paging and :filters.

Returns: Complete HTML page for users listing

Complete users listing page.

Arities:
- ([users])                  ; infer total-count and no extra options
- ([users opts])             ; infer total-count, with page options
- ([users total-count opts]) ; full control

Args (3-arity):
  users:       Collection of User entities
  total-count: Total number of users
  opts:        Optional page options (user context, flash messages, etc.)
               May contain :table-query for sorting/paging and :filters.

Returns:
  Complete HTML page for users listing
sourceraw docstring

users-tableclj

(users-table users)
(users-table users table-query total-count)
(users-table users table-query total-count filters)

Generate a table displaying users based on User schema.

Arities:

  • ([users]) ; basic table with default sorting, no query params in hx-get
  • ([users table-query total-count]) ; full control for paging/sorting
  • ([users table-query total-count filters]) ; with search filters

Args (3-arity): users: Collection of User entity maps table-query: TableQuery map (sorting/paging) total-count: Total number of users

Returns: Hiccup structure for users table

Generate a table displaying users based on User schema.

Arities:
- ([users])                         ; basic table with default sorting, no query params in hx-get
- ([users table-query total-count]) ; full control for paging/sorting
- ([users table-query total-count filters]) ; with search filters

Args (3-arity):
  users:       Collection of User entity maps
  table-query: TableQuery map (sorting/paging)
  total-count: Total number of users

Returns:
  Hiccup structure for users table
sourceraw docstring

users-table-fragmentclj

(users-table-fragment users table-query total-count)
(users-table-fragment users table-query total-count filters)

Generate just the users table container fragment (for HTMX refresh).

Args: users: Collection of User entity maps table-query: Normalized TableQuery (see wagoe.platform.shell.web.table) total-count: Total number of users filters: Optional map of parsed search filters (see wagoe.platform.shell.web.table)

Returns: Hiccup structure for users table container (no page layout)

Generate just the users table container fragment (for HTMX refresh).

Args:
  users:       Collection of User entity maps
  table-query: Normalized TableQuery (see wagoe.platform.shell.web.table)
  total-count: Total number of users
  filters:     Optional map of parsed search filters (see wagoe.platform.shell.web.table)

Returns:
  Hiccup structure for users table container (no page layout)
sourceraw docstring

web-root-pageclj

(web-root-page & [opts])

Landing page shown at /web — logo, welcome message, and login link.

Args: opts: Optional page options (flash messages, etc.)

Returns: Complete HTML page structure

Landing page shown at /web — logo, welcome message, and login link.

Args:
  opts: Optional page options (flash messages, etc.)

Returns:
  Complete HTML page 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