diff --git a/lib/safira_web/live/backoffice/event_live/form_component.ex b/lib/safira_web/live/backoffice/event_live/form_component.ex index 9d870077..f24832c7 100644 --- a/lib/safira_web/live/backoffice/event_live/form_component.ex +++ b/lib/safira_web/live/backoffice/event_live/form_component.ex @@ -24,7 +24,7 @@ defmodule SafiraWeb.Backoffice.EventLive.FormComponent do >
- <.field field={@form[:registrations_open]} type="checkbox" label="Registrations Open" /> + <.field field={@form[:registrations_open]} type="switch" label="Registrations Open" /> <.field field={@form[:start_time]} type="datetime-local" @@ -70,7 +70,7 @@ defmodule SafiraWeb.Backoffice.EventLive.FormComponent do {:noreply, socket |> put_flash(:info, "Event settings updated successfully") - |> push_patch(to: socket.assigns.patch)} + |> push_navigate(to: socket.assigns.navigate)} else {:error, _reason} -> {:noreply, diff --git a/lib/safira_web/live/backoffice/event_live/index.html.heex b/lib/safira_web/live/backoffice/event_live/index.html.heex index cabba574..fda2a45c 100644 --- a/lib/safira_web/live/backoffice/event_live/index.html.heex +++ b/lib/safira_web/live/backoffice/event_live/index.html.heex @@ -6,8 +6,10 @@
-

<%= gettext("Registrations open:") %> <%= @form[:registrations_open].value %>

-

<%= gettext("Start Date/Time:") %> <%= @form[:start_time].value %>

+

+ <%= gettext("Registrations Open:") %> <%= @form[:registrations_open].value %> +

+

<%= gettext("Start Date/Time:") %> <%= @form[:start_time].value %>

<.modal @@ -22,6 +24,6 @@ title="Event Settings" action={@live_action} form={@form} - patch={~p"/dashboard/event"} + navigate={~p"/dashboard/event"} /> diff --git a/lib/safira_web/router.ex b/lib/safira_web/router.ex index fd2f5239..6e1988fd 100644 --- a/lib/safira_web/router.ex +++ b/lib/safira_web/router.ex @@ -52,6 +52,8 @@ defmodule SafiraWeb.Router do scope "/", SafiraWeb do pipe_through [:browser, :redirect_if_user_is_authenticated] + post "/users/log_in", UserSessionController, :create + live_session :redirect_if_user_is_authenticated, on_mount: [{SafiraWeb.UserAuth, :redirect_if_user_is_authenticated}] do live "/users/log_in", UserLoginLive, :new @@ -61,8 +63,6 @@ defmodule SafiraWeb.Router do pipe_through :registrations_open live "/users/register", UserRegistrationLive, :new end - - post "/users/log_in", UserSessionController, :create end scope "/", SafiraWeb do