mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-03 16:17:59 +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)
|
||||
|> Repo.all()
|
||||
|
||||
categories = %{
|
||||
"Administrators" => Enum.filter(users, & &1.role == "admin"),
|
||||
"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, ""]),
|
||||
"Assistants" => Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""])
|
||||
}
|
||||
categories = [
|
||||
"Administrators": Enum.filter(users, & &1.role == "admin"),
|
||||
"Technical Team": Enum.filter(users, & &1.role != "admin" and &1.secondary_role not 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, ""])
|
||||
]
|
||||
|
||||
render(conn, "index.html", categories: categories)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue