Skip to content

Commit

Permalink
chore: suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ruioliveira02 committed Nov 27, 2024
1 parent 9d50003 commit 276ed74
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/safira_web/live/backoffice/event_live/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule SafiraWeb.Backoffice.EventLive.FormComponent do
>
<div class="flex flex-col md:flex-row w-full gap-4">
<div class="w-full space-y-2">
<.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"
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions lib/safira_web/live/backoffice/event_live/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
</:actions>

<div class="py-4">
<p><b><%= gettext("Registrations open:") %></b> <%= @form[:registrations_open].value %></p>
<p><b><%= gettext("Start Date/Time:") %></b> <%= @form[:start_time].value %></p>
<p class="my-1">
<b><%= gettext("Registrations Open:") %></b> <%= @form[:registrations_open].value %>
</p>
<p class="my-1"><b><%= gettext("Start Date/Time:") %></b> <%= @form[:start_time].value %></p>
</div>
</.page>
<.modal
Expand All @@ -22,6 +24,6 @@
title="Event Settings"
action={@live_action}
form={@form}
patch={~p"/dashboard/event"}
navigate={~p"/dashboard/event"}
/>
</.modal>
4 changes: 2 additions & 2 deletions lib/safira_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 276ed74

Please sign in to comment.