From d0c850e239919de21af821a2d4586bc0f4fd1e52 Mon Sep 17 00:00:00 2001 From: Jerod Santo Date: Fri, 1 Sep 2023 15:17:27 -0500 Subject: [PATCH] A few more static asset URL reference fixes --- assets/app/components/playbar.scss | 9 +++++++++ lib/changelog_web/meta/image.ex | 3 ++- .../templates/episode/_play_bar.html.eex | 11 ++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/assets/app/components/playbar.scss b/assets/app/components/playbar.scss index 18f61c1d5e..67132886dc 100644 --- a/assets/app/components/playbar.scss +++ b/assets/app/components/playbar.scss @@ -5,3 +5,12 @@ background-image: url("../images/icons/icon-pause.svg"); background-size: 11px 20px !important; } +.playbar_discuss { + background-image: url("../images/icons/icon-chat.svg"); +} +.playbar_subscribe { + background-image: url("../images/icons/icon-subscribe.svg"); +} +.playbar_share { + background-image: url("../images/icons/icon-share.svg"); +} diff --git a/lib/changelog_web/meta/image.ex b/lib/changelog_web/meta/image.ex index 2c9d4696df..addefb0b70 100644 --- a/lib/changelog_web/meta/image.ex +++ b/lib/changelog_web/meta/image.ex @@ -2,6 +2,7 @@ defmodule ChangelogWeb.Meta.Image do use ChangelogWeb, :verified_routes alias ChangelogWeb.{ + Endpoint, Meta, NewsItemView, NewsSourceView, @@ -72,7 +73,7 @@ defmodule ChangelogWeb.Meta.Image do defp podcasts_image, do: static_image(~w[images share all-podcasts.png]) defp post_image(post), do: PostView.image_url(post, :large) defp source_image(source), do: NewsSourceView.icon_url(source, :large) - defp static_image(parts), do: url(~p"/#{parts}") + defp static_image(parts), do: static_url(Endpoint, ~p"/#{parts}") defp topic_image(topic), do: TopicView.icon_url(topic, :large) defp summary_image, do: static_image(~w[images share twitter-sidewide-summary.png]) diff --git a/lib/changelog_web/templates/episode/_play_bar.html.eex b/lib/changelog_web/templates/episode/_play_bar.html.eex index aac111b2c6..3e2581fcc2 100644 --- a/lib/changelog_web/templates/episode/_play_bar.html.eex +++ b/lib/changelog_web/templates/episode/_play_bar.html.eex @@ -13,22 +13,19 @@ <%= link("Discuss", title: "Discuss this Episode", to: Routes.news_item_path(@conn, :show, NewsItem.slug(@item)), - class: "toolbar_item toolbar_item--button", - style: "background-image: url('#{~p"/images/icons/icon-chat.svg"}')") %> + class: "toolbar_item toolbar_item--button playbar_discuss") %> <% end %> <%= link("Subscribe", title: "Subscribe to Podcast", to: {:javascript, "void(0);"}, - class: "toolbar_item toolbar_item--button has-tooltip", - style: "background-image: url('#{~p"/images/icons/icon-subscribe.svg"}')") %> + class: "toolbar_item toolbar_item--button has-tooltip playbar_subscribe") %> <%= render(PodcastView, "_subscribe_tooltip.html", conn: @conn, podcast: @episode.podcast) %> <%= link("Share", title: "Share this Episode", to: {:javascript, "void(0);"}, - class: "toolbar_item toolbar_item--button", - data: [share: Routes.episode_path(@conn, :share, @episode.podcast.slug, @episode.slug)], - style: "background-image: url('#{~p"/images/icons/icon-share.svg"}')") %> + class: "toolbar_item toolbar_item--button playbar_share", + data: [share: Routes.episode_path(@conn, :share, @episode.podcast.slug, @episode.slug)]) %>