photo/resources/views/catalog/widgets/duplicates.blade.php

44 lines
917 B
PHP

<table class="table">
<thead>
<tr>
<th class="w-50">Remove</th>
<th class="w-50">Source</th>
</tr>
</thead>
@php
// Remember what we have rendered
$rendered = collect();
@endphp
@foreach ($catalog as $o)
@if($rendered->search($o->id)) @continue @endif
@php($rendered->push($o->id))
<tbody>
<tr>
<td>
<input type="hidden" name="items[]" value="{{ $o->id }}">
@include($o->type.'.widgets.thumbnail',['o'=>$o])
</td>
@if (! ($d=$o->myduplicates()->get())->count())
<td>
No other duplicates found?
</td>
@continue
@else
@foreach($d as $item)
@if($rendered->search($item->id)) @continue @endif
@php($rendered->push($item->id))
<td>
<input type="hidden" name="items[]" value="{{ $item->id }}">
@include($item->type.'.widgets.thumbnail',['o'=>$item])
</td>
@endforeach
@endif
</tr>
</tbody>
@endforeach
</table>