diff --git a/lib/ret_web/controllers/file_controller.ex b/lib/ret_web/controllers/file_controller.ex index 7ac6b1938..3ffd41b03 100644 --- a/lib/ret_web/controllers/file_controller.ex +++ b/lib/ret_web/controllers/file_controller.ex @@ -17,7 +17,7 @@ defmodule RetWeb.FileController do def handle(conn, %{"id" => <>, "token" => token}, :show) do case Storage.fetch(uuid, token) do - {:ok, %{"content_type" => content_type}, _stream} -> + {:ok, %{"content_type" => content_type, "content_length" => content_length}, _stream} -> image_url = uuid |> Ret.Storage.uri_for(content_type) @@ -27,11 +27,18 @@ defmodule RetWeb.FileController do app_name = AppConfig.get_cached_config_value("translations|en|app-full-name") || AppConfig.get_cached_config_value("translations|en|app-name") + title = "Photo taken in #{app_name} immersive space" + config = AppConfig.get_config() conn |> render("show.html", image_url: image_url, - app_name: app_name + content_type: content_type |> RetWeb.ContentType.sanitize_content_type(), + content_length: content_length, + title: title, + translations: config["translations"]["en"], + images: config["images"], + root_url: RetWeb.Endpoint.url() ) {:error, :not_found} -> diff --git a/lib/ret_web/controllers/page_controller.ex b/lib/ret_web/controllers/page_controller.ex index 04693f20a..e339de4df 100644 --- a/lib/ret_web/controllers/page_controller.ex +++ b/lib/ret_web/controllers/page_controller.ex @@ -99,8 +99,10 @@ defmodule RetWeb.PageController do avatar_meta_tags = Phoenix.View.render_to_string(RetWeb.PageView, "avatar-meta.html", avatar: avatar, + description: "“#{avatar.name}” is an avatar you can use in the #{app_config["translations"]["en"]["app-name"]} immersive space.", ret_meta: Ret.Meta.get_meta(include_repo: false), translations: app_config["translations"]["en"], + root_url: RetWeb.Endpoint.url(), app_config_script: {:safe, app_config_script |> with_script_tags}, extra_script: {:safe, get_extra_script(:avatar) |> with_script_tags}, extra_html: {:safe, get_extra_html(:avatar) || ""} @@ -135,6 +137,7 @@ defmodule RetWeb.PageController do "index-meta.html", root_url: RetWeb.Endpoint.url(), translations: app_config["translations"]["en"], + images: app_config["images"], app_config_script: {:safe, app_config_script |> with_script_tags}, extra_script: {:safe, get_extra_script(:index) |> with_script_tags}, extra_html: {:safe, get_extra_html(:index) || ""} @@ -190,7 +193,7 @@ defmodule RetWeb.PageController do |> String.split("/") |> Enum.at(0) |> Avatar.avatar_or_avatar_listing_by_sid() - |> Repo.preload([:thumbnail_owned_file]) + |> Repo.preload([:thumbnail_owned_file, :gltf_owned_file]) |> render_avatar_content(conn) end diff --git a/lib/ret_web/templates/file/show.html.eex b/lib/ret_web/templates/file/show.html.eex index 033b34841..430b84d16 100644 --- a/lib/ret_web/templates/file/show.html.eex +++ b/lib/ret_web/templates/file/show.html.eex @@ -4,17 +4,40 @@ + + - - + + "> + - + + "> - Photo taken in <%= @app_name %> + <%= @title %>