-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathteam_general.html.heex
More file actions
139 lines (132 loc) · 4 KB
/
team_general.html.heex
File metadata and controls
139 lines (132 loc) · 4 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<.settings_tiles>
<.tile docs="users-roles">
<:title>
<a id="update-name#changing-the-name-of-a-team">Team name</a>
</:title>
<:subtitle>
Change the name of your team.
</:subtitle>
<.form
:let={f}
action={Routes.settings_path(@conn, :update_team_name)}
for={@team_name_changeset}
method="post"
>
<.input
readonly={@current_team_role not in [:owner, :admin]}
type="text"
field={f[:name]}
label="Name"
width="w-1/2"
mt?={false}
/>
<.button type="submit" disabled={@current_team_role not in [:owner, :admin]}>
Change name
</.button>
</.form>
</.tile>
<.tile
docs="users-roles#managing-team-member-roles"
current_role={@current_team_role}
current_team={@current_team}
feature_mod={Plausible.Billing.Feature.Teams}
>
<:title>
<a id="team-members">Team members</a>
</:title>
<:subtitle>
Add or remove team members and adjust their roles.
</:subtitle>
{live_render(@conn, PlausibleWeb.Live.TeamManagement,
id: "team-setup",
session: %{"mode" => "team-management"}
)}
</.tile>
<.tile :if={@current_team_role == :owner} docs="2fa#require-all-team-members-to-enable-2fa">
<:title>
<a id="force-2fa">Force Two-Factor Authentication (2FA)</a>
</:title>
<:subtitle>
Increase account security by requiring all team members to enable 2FA.
</:subtitle>
<div
:if={@force_2fa_enabled? and @current_team_role == :owner}
id="disable-force-2fa"
x-data="{disableTeamForce2FAOpen: false}"
>
<.form
action={Routes.settings_path(@conn, :disable_team_force_2fa)}
for={@conn.params}
method="post"
>
<.button
theme="danger"
x-on:click="disableTeamForce2FAOpen = true; $refs.disableTeamForce2FAPassword.value = ''"
mt?={false}
>
Stop Forcing 2FA
</.button>
<PlausibleWeb.Components.TwoFactor.modal
id="disable-force-2fa-modal"
state_param="disableTeamForce2FAOpen"
form_data={@conn.params}
form_target={Routes.settings_path(@conn, :disable_team_force_2fa)}
title="Stop enforcing 2FA?"
>
<:icon>
<Heroicons.shield_exclamation class="h-6 w-6" />
</:icon>
<:buttons>
<.button type="submit" class="w-full sm:w-auto">
Stop enforcing 2FA
</.button>
</:buttons>
<div class="text-sm mt-2">
This will remove the 2FA requirement for all team members.
</div>
<div class="text-sm mt-2">
Enter your password to stop enforcing 2FA.
</div>
<div class="mt-3">
<.input
type="password"
id="disable_team_force_2fa_password"
name="password"
value=""
placeholder="Enter password"
x-ref="disableTeamForce2FAPassword"
/>
</div>
</PlausibleWeb.Components.TwoFactor.modal>
</.form>
</div>
<div :if={not @force_2fa_enabled? and @current_team_role == :owner} id="enable-force-2fa">
<.form
action={Routes.settings_path(@conn, :enable_team_force_2fa)}
for={@conn.params}
method="post"
>
<.button
data-confirm="All team members, including you, will need to set up 2FA. Are you sure you want to enforce it?"
type="submit"
mt?={false}
>
Enforce 2FA
</.button>
</.form>
</div>
</.tile>
<.tile docs="users-roles#leaving-team">
<:title>Leave team</:title>
<:subtitle>Remove yourself from this team as a member.</:subtitle>
<.button_link
data-confirm="Are you sure you want to leave this team?"
href={Routes.settings_path(@conn, :leave_team)}
method="post"
theme="danger"
mt?={false}
>
Leave team
</.button_link>
</.tile>
</.settings_tiles>