comfycamp/lib/comfycamp_web/controllers/admin_page_controller.ex

24 lines
565 B
Elixir
Raw Normal View History

defmodule ComfycampWeb.AdminPageController do
use ComfycampWeb, :controller
2024-08-31 17:06:02 +05:00
alias Comfycamp.Accounts
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()
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
)
end
def services(conn, _params) do
conn
|> put_layout(html: :admin)
2024-08-31 17:02:54 +05:00
|> render(:home, page_title: "Админка")
end
end