mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-05 00:57:59 +01:00
15 lines
327 B
Elixir
15 lines
327 B
Elixir
defmodule PhilomenaWeb.Admin.SiteNoticeView do
|
|
use PhilomenaWeb, :view
|
|
|
|
def time_column_class(time) do
|
|
now = DateTime.utc_now()
|
|
|
|
case DateTime.diff(time, now) > 0 do
|
|
true -> "success"
|
|
false -> "danger"
|
|
end
|
|
end
|
|
|
|
def live_text(%{live: true}), do: "Yes"
|
|
def live_text(_site_notice), do: "No"
|
|
end
|