45 lines
1.1 KiB
Elixir
45 lines
1.1 KiB
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
|
||
|
||
def email_overview(assigns) do
|
||
~H"""
|
||
<div>
|
||
<.header>Проверка email</.header>
|
||
<.form for={nil} action={~p"/admin/send_email"} method="POST">
|
||
<.input label="Тестовый адрес" name="addr" value="" type="email" />
|
||
<.button type="submit">Отправить</.button>
|
||
</.form>
|
||
</div>
|
||
"""
|
||
end
|
||
end
|