frenzy/lib/frenzy_web/views/group_view.ex

20 lines
360 B
Elixir
Raw Normal View History

2019-03-21 23:21:56 +00:00
defmodule FrenzyWeb.GroupView do
use FrenzyWeb, :view
2021-08-28 15:58:22 +00:00
def title(:index, _) do
"Groups"
end
def title(:show, %{group: %Frenzy.Group{title: title}}) do
title
end
def title(:edit, %{group: %Frenzy.Group{title: title}}) do
"Edit #{title}"
end
def title(:read, %{group: %Frenzy.Group{title: title}}) do
"Read #{title}"
end
2019-03-21 23:21:56 +00:00
end