Commit 61c16193 authored by lain's avatar lain
Browse files

Merge branch 'move-backend-images' into 'develop'

Move avi.png & banner.png from /priv/static/static to /priv/static/images

See merge request !60
parents 9a9766d6 c8a29315
Pipeline #617 passed with stage
in 2 minutes and 13 seconds
...@@ -29,14 +29,14 @@ defmodule Pleroma.User do ...@@ -29,14 +29,14 @@ defmodule Pleroma.User do
def avatar_url(user) do def avatar_url(user) do
case user.avatar do case user.avatar do
%{"url" => [%{"href" => href} | _]} -> href %{"url" => [%{"href" => href} | _]} -> href
_ -> "#{Web.base_url()}/static/avi.png" _ -> "#{Web.base_url()}/images/avi.png"
end end
end end
def banner_url(user) do def banner_url(user) do
case user.info["banner"] do case user.info["banner"] do
%{"url" => [%{"href" => href} | _]} -> href %{"url" => [%{"href" => href} | _]} -> href
_ -> "#{Web.base_url()}/static/banner.png" _ -> "#{Web.base_url()}/images/banner.png"
end end
end end
......
...@@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do ...@@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do
at: "/media", from: "uploads", gzip: false at: "/media", from: "uploads", gzip: false
plug Plug.Static, plug Plug.Static,
at: "/", from: :pleroma, 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 reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint. # :code_reloader configuration of your endpoint.
......
...@@ -19,10 +19,10 @@ test "Represent a user account" do ...@@ -19,10 +19,10 @@ test "Represent a user account" do
statuses_count: 5, statuses_count: 5,
note: user.bio, note: user.bio,
url: user.ap_id, url: user.ap_id,
avatar: "http://localhost:4001/static/avi.png", avatar: "http://localhost:4001/images/avi.png",
avatar_static: "http://localhost:4001/static/avi.png", avatar_static: "http://localhost:4001/images/avi.png",
header: "http://localhost:4001/static/banner.png", header: "http://localhost:4001/images/banner.png",
header_static: "http://localhost:4001/static/banner.png", header_static: "http://localhost:4001/images/banner.png",
source: %{ source: %{
note: "", note: "",
privacy: "public", privacy: "public",
......
...@@ -33,8 +33,8 @@ test "A user" do ...@@ -33,8 +33,8 @@ test "A user" do
{:ok, user} = User.update_follower_count(user) {:ok, user} = User.update_follower_count(user)
Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id)))
image = "http://localhost:4001/static/avi.png" image = "http://localhost:4001/images/avi.png"
banner = "http://localhost:4001/static/banner.png" banner = "http://localhost:4001/images/banner.png"
represented = %{ represented = %{
"id" => user.id, "id" => user.id,
...@@ -66,8 +66,8 @@ test "A user" do ...@@ -66,8 +66,8 @@ test "A user" do
test "A user for a given other follower", %{user: user} do test "A user for a given other follower", %{user: user} do
{:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]}) {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]})
{:ok, user} = User.update_follower_count(user) {:ok, user} = User.update_follower_count(user)
image = "http://localhost:4001/static/avi.png" image = "http://localhost:4001/images/avi.png"
banner = "http://localhost:4001/static/banner.png" banner = "http://localhost:4001/images/banner.png"
represented = %{ represented = %{
"id" => user.id, "id" => user.id,
...@@ -100,8 +100,8 @@ test "A user that follows you", %{user: user} do ...@@ -100,8 +100,8 @@ test "A user that follows you", %{user: user} do
follower = insert(:user) follower = insert(:user)
{:ok, follower} = User.follow(follower, user) {:ok, follower} = User.follow(follower, user)
{:ok, user} = User.update_follower_count(user) {:ok, user} = User.update_follower_count(user)
image = "http://localhost:4001/static/avi.png" image = "http://localhost:4001/images/avi.png"
banner = "http://localhost:4001/static/banner.png" banner = "http://localhost:4001/images/banner.png"
represented = %{ represented = %{
"id" => follower.id, "id" => follower.id,
...@@ -134,8 +134,8 @@ test "A blocked user for the blocker", %{user: user} do ...@@ -134,8 +134,8 @@ test "A blocked user for the blocker", %{user: user} do
user = insert(:user) user = insert(:user)
blocker = insert(:user) blocker = insert(:user)
User.block(blocker, user) User.block(blocker, user)
image = "http://localhost:4001/static/avi.png" image = "http://localhost:4001/images/avi.png"
banner = "http://localhost:4001/static/banner.png" banner = "http://localhost:4001/images/banner.png"
represented = %{ represented = %{
"id" => user.id, "id" => user.id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment