Fix front-end, allow events to be created by a group, allow to get sessions from an event

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-16 19:45:09 +01:00
parent 7a98674e59
commit 67ef32432e
29 changed files with 278 additions and 82 deletions

View File

@@ -3,23 +3,27 @@ defmodule EventosWeb.AccountView do
View for Accounts
"""
use EventosWeb, :view
alias EventosWeb.AccountView
alias EventosWeb.{AccountView, EventView}
def render("index.json", %{accounts: accounts}) do
%{data: render_many(accounts, AccountView, "account_for_user.json")}
%{data: render_many(accounts, AccountView, "acccount_basic.json")}
end
def render("show.json", %{account: account}) do
%{data: render_one(account, AccountView, "account.json")}
end
def render("account_for_user.json", %{account: account}) do
def render("show_basic.json", %{account: account}) do
%{data: render_one(account, AccountView, "account_basic.json")}
end
def render("acccount_basic.json", %{account: account}) do
%{id: account.id,
username: account.username,
domain: account.domain,
display_name: account.display_name,
description: account.description,
public_key: account.public_key,
# public_key: account.public_key,
suspended: account.suspended,
uri: account.uri,
url: account.url,
@@ -32,11 +36,11 @@ defmodule EventosWeb.AccountView do
domain: account.domain,
display_name: account.display_name,
description: account.description,
public_key: account.public_key,
# public_key: account.public_key,
suspended: account.suspended,
uri: account.uri,
url: account.url,
organized_events: account.organized_events
organized_events: render_many(account.organized_events, EventView, "event_simple.json")
}
end
end