From 04e5a4e26d05854cd0c91e61ec478049f2eb3190 Mon Sep 17 00:00:00 2001 From: Parasprite Date: Tue, 24 Nov 2020 15:23:35 -0600 Subject: [PATCH] Updates user link to artist link (user side) --- lib/philomena/user_links.ex | 2 +- lib/philomena/users/ability.ex | 6 +++--- .../controllers/admin/user_link/contact_controller.ex | 2 +- .../controllers/admin/user_link/reject_controller.ex | 2 +- .../admin/user_link/verification_controller.ex | 2 +- .../controllers/admin/user_link_controller.ex | 2 +- .../controllers/profile/commission_controller.ex | 2 +- .../controllers/profile/user_link_controller.ex | 8 ++++---- .../templates/admin/user_link/index.html.slime | 2 +- lib/philomena_web/templates/dnp_entry/index.html.slime | 6 +++--- .../templates/layout/_header_staff_links.html.slime | 2 +- .../templates/profile/_admin_block.html.slime | 2 +- .../profile/commission/_listing_sidebar.html.slime | 4 ++-- lib/philomena_web/templates/profile/show.html.slime | 4 ++-- .../templates/profile/user_link/index.html.slime | 4 ++-- lib/philomena_web/templates/report/new.html.slime | 2 +- lib/philomena_web/views/admin/user_view.ex | 2 +- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/philomena/user_links.ex b/lib/philomena/user_links.ex index 6609939f..db6c6e7e 100644 --- a/lib/philomena/user_links.ex +++ b/lib/philomena/user_links.ex @@ -40,7 +40,7 @@ defmodule Philomena.UserLinks do @doc """ Gets a single user_link. - Raises `Ecto.NoResultsError` if the User link does not exist. + Raises `Ecto.NoResultsError` if the Artist link does not exist. ## Examples diff --git a/lib/philomena/users/ability.ex b/lib/philomena/users/ability.ex index 22c384b0..6489563c 100644 --- a/lib/philomena/users/ability.ex +++ b/lib/philomena/users/ability.ex @@ -76,7 +76,7 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do def can?(%User{role: "moderator"}, :show, %Report{}), do: true def can?(%User{role: "moderator"}, :edit, %Report{}), do: true - # Manage user links + # Manage artist links def can?(%User{role: "moderator"}, :create_links, %User{}), do: true def can?(%User{role: "moderator"}, :edit_links, %User{}), do: true def can?(%User{role: "moderator"}, _action, UserLink), do: true @@ -262,7 +262,7 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do def can?(%User{role: "assistant", role_map: %{"Tag" => "moderator"}}, :batch_update, Tag), do: true - # User link assistant actions + # Artist link assistant actions def can?(%User{role: "assistant", role_map: %{"UserLink" => "moderator"}}, _action, %UserLink{}), do: true @@ -322,7 +322,7 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do def can?(%User{id: id}, action, %Filter{user_id: id}) when action in [:edit, :update, :delete], do: true - # View user links they've created + # View artist links they've created def can?(%User{id: id}, :create_links, %User{id: id}), do: true def can?(%User{id: id}, :show, %UserLink{user_id: id}), do: true diff --git a/lib/philomena_web/controllers/admin/user_link/contact_controller.ex b/lib/philomena_web/controllers/admin/user_link/contact_controller.ex index 5cc34fbf..1edf63ff 100644 --- a/lib/philomena_web/controllers/admin/user_link/contact_controller.ex +++ b/lib/philomena_web/controllers/admin/user_link/contact_controller.ex @@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Admin.UserLink.ContactController do {:ok, _} = UserLinks.contact_user_link(conn.assigns.user_link, conn.assigns.current_user) conn - |> put_flash(:info, "User link successfully marked as contacted.") + |> put_flash(:info, "Artist successfully marked as contacted.") |> redirect(to: Routes.admin_user_link_path(conn, :index)) end end diff --git a/lib/philomena_web/controllers/admin/user_link/reject_controller.ex b/lib/philomena_web/controllers/admin/user_link/reject_controller.ex index 9603c416..fba28bde 100644 --- a/lib/philomena_web/controllers/admin/user_link/reject_controller.ex +++ b/lib/philomena_web/controllers/admin/user_link/reject_controller.ex @@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Admin.UserLink.RejectController do {:ok, _} = UserLinks.reject_user_link(conn.assigns.user_link) conn - |> put_flash(:info, "User link successfully marked as rejected.") + |> put_flash(:info, "Artist link successfully marked as rejected.") |> redirect(to: Routes.admin_user_link_path(conn, :index)) end end diff --git a/lib/philomena_web/controllers/admin/user_link/verification_controller.ex b/lib/philomena_web/controllers/admin/user_link/verification_controller.ex index a6e1271e..7f5b9951 100644 --- a/lib/philomena_web/controllers/admin/user_link/verification_controller.ex +++ b/lib/philomena_web/controllers/admin/user_link/verification_controller.ex @@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Admin.UserLink.VerificationController do {:ok, _} = UserLinks.verify_user_link(conn.assigns.user_link, conn.assigns.current_user) conn - |> put_flash(:info, "User link successfully verified.") + |> put_flash(:info, "Artist link successfully verified.") |> redirect(to: Routes.admin_user_link_path(conn, :index)) end end diff --git a/lib/philomena_web/controllers/admin/user_link_controller.ex b/lib/philomena_web/controllers/admin/user_link_controller.ex index 36e04644..55cc5813 100644 --- a/lib/philomena_web/controllers/admin/user_link_controller.ex +++ b/lib/philomena_web/controllers/admin/user_link_controller.ex @@ -38,7 +38,7 @@ defmodule PhilomenaWeb.Admin.UserLinkController do ]) |> Repo.paginate(conn.assigns.scrivener) - render(conn, "index.html", title: "Admin - User Links", user_links: links) + render(conn, "index.html", title: "Admin - Artist Links", user_links: links) end defp verify_authorized(conn, _opts) do diff --git a/lib/philomena_web/controllers/profile/commission_controller.ex b/lib/philomena_web/controllers/profile/commission_controller.ex index b2b93817..2254c8d1 100644 --- a/lib/philomena_web/controllers/profile/commission_controller.ex +++ b/lib/philomena_web/controllers/profile/commission_controller.ex @@ -148,7 +148,7 @@ defmodule PhilomenaWeb.Profile.CommissionController do false -> conn - |> put_flash(:error, "You must have a verified user link to create a commission listing.") + |> put_flash(:error, "You must have a verified artist link to create a commission listing.") |> redirect(to: Routes.commission_path(conn, :index)) |> halt() end diff --git a/lib/philomena_web/controllers/profile/user_link_controller.ex b/lib/philomena_web/controllers/profile/user_link_controller.ex index 577b4cd1..fc651c60 100644 --- a/lib/philomena_web/controllers/profile/user_link_controller.ex +++ b/lib/philomena_web/controllers/profile/user_link_controller.ex @@ -36,12 +36,12 @@ defmodule PhilomenaWeb.Profile.UserLinkController do |> where(user_id: ^user.id) |> Repo.all() - render(conn, "index.html", title: "User Links", user_links: user_links) + render(conn, "index.html", title: "Artist Links", user_links: user_links) end def new(conn, _params) do changeset = UserLinks.change_user_link(%UserLink{}) - render(conn, "new.html", title: "New User Link", changeset: changeset) + render(conn, "new.html", title: "New Artist Link", changeset: changeset) end def create(conn, %{"user_link" => user_link_params}) do @@ -61,13 +61,13 @@ defmodule PhilomenaWeb.Profile.UserLinkController do def show(conn, _params) do user_link = conn.assigns.user_link - render(conn, "show.html", title: "Showing User Link", user_link: user_link) + render(conn, "show.html", title: "Showing Artist Link", user_link: user_link) end def edit(conn, _params) do changeset = UserLinks.change_user_link(conn.assigns.user_link) - render(conn, "edit.html", title: "Editing User Link", changeset: changeset) + render(conn, "edit.html", title: "Editing Artist Link", changeset: changeset) end def update(conn, %{"user_link" => user_link_params}) do diff --git a/lib/philomena_web/templates/admin/user_link/index.html.slime b/lib/philomena_web/templates/admin/user_link/index.html.slime index 0600322e..e4eca900 100644 --- a/lib/philomena_web/templates/admin/user_link/index.html.slime +++ b/lib/philomena_web/templates/admin/user_link/index.html.slime @@ -1,4 +1,4 @@ -h1 User Links +h1 Artist Links p Link creation is done via the Users menu. p Verifying a link will automatically award an artist badge if the link is public, no artist badge exists, and an "artist:" tag is specified. diff --git a/lib/philomena_web/templates/dnp_entry/index.html.slime b/lib/philomena_web/templates/dnp_entry/index.html.slime index 0edda2f4..1b17aa7e 100644 --- a/lib/philomena_web/templates/dnp_entry/index.html.slime +++ b/lib/philomena_web/templates/dnp_entry/index.html.slime @@ -21,12 +21,12 @@ br = link "My Listings", to: Routes.dnp_entry_path(@conn, :index, mine: "1") - not is_nil(@current_user) -> - ' You must have a verified user link to create and manage DNP entries. - = link "Request a user link", to: Routes.profile_user_link_path(@conn, :new, @current_user) + ' You must have a verified artist link to create and manage DNP entries. + = link "Request an artist link", to: Routes.profile_user_link_path(@conn, :new, @current_user) | . - true -> - ' You must be logged in and have a verified user link to create and manage DNP entries. + ' You must be logged in and have a verified artist link to create and manage DNP entries. h3 The List diff --git a/lib/philomena_web/templates/layout/_header_staff_links.html.slime b/lib/philomena_web/templates/layout/_header_staff_links.html.slime index 9720b751..edd54f33 100644 --- a/lib/philomena_web/templates/layout/_header_staff_links.html.slime +++ b/lib/philomena_web/templates/layout/_header_staff_links.html.slime @@ -54,7 +54,7 @@ = @report_count = if @user_link_count do - = link to: Routes.admin_user_link_path(@conn, :index), class: "header__link", title: "User Links" do + = link to: Routes.admin_user_link_path(@conn, :index), class: "header__link", title: "Artist Links" do ' L span.header__counter__admin = @user_link_count diff --git a/lib/philomena_web/templates/profile/_admin_block.html.slime b/lib/philomena_web/templates/profile/_admin_block.html.slime index d4b597a3..bd8d7710 100644 --- a/lib/philomena_web/templates/profile/_admin_block.html.slime +++ b/lib/philomena_web/templates/profile/_admin_block.html.slime @@ -145,7 +145,7 @@ a.label.label--primary.label--block href="#" data-click-toggle=".js-admin__optio li = link to: Routes.profile_user_link_path(@conn, :new, @user) do i.fa.fa-fw.fa-link - span.admin__button Add User Link + span.admin__button Add Artist Link = if can?(@conn, :create, Philomena.Bans.User) do li diff --git a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime index 69644e68..470da74d 100644 --- a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime +++ b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime @@ -58,9 +58,9 @@ .block__content.commission__block_body == @rendered.will_not_create -/ User link block +/ Artist link block /.block - .block__header: span.block__header__title User Links + .block__header: span.block__header__title Artist Links - is_current = (current_user && current_user.id == @user.id) - if @links.present? || is_current = render partial: 'profiles/user_link_area' diff --git a/lib/philomena_web/templates/profile/show.html.slime b/lib/philomena_web/templates/profile/show.html.slime index d0641d01..174eb5cf 100644 --- a/lib/philomena_web/templates/profile/show.html.slime +++ b/lib/philomena_web/templates/profile/show.html.slime @@ -65,10 +65,10 @@ .block = if current?(@user, @conn.assigns.current_user) or manages_links?(@conn, @user) do - a.block__header--single-item href=Routes.profile_user_link_path(@conn, :new, @user) User Links + a.block__header--single-item href=Routes.profile_user_link_path(@conn, :new, @user) Artist Links - else .block__header - span.block__header__title User Links + span.block__header__title Artist Links = for link <- @user.verified_links, should_see_link?(@conn, @user, link) do - watchers = if link.tag, do: @watcher_counts[link.tag.id] || 0, else: 0 diff --git a/lib/philomena_web/templates/profile/user_link/index.html.slime b/lib/philomena_web/templates/profile/user_link/index.html.slime index 9a057306..7171ff30 100644 --- a/lib/philomena_web/templates/profile/user_link/index.html.slime +++ b/lib/philomena_web/templates/profile/user_link/index.html.slime @@ -1,9 +1,9 @@ -h1 User Links +h1 Artist Links p a.button href=Routes.profile_user_link_path(@conn, :new, @user) ' Create a link p - ' User links associate your account on Derpibooru with tags about content you create and with accounts on sites elsewhere. This allows users to easily identify artists and admins to act more rapidly on takedown requests. + ' Artist links associate your account on Derpibooru with tags about content you create and with accounts on sites elsewhere. This allows users to easily identify artists and admins to act more rapidly on takedown requests. table.table thead diff --git a/lib/philomena_web/templates/report/new.html.slime b/lib/philomena_web/templates/report/new.html.slime index 57ae7b78..785ae79b 100644 --- a/lib/philomena_web/templates/report/new.html.slime +++ b/lib/philomena_web/templates/report/new.html.slime @@ -23,7 +23,7 @@ p strong> Only an owner of an image's rights (normally the artist) can request a takedown. ' If you're the artist, you'll strong> need - ' a verified user link. + ' a verified artist link. p ' For more information, please read the = link "takedown policy", to: "/pages/takedowns" diff --git a/lib/philomena_web/views/admin/user_view.ex b/lib/philomena_web/views/admin/user_view.ex index 949ea682..7f6cdfd4 100644 --- a/lib/philomena_web/views/admin/user_view.ex +++ b/lib/philomena_web/views/admin/user_view.ex @@ -43,7 +43,7 @@ defmodule PhilomenaWeb.Admin.UserView do def description("moderator", "Image"), do: "Manage images" def description("moderator", "DuplicateReport"), do: "Manage duplicates" def description("moderator", "Comment"), do: "Manage comments" - def description("moderator", "UserLink"), do: "Manage user links" + def description("moderator", "UserLink"), do: "Manage artist links" def description("moderator", "Topic"), do: "Moderate forums" def description("moderator", "Tag"), do: "Manage tag details"