2019-11-15 22:50:58 -05:00
|
|
|
defmodule PhilomenaWeb.NotificationView do
|
|
|
|
use PhilomenaWeb, :view
|
|
|
|
|
|
|
|
@template_paths %{
|
2024-07-07 18:09:20 -04:00
|
|
|
"channel_live" => "_channel.html",
|
|
|
|
"forum_post" => "_post.html",
|
|
|
|
"forum_topic" => "_topic.html",
|
|
|
|
"gallery_image" => "_gallery.html",
|
|
|
|
"image_comment" => "_comment.html",
|
|
|
|
"image_merge" => "_image.html"
|
2019-11-15 22:50:58 -05:00
|
|
|
}
|
|
|
|
|
2024-07-07 18:09:20 -04:00
|
|
|
def notification_template_path(category) do
|
|
|
|
@template_paths[to_string(category)]
|
2019-11-15 22:50:58 -05:00
|
|
|
end
|
2024-07-06 00:37:35 -04:00
|
|
|
|
2024-07-07 18:09:20 -04:00
|
|
|
def name_of_category(category) do
|
|
|
|
case category do
|
2024-07-06 00:37:35 -04:00
|
|
|
: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
|