cannery/lib/lokal_web/live/home_live.ex

19 lines
430 B
Elixir
Raw Normal View History

2022-05-05 21:47:22 -04:00
defmodule LokalWeb.HomeLive do
2022-01-22 20:44:38 -05:00
@moduledoc """
2023-02-04 09:16:51 -05:00
Liveview for the home page
2022-01-22 20:44:38 -05:00
"""
2021-03-11 21:12:55 -05:00
use LokalWeb, :live_view
2023-02-04 09:16:51 -05:00
alias Lokal.Accounts
alias LokalWeb.Endpoint
2021-03-11 21:12:55 -05:00
2023-02-04 09:16:51 -05:00
@version Mix.Project.config()[:version]
2021-03-11 21:12:55 -05:00
@impl true
2023-02-04 09:16:51 -05:00
def mount(_params, _session, socket) do
admins = Accounts.list_users_by_role(:admin)
socket = socket |> assign(page_title: gettext("Home"), admins: admins, version: @version)
{:ok, socket}
2021-03-11 21:12:55 -05:00
end
end