Skip to content

Commit

Permalink
Merge pull request #291 from StanMenten99/main
Browse files Browse the repository at this point in the history
Disable submit item when not verified & Disable submit item when not verified
  • Loading branch information
Cannonb4ll authored Dec 5, 2024
2 parents 65e03df + a31cc79 commit 8d25b38
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
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

0 comments on commit 8d25b38

Please sign in to comment.