comfycamp/lib/comfycamp_web/controllers/admin_page_html.ex

34 lines
737 B
Elixir
Raw Normal View History

defmodule ComfycampWeb.AdminPageHTML do
use ComfycampWeb, :html
def home(assigns) do
~H"""
2024-08-31 17:06:02 +05:00
<div>
<h3>Управление сайтом</h3>
<div class="stats">
<.stat name="Всего пользователей" value={@user_count} />
<.stat
name="Неодобренных пользователей"
value={@unapproved_user_count}
/>
</div>
</div>
"""
end
@doc """
Card for statistical data.
"""
attr :name, :string, required: true
attr :value, :any, required: true
def stat(assigns) do
~H"""
<div class="stat">
<div class="value"><%= @value %></div>
<div class="name"><%= @name %></div>
</div>
"""
end
end