fix: reset esbuild config

This commit is contained in:
Ivan R. 2024-08-31 17:02:54 +05:00
parent cdccbb1919
commit a8dbdadb90
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
7 changed files with 11 additions and 14 deletions

View file

@ -22,6 +22,8 @@ import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view" import {LiveSocket} from "phoenix_live_view"
import topbar from "../vendor/topbar" import topbar from "../vendor/topbar"
import "../css/core/app.css" import "../css/core/app.css"
import "../css/admin.css"
import "../css/home.css"
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, { let liveSocket = new LiveSocket("/live", Socket, {

View file

@ -38,7 +38,7 @@ config :esbuild,
version: "0.17.11", version: "0.17.11",
comfycamp: [ comfycamp: [
args: 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__), cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
] ]

View file

@ -15,11 +15,6 @@
} }
/> />
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} /> <link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
<%= if assigns[:stylesheets] do %>
<%= for stylesheet <- @stylesheets do %>
<link phx-track-static rel="stylesheet" href={stylesheet} />
<% end %>
<% end %>
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}> <script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
</script> </script>
<link <link

View file

@ -4,12 +4,12 @@ defmodule ComfycampWeb.AdminPageController do
def home(conn, _params) do def home(conn, _params) do
conn conn
|> put_layout(html: :admin) |> put_layout(html: :admin)
|> render(:home, page_title: "Админка", stylesheets: ["/assets/admin.css"]) |> render(:home, page_title: "Админка")
end end
def services(conn, _params) do def services(conn, _params) do
conn conn
|> put_layout(html: :admin) |> put_layout(html: :admin)
|> render(:home, page_title: "Админка", stylesheets: ["/assets/admin.css"]) |> render(:home, page_title: "Админка")
end end
end end

View file

@ -2,14 +2,14 @@ defmodule ComfycampWeb.HomeController do
use ComfycampWeb, :controller use ComfycampWeb, :controller
def index(conn, _params) do def index(conn, _params) do
render(conn, :index, page_title: "Главная", stylesheets: ["/assets/home.css"]) render(conn, :index, page_title: "Главная")
end end
def mastodon(conn, _params) do def mastodon(conn, _params) do
render(conn, :mastodon, page_title: "Mastodon", stylesheets: ["/assets/home.css"]) render(conn, :mastodon, page_title: "Mastodon")
end end
def nextcloud(conn, _params) do def nextcloud(conn, _params) do
render(conn, :nextcloud, page_title: "Nextcloud", stylesheets: ["/assets/home.css"]) render(conn, :nextcloud, page_title: "Nextcloud")
end end
end end

View file

@ -9,7 +9,7 @@ defmodule ComfycampWeb.NotesEditorController do
conn conn
|> put_layout(html: :admin) |> put_layout(html: :admin)
|> render(:index, page_title: "Заметки", notes: notes, stylesheets: ["/assets/admin.css"]) |> render(:index, page_title: "Заметки", notes: notes)
end end
def new(conn, _params) do def new(conn, _params) do
@ -83,7 +83,7 @@ defmodule ComfycampWeb.NotesEditorController do
conn conn
|> put_layout(html: :admin) |> put_layout(html: :admin)
|> render(:show, page_title: "Заметка", note: note, stylesheets: ["/assets/admin.css"]) |> render(:show, page_title: "Заметка", note: note)
end end
def delete(conn, %{"id" => id}) do def delete(conn, %{"id" => id}) do

View file

@ -19,7 +19,7 @@ defmodule ComfycampWeb.UserEditorController do
conn conn
|> put_layout(html: :admin) |> 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 end
def approve(conn, %{"id" => id}) do def approve(conn, %{"id" => id}) do