-
Notifications
You must be signed in to change notification settings - Fork 8
/
merge.sface
52 lines (48 loc) · 1.86 KB
/
merge.sface
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
<div class="component-organisation-index container">
<h1>
{gettext("Merge Organisations")}
</h1>
<Form for={:merge} submit="merge" opts={autocomplete: "off", id: "organisation-merge-form"}>
<div class="d-flex justify-content-center mt-5">
<button type="button" :on-click="switch" class="btn btn-outline-primary">
<span class="oi oi-loop-circular" />
{pgettext("Organisation Merge", "Switch")}
</button>
</div>
<div class="d-flex mt-5 justify-content-between">
<Field class="form-group flex-grow-1" name={:delete}>
<Label>{pgettext("Organisation Merge", "Merge")}</Label>
<HygeiaWeb.OrganisationLive.Choose
id="delete_uuid"
change="change_delete"
value={unless is_nil(@delete), do: @delete.uuid}
/>
<ErrorTag class="d-block invalid-feedback" />
</Field>
<span class="oi oi-arrow-right align-self-center p-4 lead" />
<Field class="form-group flex-grow-1" name={:into}>
<Label>{pgettext("Organisation Merge", "Into")}</Label>
<HygeiaWeb.OrganisationLive.Choose
id="into_uuid"
change="change_into"
value={unless is_nil(@into), do: @into.uuid}
/>
<ErrorTag class="d-block invalid-feedback" />
<span class="d-block invalid-feedback" :if={if is_nil(@into), do: false, else: @delete == @into}>
{gettext(~S("Merge" and "Into" must not be the same))}
</span>
</Field>
</div>
<div class="d-flex justify-content-center mt-5">
<button
class="btn btn-primary mt-4 btn-lg"
type="submit"
data-confirm={gettext("Are you sure?")}
phx-disable-with={gettext("Saving...")}
disabled={is_nil(@delete) or is_nil(@into) or @delete == @into}
>
{pgettext("Organisation Merge", "Merge")}
</button>
</div>
</Form>
</div>