2019-11-15 22:50:58 -05:00
|
|
|
defmodule PhilomenaWeb.NotificationView do
|
|
|
|
use PhilomenaWeb, :view
|
|
|
|
|
|
|
|
@template_paths %{
|
|
|
|
"Channel" => "_channel.html",
|
|
|
|
"Forum" => "_forum.html",
|
|
|
|
"Gallery" => "_gallery.html",
|
|
|
|
"Image" => "_image.html",
|
|
|
|
"LivestreamChannel" => "_channel.html",
|
|
|
|
"Topic" => "_topic.html"
|
|
|
|
}
|
|
|
|
|
|
|
|
def notification_template_path(actor_type) do
|
|
|
|
@template_paths[actor_type]
|
|
|
|
end
|
2024-07-06 00:37:35 -04:00
|
|
|
|
|
|
|
def name_of_type(notification_type) do
|
|
|
|
case notification_type do
|
|
|
|
:channel_live ->
|
|
|
|
"Live channels"
|
|
|
|
|
|
|
|
:forum_post ->
|
|
|
|
"New replies in topics"
|
|
|
|
|
|
|
|
:forum_topic ->
|
|
|
|
"New topics"
|
|
|
|
|
|
|
|
:gallery_image ->
|
|
|
|
"Updated galleries"
|
|
|
|
|
|
|
|
:image_comment ->
|
|
|
|
"New replies on images"
|
|
|
|
|
|
|
|
:image_merge ->
|
|
|
|
"Image merges"
|
|
|
|
end
|
|
|
|
end
|
2020-01-10 23:20:19 -05:00
|
|
|
end
|