From a8dbdadb9057e3b973ad2a30f1f57e33e9eaabc6 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Sat, 31 Aug 2024 17:02:54 +0500 Subject: [PATCH] fix: reset esbuild config --- assets/js/app.js | 2 ++ config/config.exs | 2 +- lib/comfycamp_web/components/layouts/root.html.heex | 5 ----- lib/comfycamp_web/controllers/admin_page_controller.ex | 4 ++-- lib/comfycamp_web/controllers/home_controller.ex | 6 +++--- lib/comfycamp_web/controllers/notes_editor_controller.ex | 4 ++-- lib/comfycamp_web/controllers/user_editor_controller.ex | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 9342d26..68e3f4f 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -22,6 +22,8 @@ import {Socket} from "phoenix" import {LiveSocket} from "phoenix_live_view" import topbar from "../vendor/topbar" import "../css/core/app.css" +import "../css/admin.css" +import "../css/home.css" let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") let liveSocket = new LiveSocket("/live", Socket, { diff --git a/config/config.exs b/config/config.exs index fc85d8b..8bcbdc1 100644 --- a/config/config.exs +++ b/config/config.exs @@ -38,7 +38,7 @@ config :esbuild, version: "0.17.11", comfycamp: [ args: - ~w(js/app.js css/home.css css/admin.css --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*), + ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*), cd: Path.expand("../assets", __DIR__), env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} ] diff --git a/lib/comfycamp_web/components/layouts/root.html.heex b/lib/comfycamp_web/components/layouts/root.html.heex index a78889c..41749af 100644 --- a/lib/comfycamp_web/components/layouts/root.html.heex +++ b/lib/comfycamp_web/components/layouts/root.html.heex @@ -15,11 +15,6 @@ } /> - <%= if assigns[:stylesheets] do %> - <%= for stylesheet <- @stylesheets do %> - - <% end %> - <% end %> put_layout(html: :admin) - |> render(:home, page_title: "Админка", stylesheets: ["/assets/admin.css"]) + |> render(:home, page_title: "Админка") end def services(conn, _params) do conn |> put_layout(html: :admin) - |> render(:home, page_title: "Админка", stylesheets: ["/assets/admin.css"]) + |> render(:home, page_title: "Админка") end end diff --git a/lib/comfycamp_web/controllers/home_controller.ex b/lib/comfycamp_web/controllers/home_controller.ex index 2b348fb..a6631ae 100644 --- a/lib/comfycamp_web/controllers/home_controller.ex +++ b/lib/comfycamp_web/controllers/home_controller.ex @@ -2,14 +2,14 @@ defmodule ComfycampWeb.HomeController do use ComfycampWeb, :controller def index(conn, _params) do - render(conn, :index, page_title: "Главная", stylesheets: ["/assets/home.css"]) + render(conn, :index, page_title: "Главная") end def mastodon(conn, _params) do - render(conn, :mastodon, page_title: "Mastodon", stylesheets: ["/assets/home.css"]) + render(conn, :mastodon, page_title: "Mastodon") end def nextcloud(conn, _params) do - render(conn, :nextcloud, page_title: "Nextcloud", stylesheets: ["/assets/home.css"]) + render(conn, :nextcloud, page_title: "Nextcloud") end end diff --git a/lib/comfycamp_web/controllers/notes_editor_controller.ex b/lib/comfycamp_web/controllers/notes_editor_controller.ex index 2dca9a4..70a9809 100644 --- a/lib/comfycamp_web/controllers/notes_editor_controller.ex +++ b/lib/comfycamp_web/controllers/notes_editor_controller.ex @@ -9,7 +9,7 @@ defmodule ComfycampWeb.NotesEditorController do conn |> put_layout(html: :admin) - |> render(:index, page_title: "Заметки", notes: notes, stylesheets: ["/assets/admin.css"]) + |> render(:index, page_title: "Заметки", notes: notes) end def new(conn, _params) do @@ -83,7 +83,7 @@ defmodule ComfycampWeb.NotesEditorController do conn |> put_layout(html: :admin) - |> render(:show, page_title: "Заметка", note: note, stylesheets: ["/assets/admin.css"]) + |> render(:show, page_title: "Заметка", note: note) end def delete(conn, %{"id" => id}) do diff --git a/lib/comfycamp_web/controllers/user_editor_controller.ex b/lib/comfycamp_web/controllers/user_editor_controller.ex index c154378..3c60b77 100644 --- a/lib/comfycamp_web/controllers/user_editor_controller.ex +++ b/lib/comfycamp_web/controllers/user_editor_controller.ex @@ -19,7 +19,7 @@ defmodule ComfycampWeb.UserEditorController do conn |> put_layout(html: :admin) - |> render(:show, page_title: user.email, user: user, stylesheets: ["/assets/admin.css"]) + |> render(:show, page_title: user.email, user: user) end def approve(conn, %{"id" => id}) do