33 lines
737 B
Elixir
33 lines
737 B
Elixir
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
|