roles
This commit is contained in:
@@ -5,10 +5,12 @@
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
</x-forms.button>
|
||||
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
|
||||
wire:click="sendTestNotification">
|
||||
Send Test Notifications
|
||||
</x-forms.button>
|
||||
@if ($model->extra_attributes->discord_active)
|
||||
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
|
||||
wire:click="sendTestNotification">
|
||||
Send Test Notifications
|
||||
</x-forms.button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 xl:flex-row w-96">
|
||||
<x-forms.checkbox instantSave id="model.extra_attributes.discord_active" label="Notification Enabled" />
|
||||
|
||||
@@ -10,10 +10,12 @@
|
||||
Copy from Instance Settings
|
||||
</x-forms.button>
|
||||
@endif
|
||||
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
|
||||
wire:click="sendTestNotification">
|
||||
Send Test Notifications
|
||||
</x-forms.button>
|
||||
@if ($model->extra_attributes->smtp_active)
|
||||
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
|
||||
wire:click="sendTestNotification">
|
||||
Send Test Notifications
|
||||
</x-forms.button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex flex-col w-96">
|
||||
<x-forms.checkbox instantSave id="model.extra_attributes.smtp_active" label="Notification Enabled" />
|
||||
|
||||
6
resources/views/livewire/team/invite-link.blade.php
Normal file
6
resources/views/livewire/team/invite-link.blade.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<div>
|
||||
<form wire:submit.prevent='inviteByLink' class="flex items-center gap-2">
|
||||
<x-forms.input id="email" type="email" name="email" placeholder="Email" />
|
||||
<x-forms.button type="submit">Invite with link</x-forms.button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,17 +1,25 @@
|
||||
<tr class="border-coolgray-200">
|
||||
<th class="text-warning">{{ $member->id }}</th>
|
||||
<td>{{ $member->name }}</td>
|
||||
{{-- <th class="text-warning">{{ $member->id }}</th> --}}
|
||||
<th>{{ $member->name }}</th>
|
||||
<td>{{ $member->email }}</td>
|
||||
<td>{{ data_get($member, 'pivot.role') }}</td>
|
||||
<td>
|
||||
{{-- @if (auth()->user()->isAdmin())
|
||||
<x-forms.button wire:click="makeAdmin">Make admin</x-forms.button>
|
||||
@else
|
||||
<x-forms.button disabled>Make admin</x-forms.button>
|
||||
@endif --}}
|
||||
@if ($member->id !== auth()->user()->id)
|
||||
<x-forms.button wire:click="remove">Remove</x-forms.button>
|
||||
@else
|
||||
<x-forms.button disabled>Remove</x-forms.button>
|
||||
{{-- TODO: This is not good --}}
|
||||
@if (auth()->user()->isAdmin())
|
||||
@if ($member->id !== auth()->user()->id)
|
||||
@if (data_get($member, 'pivot.role') !== 'owner')
|
||||
@if (data_get($member, 'pivot.role') !== 'admin')
|
||||
<x-forms.button wire:click="makeAdmin">Make admin</x-forms.button>
|
||||
@else
|
||||
<x-forms.button wire:click="makeReadonly">Make readonly</x-forms.button>
|
||||
@endif
|
||||
<x-forms.button wire:click="remove">Remove</x-forms.button>
|
||||
@else
|
||||
<x-forms.button disabled>Remove</x-forms.button>
|
||||
@endif
|
||||
@else
|
||||
<x-forms.button disabled>Remove</x-forms.button>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -5,24 +5,46 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr class="text-warning border-coolgray-200">
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Role</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (session('currentTeam')->members as $member)
|
||||
@foreach (auth()->user()->currentTeam()->members->sortBy('name') as $member)
|
||||
<livewire:team.member :member="$member" :wire:key="$member->id" />
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{-- <div class="py-4">
|
||||
<h3>Invite a new member</h3>
|
||||
<form class="flex items-center gap-2">
|
||||
<x-forms.input type="email" name="email" placeholder="Email" />
|
||||
<x-forms.button>Invite</x-forms.button>
|
||||
</form>
|
||||
</div> --}}
|
||||
@if (auth()->user()->isAdmin())
|
||||
@if (!$transactional_emails_active)
|
||||
<div class="py-4">
|
||||
<h3 class="pb-4">Invite a new member</h3>
|
||||
<form class="flex items-center gap-2">
|
||||
<x-forms.input type="email" name="email" placeholder="Email" />
|
||||
<x-forms.button>Invite</x-forms.button>
|
||||
</form>
|
||||
</div>
|
||||
@else
|
||||
<div class="py-4">
|
||||
<h3 class="pb-4">Invite a new member</h3>
|
||||
<livewire:team.invite-link />
|
||||
<div class="text-sm text-warning">You need to configure SMTP settings before you can invite a new member
|
||||
via
|
||||
email.
|
||||
</div>
|
||||
</div>
|
||||
@if ($invitations->count() > 0)
|
||||
<h2 class="pb-2">Pending Invitations</h2>
|
||||
@endif
|
||||
@foreach ($invitations as $invite)
|
||||
<div class="flex gap-2 text-sm">
|
||||
<div>{{ $invite->email }}</div>
|
||||
<div>Sent: {{ $invite->created_at }}</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</x-layout>
|
||||
|
||||
Reference in New Issue
Block a user