ArcanaWeb.DashboardComponents (Arcana v3.0.0)

Copy Markdown View Source

Shared components for the Arcana dashboard.

Summary

Functions

allowed_collection?(allowed, name)

blank_to_nil(value)

dashboard_layout(assigns)

Renders the dashboard layout with stats bar, navigation, and content.

Attributes

  • stats (:map) (required)
  • current_tab (:atom) (required)
  • prefix (:string) - Defaults to "/arcana".
  • flash (:map) - Defaults to %{}.

Slots

  • inner_block (required)

error_to_string(err)

filter_allowed_collections(collections, allowed)

Filters a list of collection maps (anything with a :name key) down to the allowed set. :all passes everything through untouched.

format_metadata(metadata)

format_number(n)

format_pct(value)

format_score(value)

get_repo_from_session(session)

load_collections(repo, allowed \\ :all)

load_source_ids(repo, allowed \\ :all)

load_stats(repo, allowed \\ :all)

normalize_collection(name)

parse_float(val, default)

parse_format(_)

parse_int(val, default)

parse_mode(_)