mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 20:37:59 +01:00
723bfa213f
* AwardJson, LinkJson, UserJson to views * FilterJson -> view * ForumJson -> view * TopicJson -> view * PostJson -> view * TagJson -> view * CommentJson -> view * GalleryJson -> view
17 lines
409 B
Elixir
17 lines
409 B
Elixir
defmodule PhilomenaWeb.Api.Json.AwardView do
|
|
use PhilomenaWeb, :view
|
|
|
|
def render("award.json", %{award: award}) do
|
|
%{
|
|
image_url: badge_url_root() <> "/" <> award.badge.image,
|
|
title: award.badge.title,
|
|
id: award.badge_id,
|
|
label: award.label,
|
|
awarded_on: award.awarded_on
|
|
}
|
|
end
|
|
|
|
defp badge_url_root do
|
|
Application.get_env(:philomena, :badge_url_root)
|
|
end
|
|
end
|