2021-09-10 00:28:53 -04:00
|
|
|
defmodule CanneryWeb.HomeLive do
|
2022-01-22 21:40:29 -05:00
|
|
|
@moduledoc """
|
|
|
|
Liveview for the home page
|
|
|
|
"""
|
|
|
|
|
2021-03-11 21:12:55 -05:00
|
|
|
use CanneryWeb, :live_view
|
2022-01-22 21:40:29 -05:00
|
|
|
alias Cannery.Accounts
|
2022-07-04 20:19:03 -04:00
|
|
|
alias CanneryWeb.Endpoint
|
2021-03-11 21:12:55 -05:00
|
|
|
|
2022-11-19 10:31:13 -05:00
|
|
|
@version Mix.Project.config()[:version]
|
|
|
|
|
2021-03-11 21:12:55 -05:00
|
|
|
@impl true
|
2022-05-05 23:26:29 -04:00
|
|
|
def mount(_params, _session, socket) do
|
2021-09-10 00:28:53 -04:00
|
|
|
admins = Accounts.list_users_by_role(:admin)
|
2022-11-19 10:31:13 -05:00
|
|
|
socket = socket |> assign(page_title: gettext("Home"), admins: admins, version: @version)
|
2022-02-19 00:31:17 -05:00
|
|
|
{:ok, socket}
|
2021-03-11 21:12:55 -05:00
|
|
|
end
|
|
|
|
end
|