diff --git a/lib/nulla_web/components/templates.ex b/lib/nulla_web/components/templates.ex index e8318f3..65365a4 100644 --- a/lib/nulla_web/components/templates.ex +++ b/lib/nulla_web/components/templates.ex @@ -9,6 +9,22 @@ defmodule NullaWeb.ActorHTML do embed_templates "templates/actor/*" + def avatar(url) do + if url do + url + else + "/images/default-avatar.jpg" + end + end + + def profile_header(url) do + if url do + url + else + "/images/default-header.jpg" + end + end + def format_birthdate(date) do formatted = Date.to_string(date) |> String.replace("-", "/") diff --git a/lib/nulla_web/components/templates/actor/show.html.heex b/lib/nulla_web/components/templates/actor/show.html.heex index 76d3f63..d7a2d21 100644 --- a/lib/nulla_web/components/templates/actor/show.html.heex +++ b/lib/nulla_web/components/templates/actor/show.html.heex @@ -16,10 +16,10 @@