Rename project to Mobilizon

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-10-11 17:37:39 +02:00
parent 3b48ac957f
commit 559c889f1b
191 changed files with 739 additions and 739 deletions

View File

@@ -0,0 +1,41 @@
defmodule MobilizonWeb.GroupView do
@moduledoc """
View for Groups
"""
use MobilizonWeb, :view
alias MobilizonWeb.{GroupView, ActorView}
def render("index.json", %{groups: groups}) do
%{data: render_many(groups, GroupView, "group_simple.json")}
end
def render("show.json", %{group: group}) do
%{data: render_one(group, GroupView, "group.json")}
end
def render("show_simple.json", %{group: group}) do
%{data: render_one(group, GroupView, "group_simple.json")}
end
def render("group_simple.json", %{group: group}) do
%{
id: group.id,
title: group.title,
description: group.description,
suspended: group.suspended,
url: group.url
}
end
def render("group.json", %{group: group}) do
%{
id: group.id,
title: group.title,
description: group.description,
suspended: group.suspended,
url: group.url,
members: render_many(group.members, ActorView, "actor_basic.json"),
events: render_many(group.organized_events, EventView, "event_simple.json")
}
end
end