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

44 lines
917 B
PHP
Raw Normal View History

2019-12-15 00:30:29 +00:00
<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
2019-12-15 00:30:29 +00:00
@foreach ($catalog as $o)
@if($rendered->search($o->id)) @continue @endif
@php($rendered->push($o->id))
2019-12-15 00:30:29 +00:00
<tbody>
<tr>
<td>
<input type="hidden" name="items[]" value="{{ $o->id }}">
2019-12-26 05:46:35 +00:00
@include($o->type.'.widgets.thumbnail',['o'=>$o])
2019-12-15 00:30:29 +00:00
</td>
@if (! ($d=$o->myduplicates()->get())->count())
2019-12-15 00:30:29 +00:00
<td>
No other duplicates found?
</td>
@continue
@else
@foreach($d as $item)
@if($rendered->search($item->id)) @continue @endif
@php($rendered->push($item->id))
2019-12-15 00:30:29 +00:00
<td>
<input type="hidden" name="items[]" value="{{ $item->id }}">
2019-12-26 05:46:35 +00:00
@include($item->type.'.widgets.thumbnail',['o'=>$item])
2019-12-15 00:30:29 +00:00
</td>
@endforeach
@endif
</tr>
</tbody>
@endforeach
</table>