Some work

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-07-04 14:29:17 +02:00
parent 394057d45e
commit 93a97b0865
56 changed files with 5577 additions and 4327 deletions

View File

@@ -0,0 +1,3 @@
defmodule Eventos.EmailView do
use EventosWeb, :view
end

View File

@@ -20,7 +20,6 @@ defmodule EventosWeb.EventView do
def render("event_for_actor.json", %{event: event}) do
%{id: event.id,
title: event.title,
slug: event.slug,
uuid: event.uuid,
}
end
@@ -28,7 +27,6 @@ defmodule EventosWeb.EventView do
def render("event_simple.json", %{event: event}) do
%{id: event.id,
title: event.title,
slug: event.slug,
description: event.description,
begins_on: event.begins_on,
ends_on: event.ends_on,
@@ -39,6 +37,7 @@ defmodule EventosWeb.EventView do
avatar: event.organizer_actor.avatar_url,
},
type: "Event",
address_type: event.address_type,
}
end
@@ -51,8 +50,9 @@ defmodule EventosWeb.EventView do
uuid: event.uuid,
organizer: render_one(event.organizer_actor, ActorView, "acccount_basic.json"),
participants: render_many(event.participants, ActorView, "show_basic.json"),
address: render_one(event.address, AddressView, "address.json"),
physical_address: render_one(event.physical_address, AddressView, "address.json"),
type: "Event",
address_type: event.address_type,
}
end
end

View File

@@ -45,4 +45,16 @@ defmodule EventosWeb.UserView do
role: user.role,
}
end
def render("confirmation.json", %{user: user}) do
%{
email: user.email,
}
end
def render("password_reset.json", %{user: user}) do
%{
email: user.email,
}
end
end