2024-07-28 21:52:12 +05:00
|
|
|
defmodule ComfycampWeb.AdminPageController do
|
|
|
|
use ComfycampWeb, :controller
|
2024-08-31 17:06:02 +05:00
|
|
|
alias Comfycamp.Accounts
|
2024-07-28 21:52:12 +05:00
|
|
|
|
|
|
|
def home(conn, _params) do
|
2024-08-31 17:06:02 +05:00
|
|
|
user_count = Accounts.count_users()
|
|
|
|
unapproved_user_count = Accounts.count_unapproved_users()
|
|
|
|
|
2024-07-28 21:52:12 +05:00
|
|
|
conn
|
|
|
|
|> put_layout(html: :admin)
|
2024-08-31 17:06:02 +05:00
|
|
|
|> render(:home,
|
|
|
|
page_title: "Админка",
|
|
|
|
user_count: user_count,
|
|
|
|
unapproved_user_count: unapproved_user_count
|
|
|
|
)
|
2024-07-28 21:52:12 +05:00
|
|
|
end
|
|
|
|
|
|
|
|
def services(conn, _params) do
|
|
|
|
conn
|
|
|
|
|> put_layout(html: :admin)
|
2024-08-31 17:02:54 +05:00
|
|
|
|> render(:home, page_title: "Админка")
|
2024-07-28 21:52:12 +05:00
|
|
|
end
|
|
|
|
end
|