mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 18:48:06 +03:00
257fa16cdc
* Simplify Phoenix error template * Test tracking script is not included in error pages * Test tracking script is not rendered in error templates * Rename error layout and remove unnecessary HTML boilerplate * Add layout setting to errors rendered without exceptions * Add skip_plausible_tracking option to more pages
22 lines
580 B
Elixir
22 lines
580 B
Elixir
defmodule PlausibleWeb.ControllerHelpers do
|
|
import Plug.Conn
|
|
import Phoenix.Controller
|
|
|
|
def render_error(conn, status, message) do
|
|
conn
|
|
|> put_status(status)
|
|
|> put_view(PlausibleWeb.ErrorView)
|
|
|> render("#{status}.html", message: message, layout: error_layout())
|
|
end
|
|
|
|
def render_error(conn, status) do
|
|
conn
|
|
|> put_status(status)
|
|
|> put_view(PlausibleWeb.ErrorView)
|
|
|> render("#{status}.html", layout: error_layout())
|
|
end
|
|
|
|
defp error_layout,
|
|
do: Application.get_env(:plausible, PlausibleWeb.Endpoint)[:render_errors][:layout]
|
|
end
|