Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable submit item when not verified & Disable submit item when not verified #291

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Http\Controllers\Controller;
use App\SocialProviders\SsoProvider;
use App\Providers\RouteServiceProvider;
use Illuminate\Support\Facades\Session;
use Laravel\Socialite\Facades\Socialite;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

Expand Down Expand Up @@ -98,8 +99,12 @@ public function handleProviderCallback(Request $request, $provider = 'sso')
return redirect()->route('home');
}

public function showLoginForm()
public function showLoginForm(Request $request)
{
if ($request->has('intended')) {
Session::put('url.intended', $request->input('intended'));
}

if (SsoProvider::isForced()) {
return to_route('oauth.login');
}
Expand Down
4 changes: 3 additions & 1 deletion lang/en/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
'edited' => 'Edited',
'edit-comment' => 'Edit comment',
'comment-updated' => 'Comment updated',
'activity' => 'Activity'
'activity' => 'Activity',
'login-to-comment' => 'Log in to comment',
'verify-email-to-comment' => 'Verify your email address before commenting. See email for instructions.',
];
2 changes: 2 additions & 0 deletions lang/nl/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
'edit-comment' => 'Opmerking bewerken',
'comment-updated' => 'Opmerking aangepast',
'activity' => 'Activiteit',
'login-to-comment' => 'Log in om een opmerking te plaatsen',
'verify-email-to-comment' => 'Verifieer je e-mailadres voordat je opmerkingen plaatst. Zie mail voor instructies.',
];
18 changes: 14 additions & 4 deletions resources/views/livewire/item/comments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@

@if($reply === null && !$item->board?->block_comments)
<form wire:submit="submit" class="space-y-4 mt-4">
{{ $this->form }}
@if(auth()->check() && auth()->user()->hasVerifiedEmail())
{{ $this->form }}

<x-filament::button wire:click="submit">
{{ trans('comments.submit') }}
</x-filament::button>
<x-filament::button wire:click="submit">
{{ trans('comments.submit') }}
</x-filament::button>
@elseif(auth()->check() && !auth()->user()->hasVerifiedEmail())
<div class="text-primary-500 mt-4">
{{ trans('comments.verify-email-to-comment') }}
</div>
@else
<div class="text-primary-500 hover:text-primary-700 mt-4">
<a href="{{ route('login', ['intended' => url()->full()]) }}">{{ trans('comments.login-to-comment') }}</a>
</div>
@endif
</form>
@endif
</div>
Expand Down
Loading