philomena/lib/philomena_web/views/notification_view.ex

39 lines
790 B
Elixir
Raw Normal View History

2019-11-16 04:50:58 +01:00
defmodule PhilomenaWeb.NotificationView do
use PhilomenaWeb, :view
@template_paths %{
2024-07-08 00:09:20 +02: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-16 04:50:58 +01:00
}
2024-07-08 00:09:20 +02:00
def notification_template_path(category) do
@template_paths[to_string(category)]
2019-11-16 04:50:58 +01:00
end
2024-07-08 00:09:20 +02:00
def name_of_category(category) do
case category 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-11 05:20:19 +01:00
end