Add Philomena Contrib Sec Role, Staff Page Visibility Toggle (#130)

* Add Philomena Contributor to secondary roles list

* Visibility toggle
This commit is contained in:
Joey 2020-06-07 21:32:04 -05:00 committed by GitHub
parent 417305e43c
commit c8b33f0ff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ defmodule PhilomenaWeb.StaffController do
|> Repo.all()
categories = [
Administrators: Enum.filter(users, &(&1.role == "admin")),
Administrators: Enum.filter(users, &(&1.role == "admin" and &1.hide_default_role == false)),
"Technical Team":
Enum.filter(
users,
@ -22,8 +22,8 @@ defmodule PhilomenaWeb.StaffController do
"Public Relations":
Enum.filter(users, &(&1.role != "admin" and &1.secondary_role == "Public Relations")),
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, ""]))
Enum.filter(users, &(&1.role == "moderator" and &1.secondary_role in [nil, ""] and &1.hide_default_role == false)),
Assistants: Enum.filter(users, &(&1.role == "assistant" and &1.secondary_role in [nil, ""] and &1.hide_default_role == false))
]
render(conn, "index.html", title: "Site Staff", categories: categories)

View file

@ -17,7 +17,7 @@
.table-list__label__input = select f, :role, ["user", "assistant", "moderator", "admin"], class: "input"
label.table-list__label
.table-list__label__text Secondary banner:
.table-list__label__input = select f, :secondary_role, [[key: "-", value: ""], "Site Developer", "System Administrator", "Public Relations"], class: "input"
.table-list__label__input = select f, :secondary_role, [[key: "-", value: ""], "Site Developer", "System Administrator", "Philomena Contributor", "Public Relations"], class: "input"
label.table-list__label
.table-list__label__text Hide staff banner:
.table-list__label__input = checkbox f, :hide_default_role, class: "checkbox"