diff --git a/lib/philomena_web/controllers/filter/hide_controller.ex b/lib/philomena_web/controllers/filter/hide_controller.ex index 35af1f96..0bbc7577 100644 --- a/lib/philomena_web/controllers/filter/hide_controller.ex +++ b/lib/philomena_web/controllers/filter/hide_controller.ex @@ -3,7 +3,6 @@ defmodule PhilomenaWeb.Filter.HideController do alias Philomena.Filters alias Philomena.Tags.Tag - alias Philomena.Repo plug PhilomenaWeb.FilterBannedUsersPlug plug :authorize_filter diff --git a/lib/philomena_web/controllers/filter/spoiler_controller.ex b/lib/philomena_web/controllers/filter/spoiler_controller.ex index 73307803..0f317c04 100644 --- a/lib/philomena_web/controllers/filter/spoiler_controller.ex +++ b/lib/philomena_web/controllers/filter/spoiler_controller.ex @@ -3,7 +3,6 @@ defmodule PhilomenaWeb.Filter.SpoilerController do alias Philomena.Filters alias Philomena.Tags.Tag - alias Philomena.Repo plug PhilomenaWeb.FilterBannedUsersPlug plug :authorize_filter diff --git a/lib/philomena_web/controllers/tag/watch_controller.ex b/lib/philomena_web/controllers/tag/watch_controller.ex index abd0f508..2ff6e476 100644 --- a/lib/philomena_web/controllers/tag/watch_controller.ex +++ b/lib/philomena_web/controllers/tag/watch_controller.ex @@ -3,7 +3,6 @@ defmodule PhilomenaWeb.Tag.WatchController do alias Philomena.Tags.Tag alias Philomena.Users - alias Philomena.Repo plug :load_resource, model: Tag, id_field: "slug", id_name: "tag_id", persisted: true diff --git a/lib/philomena_web/views/user_attribution_view.ex b/lib/philomena_web/views/user_attribution_view.ex index 83f1cf71..49d12748 100644 --- a/lib/philomena_web/views/user_attribution_view.ex +++ b/lib/philomena_web/views/user_attribution_view.ex @@ -49,15 +49,21 @@ defmodule PhilomenaWeb.UserAttributionView do |> staff_role(user) end - defp personal_title(labels, %{personal_title: t}) when t not in [nil, ""], - do: [{"label--primary", t} | labels] - defp personal_title(labels, _user), - do: labels + defp personal_title(labels, %{personal_title: t}) do + case blank?(t) do + true -> labels + false -> [{"label--primary", t} | labels] + end + end + defp personal_title(labels, _user), do: labels - defp secondary_role(labels, %{secondary_role: t}) when t not in [nil, ""], - do: [{"label--warning", t} | labels] - defp secondary_role(labels, _user), - do: labels + defp secondary_role(labels, %{secondary_role: t}) do + case blank?(t) do + true -> labels + false -> [{"label--warning", t} | labels] + end + end + defp secondary_role(labels, _user), do: labels defp staff_role(labels, %{hide_default_role: false, role: "admin"}), do: [{"label--danger", "Site Administrator"} | labels]