More Laravel/AdminLTE updates

This commit is contained in:
Deon George
2019-11-23 12:51:30 +11:00
parent 6a17fd3716
commit bafc34b1c0
26 changed files with 410 additions and 565 deletions

View File

@@ -1,82 +1,80 @@
@extends('adminlte::layouts.app')
<?php $data = [
'ID'=>['id','idlink'],
'Signature'=>['signature','signature'],
'File Signature'=>['file_signature','file_signature'],
'Date Created'=>['date_created','datecreatedtext'],
'Filename'=>['filename','filename'],
'Filesize'=>['filesize','filesize'],
'Dimensions'=>['height','dimensions'],
'Duplicate'=>['duplicate','duplicatecheckbox'],
'Flagged'=>['flag','flagcheckbox'],
'Delete'=>['remove','removecheckbox'],
];?>
@section('htmlheader_title')
Duplicates
@endsection
@section('contentheader_title')
Review Duplicate Items
@endsection
@section('contentheader_description')
{{ $catalog->count() }} to review
@endsection
@section('page_title')
Duplicates
@endsection
@section('main-content')
<div class="container">
<div class="row">
<div class="col-md-11 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
Review Duplicate Items
</div>
<div class="col-12">
@if ($catalog->count())
<span class="pagination justify-content-center">{{ $catalog->links() }}</span>
<div class="text-center">{{ $catalog->links() }}</div>
<form action="{{ $return }}" method="POST">
{{ csrf_field() }}
<div class="panel-body">
@if ($catalog->count())
<form action="{{ $return }}" method="POST">
<table class="table table-striped table-condensed table-hover">
<tr>
<th>Source</th>
<th>Remove</th>
</tr>
<table class="table table-striped table-sm table-hover table-bordered">
<thead>
<tr>
<th class="w-50">Source</th>
<th class="w-50">Remove</th>
</tr>
</thead>
@foreach ($catalog as $o)
<tr>
@php
$d=$o->list_duplicates(TRUE); $src=[];
@endphp
<td>
@if($d->where('duplicate',null)->count() > 1)
More than 1 source?
@elseif($d->count())
@php($src = $d->first())
{!! $src->view() !!}
<table class="table table-striped table-condensed table-hover small">
@foreach($data as $k=>$v)
<tr><th>{{$k}}</th><td>{!! $src->{$v[1]} !!}</td></tr>
@endforeach
</table>
@endif
</td>
@foreach($d as $item)
<input type="hidden" name="items[]" value="{{ $item->id }}">
@if($src AND $item->id == $src->id) @continue @endif
@php($diff=collect($src)->diffAssoc($item))
<td>
{!! $item->view() !!}
<table class="table table-striped table-condensed table-hover small">
@foreach($data as $k=>$v)
<tr class="@if($diff->has($v[0])) danger @endif"><th>{{$k}}</th><td>{!! $item->{$v[1]} !!}</td></tr>
@endforeach
</table>
</td>
@endforeach
</tr>
@endforeach
</table>
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
<button class="btn btn-default">Update</button>
{{ csrf_field() }}
</form>
@else
NONE!
@endif
</div>
</div>
</div>
@php $c=0; @endphp
@foreach ($catalog as $o)
@php
$d=$o->list_duplicates(TRUE); $src=[];
@endphp
<tbody>
<tr>
<td>
@if($d->where('duplicate',null)->count() > 1)
More than 1 source?
@elseif($d->count())
@php($src=$d->first())
@include('photo.widgets.thumbnail',['o'=>$src])
@endif
</td>
@if ($d->count() == 1)
<td>
No other duplicates found?
</td>
@continue
@else
@foreach($d as $item)
@if($loop->first) @continue @endif
@php($diff=collect($src)->diffAssoc($item))
<td>
<input type="hidden" name="items[]" value="{{ $item->id }}">
XX
@include('photo.widgets.thumbnail',['o'=>$src])
</td>
@endforeach
@endif
</tr>
</tbody>
@endforeach
</table>
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
<button class="btn btn-primary">Update</button>
</form>
@else
NONE!
@endif
</div>
</div>
@endsection
@endsection