-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathedit.html.heex
More file actions
62 lines (61 loc) · 2.25 KB
/
edit.html.heex
File metadata and controls
62 lines (61 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<.page title={
if @live_action in [:new] do
gettext("New Partner")
else
gettext("Edit %{partner_name}", partner_name: @partner.name)
end
}>
<:actions>
<%= if @live_action in [:edit] do %>
<div class="flex space-x-4">
<%= if !@partner.archived do %>
<.button color={:white} icon="hero-archive-box" phx-click="set-action" phx-value-action={:archive}>
<%= gettext("Archive") %>
</.button>
<.button color={:white} icon="hero-trash" disabled title={gettext("You can only delete a department after it has been archived.")}>
<%= gettext("Delete") %>
</.button>
<% else %>
<.button color={:white} icon="hero-archive-box-x-mark" phx-click="set-action" phx-value-action={:unarchive}>
<%= gettext("Unarchive") %>
</.button>
<.button color={:white} icon="hero-trash" phx-click="set-action" phx-value-action={:delete}>
<%= gettext("Delete") %>
</.button>
<% end %>
</div>
<% end %>
</:actions>
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
<.live_component module={AtomicWeb.PartnerLive.FormComponent} organization={@current_organization} id={@partner.id || :new} title={@page_title} action={@live_action} partner={@partner} return_to={~p"/organizations/#{@current_organization}/partners"} />
</div>
</.page>
<.modal :if={@action} id="action-modal" show on_cancel={JS.push("clear-action")}>
<div class="flex flex-col">
<h1 class="flex-1 select-none truncate text-lg font-semibold text-zinc-900">
<%= display_action_goal_confirm_title(@action) %>
</h1>
<p class="mt-4">
<%= display_action_goal_confirm_description(@action, @partner) %>
</p>
<div class="mt-8 flex flex-row">
<.button phx-click="clear-action" class="mr-2" size={:lg} icon="hero-x-circle" color={:white} full_width><%= gettext("Cancel") %></.button>
<.button
phx-click="confirm-action"
class="mr-2"
size={:lg}
icon="hero-check-circle"
color={
if @action == :delete do
:danger
else
:white
end
}
full_width
>
<%= gettext("Confirm") %>
</.button>
</div>
</div>
</.modal>