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 @@
- +
@@ -82,7 +82,7 @@ <%= for note <- @notes do %>
- +
diff --git a/priv/static/images/default-avatar.jpg b/priv/static/images/default-avatar.jpg new file mode 100644 index 0000000..3113c7f Binary files /dev/null and b/priv/static/images/default-avatar.jpg differ diff --git a/priv/static/images/default-header.jpg b/priv/static/images/default-header.jpg new file mode 100644 index 0000000..4176386 Binary files /dev/null and b/priv/static/images/default-header.jpg differ