Update deps and fix some front-end stuff

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-03-17 19:06:46 +01:00
parent 8984bd7636
commit 59944603b7
17 changed files with 668 additions and 559 deletions

View File

@@ -48,8 +48,7 @@ defmodule Mobilizon.Web.Endpoint do
at: "/",
from: {:mobilizon, "priv/static"},
gzip: false,
only:
~w(index.html manifest.json service-worker.js css fonts img js favicon.ico robots.txt assets),
only: Mobilizon.Web.static_paths(),
only_matching: ["precache-manifest"]
)

View File

@@ -17,12 +17,17 @@ defmodule Mobilizon.Web do
and import those modules here.
"""
def static_paths,
do:
~w(index.html manifest.json service-worker.js css fonts img js favicon.ico robots.txt assets)
def controller do
quote do
use Phoenix.Controller, namespace: Mobilizon.Web
import Plug.Conn
import Mobilizon.Web.Gettext
alias Mobilizon.Web.Router.Helpers, as: Routes
unquote(verified_routes())
end
end
@@ -40,6 +45,7 @@ defmodule Mobilizon.Web do
import Mobilizon.Web.ErrorHelpers
import Mobilizon.Web.Gettext
alias Mobilizon.Web.Router.Helpers, as: Routes
unquote(verified_routes())
end
end
@@ -64,4 +70,13 @@ defmodule Mobilizon.Web do
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
def verified_routes do
quote do
use Phoenix.VerifiedRoutes,
endpoint: Mobilizon.Web.Endpoint,
router: Mobilizon.Web.Router,
statics: Mobilizon.Web.static_paths()
end
end
end