Old updates
This commit is contained in:
82
resources/views/catalog/duplicatereview.blade.php
Normal file
82
resources/views/catalog/duplicatereview.blade.php
Normal file
@@ -0,0 +1,82 @@
|
||||
@extends('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('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="text-center">{{ $catalog->links() }}</div>
|
||||
|
||||
<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>
|
||||
|
||||
@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>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@@ -1,100 +0,0 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<?php $data = [
|
||||
'ID'=>'id',
|
||||
'Thumbnail'=>'thumbnail',
|
||||
'Signature'=>'signature',
|
||||
'Date Taken'=>'datetaken',
|
||||
'File Created'=>'created',
|
||||
'File Modified'=>'modified',
|
||||
'Filename'=>'filepath',
|
||||
'Filesize'=>'filesize',
|
||||
'Width'=>'width',
|
||||
'Height'=>'height',
|
||||
'Orientation'=>'orientation',
|
||||
'Make'=>'make',
|
||||
'Model'=>'model',
|
||||
'Exif Diff'=>'exif',
|
||||
];
|
||||
|
||||
$form = [
|
||||
'duplicate',
|
||||
'flag',
|
||||
'remove',
|
||||
];
|
||||
|
||||
function changed($k,$v,$l=0)
|
||||
{
|
||||
static $changed = [];
|
||||
|
||||
if (! isset($changed[$l][$k]))
|
||||
$changed[$l][$k] = $v;
|
||||
|
||||
return $changed[$l][$k] === $v;
|
||||
} ?>
|
||||
|
||||
@foreach ($photos as $photo)
|
||||
<?php $duplicates = $photo->list_duplicate(TRUE); ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-md-offset-1">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Duplicate Photo {{ $photo->id }}
|
||||
</div>
|
||||
|
||||
<div class="text-center">{{ $photos->links() }}</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ url('/p/duplicates') }}" method="POST">
|
||||
<table class="table table-striped table-condensed table-hover">
|
||||
@foreach ($data as $k=>$v)
|
||||
<tr>
|
||||
<th>{{ $k }}</th>
|
||||
@foreach ($duplicates as $id)
|
||||
<?php
|
||||
$o = (new \App\Model\Photo())->where('id',$id)->first();
|
||||
switch ($v) :
|
||||
case 'id': $x=$id; $y=sprintf('<a href="%s">%s</a>',url('/p/info/'.$o->id),$o->id); break;
|
||||
case 'thumbnail': $x=md5($o->thumbnail); $y=sprintf('<a href="%s"><img src="%s" width="200px"></a>',url('/p/view/'.$o->id),url('/p/thumbnail/'.$o->id)); break;
|
||||
case 'signature': $x=$y=$o->signature(TRUE); break;
|
||||
case 'datetaken': $x=$y=$o->date_taken(); break;
|
||||
case 'created': $x=$y=$o->file_date('c',TRUE); break;
|
||||
case 'modified': $x=$y=$o->file_date('m',TRUE); break;
|
||||
case 'filepath': $x=$y=$o->file_path(TRUE); break;
|
||||
case 'filesize': $x=$y=$o->file_size(); break;
|
||||
case 'width': $x=$y=$o->width; break;
|
||||
case 'height': $x=$y=$o->height; break;
|
||||
case 'orientation': $x=$y=$o->orientation; break;
|
||||
case 'make': $x=$y=$o->make; break;
|
||||
case 'model': $x=$y=$o->model; break;
|
||||
case 'exif': $y='<table class="table table-striped table-condensed">'; foreach ($o->properties() as $a => $b) $y.=sprintf('<tr class="%s"><th>%s<><td>%s<td></tr>',(changed($a,$b,1) ? '' : 'warning'),$a,$b); $y.='</table>';$x=md5($y); break;
|
||||
endswitch ?>
|
||||
<td class="{{ changed($v,$x) ? '' : 'danger' }}"><?php echo $y; ?></td>
|
||||
@endforeach {{-- photo --}}
|
||||
</tr>
|
||||
@endforeach {{-- data --}}
|
||||
@foreach ($form as $v)
|
||||
<tr>
|
||||
<th>{{ $v }}</th>
|
||||
@foreach ($duplicates as $id)
|
||||
<?php $o = (new \App\Model\Photo())->where('id',$id)->first(); ?>
|
||||
<td><input type="checkbox" name="{{ sprintf('%s[%s]',$v,$o->id) }}" value="1" {{ $o->$v==1 ? 'checked="checked"' : '' }}></td>
|
||||
@endforeach {{-- photo --}}
|
||||
</tr>
|
||||
@endforeach {{-- form --}}
|
||||
</table>
|
||||
@foreach ($duplicates as $id)
|
||||
<input type="hidden" name="photo[]" value="{{ $id }}">
|
||||
@endforeach {{-- photo --}}
|
||||
<input type="hidden" name="page" value="{{ $photos->currentPage() }}">
|
||||
<button class="btn btn-default">Update</button>
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endsection
|
@@ -1,100 +0,0 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<?php $data = [
|
||||
'ID'=>'id',
|
||||
'Video'=>'video',
|
||||
'Signature'=>'signature',
|
||||
'File Signature'=>'file_signature',
|
||||
'Length'=>'length',
|
||||
'Date Created'=>'datecreated',
|
||||
'File Created'=>'created',
|
||||
'File Modified'=>'modified',
|
||||
'Filename'=>'filepath',
|
||||
'Filesize'=>'filesize',
|
||||
'Width'=>'width',
|
||||
'Height'=>'height',
|
||||
'Make'=>'make',
|
||||
'Model'=>'model',
|
||||
];
|
||||
|
||||
$form = [
|
||||
'duplicate',
|
||||
'flag',
|
||||
'remove',
|
||||
];
|
||||
|
||||
function changed($k,$v,$l=0)
|
||||
{
|
||||
static $changed = [];
|
||||
|
||||
if (! isset($changed[$l][$k]))
|
||||
$changed[$l][$k] = $v;
|
||||
|
||||
return $changed[$l][$k] === $v;
|
||||
} ?>
|
||||
|
||||
@foreach ($videos as $video)
|
||||
<?php $duplicates = $video->list_duplicate(TRUE); ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-md-offset-1">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Duplicate Video {{ $video->id }}
|
||||
</div>
|
||||
|
||||
<div class="text-center">{{ $videos->links() }}</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ url('/v/duplicates') }}" method="POST">
|
||||
<table class="table table-striped table-condensed table-hover">
|
||||
@foreach ($data as $k=>$v)
|
||||
<tr>
|
||||
<th>{{ $k }}</th>
|
||||
@foreach ($duplicates as $id)
|
||||
<?php
|
||||
$o = (new \App\Model\Video())->where('id',$id)->first();
|
||||
switch ($v) :
|
||||
case 'id': $x=$id; $y=sprintf('<a href="%s">%s</a>',url('/v/info/'.$o->id),$o->id); break;
|
||||
case 'video': $x=$o->signature(TRUE);$y=$o->view();; break;
|
||||
case 'length': $x=$y=$o->length; break;
|
||||
case 'signature': $x=$y=$o->signature(TRUE); break;
|
||||
case 'file_signature': $x=$y=$o->file_signature(TRUE); break;
|
||||
case 'datecreated': $x=$y=$o->date_taken(); break;
|
||||
case 'created': $x=$y=$o->file_date('c',TRUE); break;
|
||||
case 'modified': $x=$y=$o->file_date('m',TRUE); break;
|
||||
case 'filepath': $x=$y=$o->file_path(TRUE); break;
|
||||
case 'filesize': $x=$y=$o->file_size(); break;
|
||||
case 'width': $x=$y=$o->width; break;
|
||||
case 'height': $x=$y=$o->height; break;
|
||||
case 'make': $x=$y=$o->make; break;
|
||||
case 'model': $x=$y=$o->model; break;
|
||||
endswitch ?>
|
||||
<td class="{{ changed($v,$x) ? '' : 'danger' }}"><?php echo $y; ?></td>
|
||||
@endforeach {{-- video --}}
|
||||
</tr>
|
||||
@endforeach {{-- data --}}
|
||||
@foreach ($form as $v)
|
||||
<tr>
|
||||
<th>{{ $v }}</th>
|
||||
@foreach ($duplicates as $id)
|
||||
<?php $o = (new \App\Model\Video())->where('id',$id)->first(); ?>
|
||||
<td><input type="checkbox" name="{{ sprintf('%s[%s]',$v,$o->id) }}" value="1" {{ $o->$v==1 ? 'checked="checked"' : '' }}></td>
|
||||
@endforeach {{-- video --}}
|
||||
</tr>
|
||||
@endforeach {{-- form --}}
|
||||
</table>
|
||||
@foreach ($duplicates as $id)
|
||||
<input type="hidden" name="video[]" value="{{ $id }}">
|
||||
@endforeach {{-- video --}}
|
||||
<input type="hidden" name="page" value="{{ $videos->currentPage() }}">
|
||||
<button class="btn btn-default">Update</button>
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endsection
|
Reference in New Issue
Block a user