From b5bc7d2d6b5650585feb6c6e34131fad5c426117 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Fri, 23 Oct 2020 00:29:56 -0400 Subject: [PATCH] use :cdn_host from env (fixes philomena-dev/philomena#54) --- lib/philomena_web/templates/layout/_flash_warnings.html.slime | 2 +- lib/philomena_web/views/layout_view.ex | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/philomena_web/templates/layout/_flash_warnings.html.slime b/lib/philomena_web/templates/layout/_flash_warnings.html.slime index 015cebe8..ad531a26 100644 --- a/lib/philomena_web/templates/layout/_flash_warnings.html.slime +++ b/lib/philomena_web/templates/layout/_flash_warnings.html.slime @@ -10,7 +10,7 @@ noscript.flash.flash--warning strong You don't appear to have Javascript enabled ' If you're using an add-on like NoScript, please allow - ' :cdn_host + => cdn_host() ' for the site to work properly. = if get_flash(@conn, :info) do .flash.flash--success = get_flash(@conn, :info) diff --git a/lib/philomena_web/views/layout_view.ex b/lib/philomena_web/views/layout_view.ex index 8caa9d4e..fd50d87b 100644 --- a/lib/philomena_web/views/layout_view.ex +++ b/lib/philomena_web/views/layout_view.ex @@ -18,6 +18,10 @@ defmodule PhilomenaWeb.LayoutView do |> Float.to_string() end + def cdn_host do + Application.get_env(:philomena, :cdn_host) + end + defp ignored_tag_list(nil), do: [] defp ignored_tag_list([]), do: [] defp ignored_tag_list([{tag, _body, _dnp_entries}]), do: [tag.id]