Skip to content

Commit

Permalink
fix: add back has_image checks and also change honeypot to return for…
Browse files Browse the repository at this point in the history
… better UX
  • Loading branch information
ScuffedNewt committed Feb 9, 2024
1 parent cb7afdc commit fb9f9b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/Helpers/HoneypotHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class HoneypotHandler implements SpamResponder {
public function respond(Request $request, Closure $next) {
return response('Your request has activated anti-spam measures.
If you believe this to be in error, please go back, then wait a few seconds before submitting the form again.');
flash('Woah there! Your request has activated anti-spam measures. If you believe this to be in error, please wait a few seconds before submitting the form again.')->warning();
return redirect()->back();
}
}
8 changes: 5 additions & 3 deletions resources/views/shops/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<div class="row shops-row">
@foreach ($shops as $shop)
<div class="col-md-3 col-6 mb-3 text-center">
<div class="shop-image">
<a href="{{ $shop->url }}"><img src="{{ $shop->shopImageUrl }}" alt="{{ $shop->name }}" /></a>
</div>
@if ($shop->has_image)
<div class="shop-image">
<a href="{{ $shop->url }}"><img src="{{ $shop->shopImageUrl }}" alt="{{ $shop->name }}" /></a>
</div>
@endif
<div class="shop-name mt-1">
<a href="{{ $shop->url }}" class="h5 mb-0">{{ $shop->name }}</a>
</div>
Expand Down
12 changes: 7 additions & 5 deletions resources/views/user/inventory.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
<div class="row mb-3">
@foreach ($chunk as $itemId => $stack)
<div class="col-sm-3 col-6 text-center inventory-item" data-id="{{ $stack->first()->pivot->id }}" data-name="{{ $user->name }}'s {{ $stack->first()->name }}">
<div class="mb-1">
<a href="#" class="inventory-stack">
<img src="{{ $stack->first()->imageUrl }}" alt="{{ $stack->first()->name }}" />
</a>
</div>
@if ($stack->first()->has_image)
<div class="mb-1">
<a href="#" class="inventory-stack">
<img src="{{ $stack->first()->imageUrl }}" alt="{{ $stack->first()->name }}" />
</a>
</div>
@endif
<div>
<a href="#" class="inventory-stack inventory-stack-name">
{{ $stack->first()->name }} x{{ $stack->sum('pivot.count') }}
Expand Down

0 comments on commit fb9f9b2

Please sign in to comment.