Merge branch 'move-backend-images' into 'develop'
authorlambda <pleromagit@rogerbraun.net>
Sat, 3 Feb 2018 13:05:20 +0000 (13:05 +0000)
committerlambda <pleromagit@rogerbraun.net>
Sat, 3 Feb 2018 13:05:20 +0000 (13:05 +0000)
Move avi.png & banner.png from /priv/static/static to /priv/static/images

See merge request pleroma/pleroma!60

lib/pleroma/user.ex
lib/pleroma/web/endpoint.ex
priv/static/images/avi.png [moved from priv/static/static/avi.png with 100% similarity]
priv/static/images/banner.png [moved from priv/static/static/banner.png with 100% similarity]
test/web/mastodon_api/account_view_test.exs
test/web/twitter_api/views/user_view_test.exs

index 6ba2b165c3dacac885f75105cae111d3e665b4a0..81cec82656ddfe90d3ddd875ae4224ddb158ab6c 100644 (file)
@@ -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
 
index 725d2ee64c91b0a07cada4762ba518cd52a4d8fb..ec88df6924cc1dad9de4bc664e28151549c37f85 100644 (file)
@@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do
     at: "/media", from: "uploads", gzip: false
   plug Plug.Static,
     at: "/", from: :pleroma,
-    only: ~w(index.html static finmoji emoji packs sounds instance sw.js)
+    only: ~w(index.html static finmoji emoji packs sounds images instance sw.js)
 
   # Code reloading can be explicitly enabled under the
   # :code_reloader configuration of your endpoint.
index 061fc2693544fa596bcd56381c9d95e10db57287..5eefa61e1fb1751f7e733aae4953da705535243d 100644 (file)
@@ -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",
index e68230a86c4224ce4f7c2ee55c4de8132e716200..d5d2f0adc87ba753c7dd2e0fcf8c251c32d4db6e 100644 (file)
@@ -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,
@@ -66,8 +66,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,
@@ -100,8 +100,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,
@@ -134,8 +134,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,