mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-12 12:08:02 +01:00
select users correctly
This commit is contained in:
parent
c047f0af6d
commit
6e6d08f098
1 changed files with 6 additions and 6 deletions
|
@ -12,12 +12,12 @@ defmodule PhilomenaWeb.StaffController do
|
||||||
|> order_by(asc: :name)
|
|> order_by(asc: :name)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|
|
||||||
categories = %{
|
categories = [
|
||||||
"Administrators" => Enum.filter(users, & &1.role == "admin"),
|
"Administrators": Enum.filter(users, & &1.role == "admin"),
|
||||||
"Technical Team" => Enum.filter(users, & &1.role != "admin" and &1.secondary_role not in [nil, ""]),
|
"Technical Team": Enum.filter(users, & &1.role != "admin" and &1.secondary_role not in [nil, ""]),
|
||||||
"Moderators" => Enum.filter(users, & &1.role != "admin" and &1.secondary_role in [nil, ""]),
|
"Moderators": Enum.filter(users, & &1.role == "moderator" and &1.secondary_role in [nil, ""]),
|
||||||
"Assistants" => Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""])
|
"Assistants": Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""])
|
||||||
}
|
]
|
||||||
|
|
||||||
render(conn, "index.html", categories: categories)
|
render(conn, "index.html", categories: categories)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue