-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathteam-member-manager.blade.php
More file actions
253 lines (216 loc) · 11.5 KB
/
Copy pathteam-member-manager.blade.php
File metadata and controls
253 lines (216 loc) · 11.5 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<div>
@if (Gate::check('addTeamMember', $team))
<x-jet-section-border />
<!-- Add Team Member -->
<x-jet-form-section submit="addTeamMember">
<x-slot name="title">
{{ __('Add Team Member') }}
</x-slot>
<x-slot name="description">
{{ __('Add a new team member to your team, allowing them to collaborate with you.') }}
</x-slot>
<x-slot name="form">
<x-jet-action-message on="saved">
{{ __('Added.') }}
</x-jet-action-message>
<div class="mb-3">
{{ __('Please provide the email address of the person you would like to add to this team. The email address must be associated with an existing account.') }}
</div>
<!-- Member Email -->
<div class="mb-2 w-md-75">
<div class="form-group">
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" type="email" class="{{ $errors->has('email') ? 'is-invalid' : '' }}"
wire:model.defer="addTeamMemberForm.email" />
<x-jet-input-error for="email" />
</div>
</div>
<!-- Role -->
@if (count($this->roles) > 0)
<div class="my-3 w-md-75">
<div class="form-group">
<x-jet-label for="role" value="{{ __('Role') }}" />
<input type="hidden" class="{{ $errors->has('role') ? 'is-invalid' : '' }}">
<x-jet-input-error for="role" />
</div>
<div class="list-group">
@foreach ($this->roles as $index => $role)
<a href="#" class="list-group-item list-group-item-action{{ isset($addTeamMemberForm['role']) && $addTeamMemberForm['role'] !== $role->key ? ' text-black-50' : '' }}"
wire:click.prevent="$set('addTeamMemberForm.role', '{{ $role->key }}')">
<div>
<span class="{{ $addTeamMemberForm['role'] == $role->key ? 'font-weight-bold' : '' }}">
{{ $role->name }}
</span>
@if ($addTeamMemberForm['role'] == $role->key)
<svg class="ms-1 text-success font-weight-light" width="20" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24"><path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
@endif
</div>
<!-- Role Description -->
<div class="mt-2">
{{ $role->description }}
</div>
</a>
@endforeach
</div>
</div>
@endif
</x-slot>
<x-slot name="actions">
<x-jet-button>
{{ __('Add') }}
</x-jet-button>
</x-slot>
</x-jet-form-section>
@endif
@if ($team->teamInvitations->isNotEmpty() && Gate::check('addTeamMember', $team))
<x-jet-section-border />
<!-- Team Member Invitations -->
<x-jet-action-section>
<x-slot name="title">
{{ __('Pending Team Invitations') }}
</x-slot>
<x-slot name="description">
{{ __('These people have been invited to your team and have been sent an invitation email. They may join the team by accepting the email invitation.') }}
</x-slot>
<x-slot name="content">
@foreach ($team->teamInvitations as $invitation)
<div class="d-flex align-items-center justify-content-between mt-2 mb-2">
<div class="">{{ $invitation->email }}</div>
<div class="d-flex align-items-center">
@if (Gate::check('removeTeamMember', $team))
<!-- Cancel Team Invitation -->
<button class="btn btn-link text-danger text-decoration-none"
wire:click="cancelTeamInvitation({{ $invitation->id }})">
<div wire:loading wire:target="cancelTeamInvitation" class="spinner-border spinner-border-sm" role="status">
<span class="visually-hidden">Loading...</span>
</div>
{{ __('Cancel') }}
</button>
@endif
</div>
</div>
@endforeach
</x-slot>
</x-jet-action-section>
@endif
@if ($team->users->isNotEmpty())
<x-jet-section-border />
<!-- Manage Team Members -->
<x-jet-action-section>
<x-slot name="title">
{{ __('Team Members') }}
</x-slot>
<x-slot name="description">
{{ __('All of the people that are part of this team.') }}
</x-slot>
<!-- Team Member List -->
<x-slot name="content">
@foreach ($team->users->sortBy('name') as $user)
<div class="d-flex justify-content-between mt-2 mb-2">
<div class="d-flex align-items-center">
<div class="pr-3">
<img width="32" class="rounded-circle" src="{{ $user->profile_photo_url }}">
</div>
<span>{{ $user->name }}</span>
</div>
<div class="d-flex">
<!-- Manage Team Member Role -->
@if (Gate::check('addTeamMember', $team) && Laravel\Jetstream\Jetstream::hasRoles())
<button class="btn btn-link text-secondary" wire:click="manageRole({{ $user->id }})">
{{ Laravel\Jetstream\Jetstream::findRole($user->membership->role)->name }}
</button>
@elseif (Laravel\Jetstream\Jetstream::hasRoles())
<button class="btn btn-link text-secondary disabled text-decoration-none ms-2">
{{ Laravel\Jetstream\Jetstream::findRole($user->membership->role)->name }}
</button>
@endif
<!-- Leave Team -->
@if ($this->user->id === $user->id)
<button class="btn btn-link text-danger text-decoration-none" wire:click="$toggle('confirmingLeavingTeam')">
{{ __('Leave') }}
</button>
<!-- Remove Team Member -->
@elseif (Gate::check('removeTeamMember', $team))
<button class="btn btn-link text-danger text-decoration-none" wire:click="confirmTeamMemberRemoval('{{ $user->id }}')">
<div wire:loading wire:target="confirmTeamMemberRemoval" class="spinner-border spinner-border-sm" role="status">
<span class="visually-hidden">Loading...</span>
</div>
{{ __('Remove') }}
</button>
@endif
</div>
</div>
@endforeach
</x-slot>
</x-jet-action-section>
@endif
<!-- Role Management Modal -->
<x-jet-dialog-modal wire:model="currentlyManagingRole">
<x-slot name="title">
{{ __('Manage Role') }}
</x-slot>
<x-slot name="content">
<div class="list-group">
@foreach ($this->roles as $index => $role)
<a href="#" class="list-group-item list-group-item-action{{ $currentRole !== $role->key ? ' text-black-50' : '' }}"
wire:click.prevent="$set('currentRole', '{{ $role->key }}')">
<div>
<span class="{{ $currentRole == $role->key ? 'font-weight-bold' : '' }}">
{{ $role->name }}
</span>
@if ($currentRole == $role->key)
<svg class="ms-1 text-success font-weight-light" width="20" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24"><path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
@endif
</div>
<!-- Role Description -->
<div class="mt-2">
{{ $role->description }}
</div>
</a>
@endforeach
</div>
</x-slot>
<x-slot name="footer">
<x-jet-secondary-button wire:click="stopManagingRole" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>
<x-jet-button class="ms-2" wire:click="updateRole" wire:loading.attr="disabled">
{{ __('Save') }}
</x-jet-button>
</x-slot>
</x-jet-dialog-modal>
<!-- Leave Team Confirmation Modal -->
<x-jet-confirmation-modal wire:model="confirmingLeavingTeam">
<x-slot name="title">
{{ __('Leave Team') }}
</x-slot>
<x-slot name="content">
{{ __('Are you sure you would like to leave this team?') }}
</x-slot>
<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingLeavingTeam')" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>
<x-jet-danger-button class="ms-2" wire:click="leaveTeam" wire:loading.attr="disabled">
{{ __('Leave') }}
</x-jet-danger-button>
</x-slot>
</x-jet-confirmation-modal>
<!-- Remove Team Member Confirmation Modal -->
<x-jet-confirmation-modal wire:model="confirmingTeamMemberRemoval">
<x-slot name="title">
{{ __('Remove Team Member') }}
</x-slot>
<x-slot name="content">
{{ __('Are you sure you would like to remove this person from the team?') }}
</x-slot>
<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingTeamMemberRemoval')" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>
<x-jet-danger-button class="ms-2" wire:click="removeTeamMember" wire:loading.attr="disabled">
{{ __('Remove') }}
</x-jet-danger-button>
</x-slot>
</x-jet-confirmation-modal>
</div>