mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
fix warnings
This commit is contained in:
parent
f8431cb1c2
commit
af1781dcd0
3 changed files with 5 additions and 7 deletions
|
@ -57,7 +57,6 @@ defmodule Philomena.Users do
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def create_user(attrs \\ %{}) do
|
def create_user(attrs \\ %{}) do
|
||||||
roles =
|
|
||||||
%User{}
|
%User{}
|
||||||
|> User.changeset(attrs)
|
|> User.changeset(attrs)
|
||||||
|> Repo.insert()
|
|> Repo.insert()
|
||||||
|
|
|
@ -29,16 +29,16 @@
|
||||||
.block
|
.block
|
||||||
.block__header
|
.block__header
|
||||||
span.block__header__title General user flags
|
span.block__header__title General user flags
|
||||||
ul = collection_checkboxes f, :roles, filtered_roles(general_permissions, @roles), mapper: &checkbox_mapper/6
|
ul = collection_checkboxes f, :roles, filtered_roles(general_permissions(), @roles), mapper: &checkbox_mapper/6
|
||||||
|
|
||||||
.block
|
.block
|
||||||
.block__header.warning
|
.block__header.warning
|
||||||
span.block__header__title Special roles for assistants
|
span.block__header__title Special roles for assistants
|
||||||
ul = collection_checkboxes f, :roles, filtered_roles(assistant_permissions, @roles), mapper: &checkbox_mapper/6
|
ul = collection_checkboxes f, :roles, filtered_roles(assistant_permissions(), @roles), mapper: &checkbox_mapper/6
|
||||||
|
|
||||||
.block
|
.block
|
||||||
.block__header.danger
|
.block__header.danger
|
||||||
span.block__header__title Special roles for moderators
|
span.block__header__title Special roles for moderators
|
||||||
ul = collection_checkboxes f, :roles, filtered_roles(moderator_permissions, @roles), mapper: &checkbox_mapper/6
|
ul = collection_checkboxes f, :roles, filtered_roles(moderator_permissions(), @roles), mapper: &checkbox_mapper/6
|
||||||
|
|
||||||
= submit "Save User", class: "button"
|
= submit "Save User", class: "button"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
defmodule PhilomenaWeb.Admin.UserView do
|
defmodule PhilomenaWeb.Admin.UserView do
|
||||||
use PhilomenaWeb, :view
|
use PhilomenaWeb, :view
|
||||||
|
|
||||||
def checkbox_mapper(form, field, input_opts, role, label_opts, _opts) do
|
def checkbox_mapper(form, field, input_opts, role, _label_opts, _opts) do
|
||||||
input_id = "user_roles_#{role.id}"
|
input_id = "user_roles_#{role.id}"
|
||||||
label_opts = [for: input_id]
|
label_opts = [for: input_id]
|
||||||
input_opts =
|
input_opts =
|
||||||
|
@ -24,13 +24,12 @@ defmodule PhilomenaWeb.Admin.UserView do
|
||||||
def description("moderator", "Image"), do: "Manage images"
|
def description("moderator", "Image"), do: "Manage images"
|
||||||
def description("moderator", "DuplicateReport"), do: "Manage duplicates"
|
def description("moderator", "DuplicateReport"), do: "Manage duplicates"
|
||||||
def description("moderator", "Comment"), do: "Manage comments"
|
def description("moderator", "Comment"), do: "Manage comments"
|
||||||
def description("moderator", "Tag"), do: "Manage tag details"
|
|
||||||
def description("moderator", "UserLink"), do: "Manage user links"
|
def description("moderator", "UserLink"), do: "Manage user links"
|
||||||
def description("moderator", "Topic"), do: "Moderate forums"
|
def description("moderator", "Topic"), do: "Moderate forums"
|
||||||
|
|
||||||
|
def description("moderator", "Tag"), do: "Manage tag details"
|
||||||
def description("admin", "Tag"), do: "Alias tags"
|
def description("admin", "Tag"), do: "Alias tags"
|
||||||
def description("batch_update", "Tag"), do: "Update tags in batches"
|
def description("batch_update", "Tag"), do: "Update tags in batches"
|
||||||
def description("moderator", "Tag"), do: "Manage tags"
|
|
||||||
|
|
||||||
def description("moderator", "User"), do: "Manage users and wipe votes"
|
def description("moderator", "User"), do: "Manage users and wipe votes"
|
||||||
def description("admin", "Role"), do: "Manage permissions"
|
def description("admin", "Role"), do: "Manage permissions"
|
||||||
|
|
Loading…
Reference in a new issue