Skip to content

Commit

Permalink
feat: improve announcements form
Browse files Browse the repository at this point in the history
  • Loading branch information
AfonsoMartins26 committed Jun 20, 2024
1 parent f40ebd0 commit dfa2b1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/atomic_web/live/announcement_live/edit.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<%= gettext("Delete") %>
</.button>
</:actions>
<.live_component module={AtomicWeb.AnnouncementLive.FormComponent} id={@announcement.id} organization={@current_organization} title={@page_title} action={@live_action} announcement={@announcement} return_to={Routes.announcement_show_path(@socket, :show, @announcement)} />
<div class="pt-4 px-4">
<.live_component module={AtomicWeb.AnnouncementLive.FormComponent} id={@announcement.id} organization={@current_organization} title={@page_title} action={@live_action} announcement={@announcement} return_to={Routes.announcement_show_path(@socket, :show, @announcement)} />
</div>
</.page>
2 changes: 1 addition & 1 deletion lib/atomic_web/live/announcement_live/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule AtomicWeb.AnnouncementLive.FormComponent do
end
end

defp save_announcement(socket, :announcement, announcement_params) do
defp save_announcement(socket, :new, announcement_params) do
announcement_params =
Map.put(announcement_params, "organization_id", socket.assigns.organization.id)

Expand Down
4 changes: 3 additions & 1 deletion lib/atomic_web/live/announcement_live/new.html.heex
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<.page title={gettext("New Announcement")}>
<.live_component module={AtomicWeb.AnnouncementLive.FormComponent} id={:new} organization={@current_organization} title={@page_title} action={@live_action} announcement={@announcement} return_to={Routes.announcement_index_path(@socket, :index)} />
<div class="pt-4 px-4">
<.live_component module={AtomicWeb.AnnouncementLive.FormComponent} id={:new} organization={@current_organization} title={@page_title} action={@live_action} announcement={@announcement} return_to={Routes.announcement_index_path(@socket, :index)} />
</div>
</.page>

0 comments on commit dfa2b1c

Please sign in to comment.