76 lines
2.8 KiB
Text
76 lines
2.8 KiB
Text
<!DOCTYPE html>
|
|
<html lang={Gettext.get_locale()}>
|
|
<head>
|
|
{Application.get_env(:live_debugger, :live_debugger_tags)}
|
|
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="csrf-token" content={get_csrf_token()} />
|
|
<link phx-track-static rel="icon" type="image/svg+xml" href={~p"/images/mila.svg"} />
|
|
<.live_title default="Mv" suffix=" · Phoenix Framework">
|
|
{assigns[:page_title]}
|
|
</.live_title>
|
|
<link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
|
|
<script defer phx-track-static type="text/javascript" src={~p"/assets/js/app.js"}>
|
|
</script>
|
|
<script>
|
|
(() => {
|
|
const setTheme = (theme) => {
|
|
if (theme === "system") {
|
|
localStorage.removeItem("phx:theme");
|
|
document.documentElement.removeAttribute("data-theme");
|
|
} else {
|
|
localStorage.setItem("phx:theme", theme);
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
}
|
|
};
|
|
if (!document.documentElement.hasAttribute("data-theme")) {
|
|
setTheme(localStorage.getItem("phx:theme") || "system");
|
|
}
|
|
window.addEventListener("storage", (e) => e.key === "phx:theme" && setTheme(e.newValue || "system"));
|
|
window.addEventListener("phx:set-theme", ({ detail: { theme } }) => setTheme(theme));
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div
|
|
id="flash-group-root"
|
|
aria-live="polite"
|
|
class="z-50 flex flex-col gap-2 toast toast-top toast-end"
|
|
>
|
|
<.flash id="flash-success-root" kind={:success} flash={@flash} />
|
|
<.flash id="flash-warning-root" kind={:warning} flash={@flash} />
|
|
<.flash id="flash-info-root" kind={:info} flash={@flash} />
|
|
<.flash id="flash-error-root" kind={:error} flash={@flash} />
|
|
|
|
<.flash
|
|
id="client-error-root"
|
|
kind={:error}
|
|
title={gettext("We can't find the internet")}
|
|
phx-disconnected={
|
|
show(".phx-client-error #client-error-root") |> JS.remove_attribute("hidden")
|
|
}
|
|
phx-connected={hide("#client-error-root") |> JS.set_attribute({"hidden", ""})}
|
|
hidden
|
|
>
|
|
{gettext("Attempting to reconnect")}
|
|
<.icon name="hero-arrow-path" class="ml-1 size-3 motion-safe:animate-spin" />
|
|
</.flash>
|
|
|
|
<.flash
|
|
id="server-error-root"
|
|
kind={:error}
|
|
title={gettext("Something went wrong!")}
|
|
phx-disconnected={
|
|
show(".phx-server-error #server-error-root") |> JS.remove_attribute("hidden")
|
|
}
|
|
phx-connected={hide("#server-error-root") |> JS.set_attribute({"hidden", ""})}
|
|
hidden
|
|
>
|
|
{gettext("Attempting to reconnect")}
|
|
<.icon name="hero-arrow-path" class="ml-1 size-3 motion-safe:animate-spin" />
|
|
</.flash>
|
|
</div>
|
|
{@inner_content}
|
|
</body>
|
|
</html>
|