mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-18 06:57:59 +01:00
16 lines
327 B
Elixir
16 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
|