comfycamp/lib/comfycamp_web/controllers/admin_page_html.ex
2024-08-31 17:06:02 +05:00

34 lines
737 B
Elixir
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

defmodule ComfycampWeb.AdminPageHTML do
use ComfycampWeb, :html
def home(assigns) do
~H"""
<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