Merge pull request 'removed unwanted file in fields' (#68) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #68
This commit was merged in pull request #68.
This commit is contained in:
@@ -1,47 +0,0 @@
|
|||||||
{{-- @props(['sticker_id']) --}}
|
|
||||||
{{-- @props([
|
|
||||||
'sticker_id',
|
|
||||||
'plant_id',
|
|
||||||
'item_characteristic_id',
|
|
||||||
])
|
|
||||||
|
|
||||||
@php
|
|
||||||
use App\Models\StickerStructureDetail;
|
|
||||||
|
|
||||||
$hasStickerId = !empty($sticker_id) && $sticker_id != 'empty';
|
|
||||||
|
|
||||||
$hasPlantAndItem = !empty($plant_id) && !empty($item_characteristic_id);
|
|
||||||
|
|
||||||
$isValid = false;
|
|
||||||
|
|
||||||
if ($hasStickerId) {
|
|
||||||
$isValid = StickerStructureDetail::where('sticker_id', $sticker_id)->exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = $isValid
|
|
||||||
? route('stickers.pdf', [
|
|
||||||
'stickerId' => $sticker_id,
|
|
||||||
// include only if present
|
|
||||||
'plant_id' => $hasPlantAndItem ? $plant_id : null,
|
|
||||||
'item_characteristic_id' => $hasPlantAndItem ? $item_characteristic_id : null,
|
|
||||||
])
|
|
||||||
: '#';
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
|
|
||||||
<div class="flex flex-col items-start space-y-2">
|
|
||||||
<a
|
|
||||||
href="{{ $url }}"
|
|
||||||
@if(!$isValid)
|
|
||||||
onclick="alert('Sticker ID not found in sticker structure preview!'); return false;"
|
|
||||||
@endif
|
|
||||||
target="_blank"
|
|
||||||
class="px-2 py-1 border
|
|
||||||
{{ $isValid
|
|
||||||
? 'border-success-500 text-success-600 hover:bg-success-50 hover:border-success-700'
|
|
||||||
: 'border-gray-300 text-gray-400 cursor-not-allowed' }}
|
|
||||||
rounded transition text-sm"
|
|
||||||
>
|
|
||||||
Show Template Preview
|
|
||||||
</a>
|
|
||||||
</div> --}}
|
|
||||||
Reference in New Issue
Block a user