From ea6d1b2b172d88b6ea47ab044813d39b053534b2 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 3 Feb 2018 20:43:14 +0900 Subject: [PATCH] move avi.png & banner.png from /priv/static/static to /priv/static/images --- lib/pleroma/user.ex | 4 ++-- priv/static/{static => images}/avi.png | Bin priv/static/{static => images}/banner.png | Bin test/web/mastodon_api/account_view_test.exs | 8 ++++---- test/web/twitter_api/views/user_view_test.exs | 16 ++++++++-------- 5 files changed, 14 insertions(+), 14 deletions(-) rename priv/static/{static => images}/avi.png (100%) rename priv/static/{static => images}/banner.png (100%) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 6ba2b165c..81cec8265 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -29,14 +29,14 @@ defmodule Pleroma.User do def avatar_url(user) do case user.avatar do %{"url" => [%{"href" => href} | _]} -> href - _ -> "#{Web.base_url()}/static/avi.png" + _ -> "#{Web.base_url()}/images/avi.png" end end def banner_url(user) do case user.info["banner"] do %{"url" => [%{"href" => href} | _]} -> href - _ -> "#{Web.base_url()}/static/banner.png" + _ -> "#{Web.base_url()}/images/banner.png" end end diff --git a/priv/static/static/avi.png b/priv/static/images/avi.png similarity index 100% rename from priv/static/static/avi.png rename to priv/static/images/avi.png diff --git a/priv/static/static/banner.png b/priv/static/images/banner.png similarity index 100% rename from priv/static/static/banner.png rename to priv/static/images/banner.png diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index 061fc2693..5eefa61e1 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -19,10 +19,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do statuses_count: 5, note: user.bio, url: user.ap_id, - avatar: "http://localhost:4001/static/avi.png", - avatar_static: "http://localhost:4001/static/avi.png", - header: "http://localhost:4001/static/banner.png", - header_static: "http://localhost:4001/static/banner.png", + avatar: "http://localhost:4001/images/avi.png", + avatar_static: "http://localhost:4001/images/avi.png", + header: "http://localhost:4001/images/banner.png", + header_static: "http://localhost:4001/images/banner.png", source: %{ note: "", privacy: "public", diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 3f84e4116..5aec757bc 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -33,8 +33,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do {:ok, user} = User.update_follower_count(user) Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => user.id, @@ -65,8 +65,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do test "A user for a given other follower", %{user: user} do {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]}) {:ok, user} = User.update_follower_count(user) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => user.id, @@ -98,8 +98,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do follower = insert(:user) {:ok, follower} = User.follow(follower, user) {:ok, user} = User.update_follower_count(user) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => follower.id, @@ -131,8 +131,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do user = insert(:user) blocker = insert(:user) User.block(blocker, user) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => user.id,