View Source AshPyroComponents.Components.Page (AshPyroComponents v0.1.0)

Auto-render a full-featured page for a given resource.

Summary

Functions

Build a page automatically from AshPyro's live_view DSL. It will provide a complete page with all the usual features

Get the timezone from session or connect_params, defaulting to the local timezone.

Update the :now assign taking the timezone into account.

Functions

Link to this macro

__using__(opts \\ [])

View Source (macro)

Build a page automatically from AshPyro's live_view DSL. It will provide a complete page with all the usual features:

  • url-based state
  • pagination
  • sorting
  • filtering
  • realtime updates via pub-sub
  • forms
  • authorization
  • formatting date/time to user's timezone
  • routes to include in your router.ex. 🚀
defmodule ExampleWeb.Vendor.CompanyLive do
  use ExampleWeb, :live_view
  use AshPyroComponents.Components.Page,
    resource: Example.Vendor.Company,
    page: :companies
end
Link to this function

get_live_tz(socket, session)

View Source
@spec get_live_tz(Phoenix.LiveView.Socket.t(), any()) :: any()

Get the timezone from session or connect_params, defaulting to the local timezone.

Update the :now assign taking the timezone into account.