Cosmetic changes

This commit is contained in:
Deon George 2019-12-15 11:30:29 +11:00
parent ebfdf3f7d5
commit af1164e764
8 changed files with 65 additions and 128 deletions

View File

@ -34,7 +34,10 @@ class PhotoController extends Controller
public function deletes($id=NULL)
{
return view('catalog.deletereview',['return'=>url('/p/deletes'),'catalog'=>is_null($id) ? Photo::where('remove',1)->paginate(50) : Photo::where('id',$id)->paginate(1)]);
return view('catalog.deletereview',[
'return'=>url('p/deletes'),
'catalog'=>is_null($id) ? Photo::where('remove',1)->with('software.model.make')->paginate(10) : Photo::where('id',$id)->paginate(1)
]);
}
public function deletesUpdate(Request $request)
@ -53,7 +56,7 @@ class PhotoController extends Controller
public function duplicates($id=NULL)
{
return view('catalog.duplicatereview',[
'return'=>url('/p/duplicates'),
'return'=>url('p/duplicates'),
'catalog'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->with('software.model.make')->paginate(10) : Photo::where('id',$id)->paginate(1)
]);
}

View File

@ -5,89 +5,31 @@
@endsection
@section('contentheader_title')
Deletes
Review Pending Delete Items
@endsection
@section('contentheader_description')
#
{{ $catalog->count() }} to review
@endsection
@section('page_title')
Deletes
@endsection
<?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'],
'Is Duplicate'=>['duplicate','duplicatetext'],
'Flagged'=>['flag','flagtext'],
'Delete'=>['remove','removecheckbox'],
];?>
@section('content')
<div class="row">
<div class="col-md-11 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
Permanently Delete Items
</div>
<div class="text-center">{{ $catalog->links() }}</div>
<div class="panel-body">
@section('main-content')
<div class="col-12">
@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>
<span class="pagination justify-content-center">{{ $catalog->links() }}</span>
@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-sm 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)
@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">Confirm Delete</button>
<form action="{{ $return }}" method="POST">
{{ csrf_field() }}
@include('catalog.widgets.duplicates')
<div class="pb-2"><button class="btn btn-sm btn-danger">Confirm Delete</button></div>
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
</form>
@else
NONE!
@endif
</div>
</div>
</div>
</div>
@endsection

View File

@ -22,50 +22,9 @@
<form action="{{ $return }}" method="POST">
{{ csrf_field() }}
<table class="table table-striped table-sm table-hover table-bordered">
<thead>
<tr>
<th class="w-50">Remove</th>
<th class="w-50">Source</th>
</tr>
</thead>
@include('catalog.widgets.duplicates')
@foreach ($catalog as $o)
<tbody>
<tr>
<td>
<input type="hidden" name="items[]" value="{{ $o->id }}">
@include('photo.widgets.thumbnail',['o'=>$o])
</td>
@if (! ($d=$o->duplicates()->with('software.model.make')->get())->count())
<td>
No other duplicates found?
</td>
@continue
@else
@foreach($d as $item)
<td>
<input type="hidden" name="items[]" value="{{ $item->id }}">
@include('photo.widgets.thumbnail',['o'=>$item])
</td>
@endforeach
@endif
</tr>
</tbody>
@endforeach
<tfoot>
<tr>
<td colspan="2"><button class="btn btn-primary">Update</button></td>
</tr>
</tfoot>
</table>
{{--
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
--}}
<div class="pb-2"><button class="btn btn-sm btn-primary">Update</button></div>
</form>
@else
NONE!

View File

@ -0,0 +1,34 @@
<table class="table">
<thead>
<tr>
<th class="w-50">Remove</th>
<th class="w-50">Source</th>
</tr>
</thead>
@foreach ($catalog as $o)
<tbody>
<tr>
<td>
<input type="hidden" name="items[]" value="{{ $o->id }}">
@include('photo.widgets.thumbnail',['o'=>$o])
</td>
@if (! ($d=$o->duplicates()->get())->count())
<td>
No other duplicates found?
</td>
@continue
@else
@foreach($d as $item)
<td>
<input type="hidden" name="items[]" value="{{ $item->id }}">
@include('photo.widgets.thumbnail',['o'=>$item])
</td>
@endforeach
@endif
</tr>
</tbody>
@endforeach
</table>

View File

@ -5,10 +5,10 @@
@endsection
@section('contentheader_title')
Photo #{{ $o->id }} @if($o->duplicate)<button class="btn btn-warning">DUPLICATE</button>@endif @if($o->remove)<button class="btn btn-danger">PENDING DELETE</button>@endif
Photo #{{ $o->id }}
@endsection
@section('contentheader_description')
#{{ $o->id }}
@if($o->duplicate)<button class="btn btn-sm btn-warning">DUPLICATE</button>@endif @if($o->remove)<button class="btn btn-sm btn-danger">PENDING DELETE</button>@endif
@endsection
@section('page_title')
#{{ $o->id }}

View File

@ -27,14 +27,12 @@
<!-- /.card-body -->
<div class="card-body">
{!! $o->getHtmlImageURL() !!}
<span class="float-right text-muted">&nbsp;</span>
<a href="{{ url('p/view',$o->id) }}" target="{{ $o->id }}">{!! $o->getHtmlImageURL() !!}</a>
</div>
<!-- /.card-body -->
<div class="card-footer card-comments">
<table class="table table-striped table-sm table-hover small">
<table class="table table-striped table-sm table-hover">
@foreach($data as $k=>$v)
<tr><th>{{$k}}</th><td>{!! $o->{$v[1]} !!}</td></tr>
@endforeach

View File

@ -8,7 +8,7 @@
<li class="pt-3 nav-item has-treeview @if(preg_match('#^p/(duplicate|delete)s#',request()->path()))menu-open @else menu-closed @endif">
<a href="#" class="nav-link @if(preg_match('#^/(duplicate|delete)s/[0-9]+#',request()->path())) active @endif">
<p>PHOTOS<i class="fa fa-angle-left right"></i></p>
<i class="nav-icon fa fa-camera"></i> <p>PHOTOS<i class="fa fa-angle-left right"></i></p>
</a>
<ul class="nav nav-treeview">

View File

@ -16,17 +16,18 @@ Route::get('/p/deletes/{id?}','PhotoController@deletes')->where('id','[0-9]+');
Route::get('/v/deletes/{id?}','VideoController@deletes')->where('id','[0-9]+');
Route::get('/p/duplicates/{id?}','PhotoController@duplicates')->where('id','[0-9]+');
Route::get('/v/duplicates/{id?}','VideoController@duplicates')->where('id','[0-9]+');
Route::get('/p/info/{o}','PhotoController@info')->where('o','[0-9]+');
Route::get('/v/info/{id}','VideoController@info')->where('id','[0-9]+');
Route::get('/p/thumbnail/{id}','PhotoController@thumbnail')->where('id','[0-9]+');
Route::get('/p/thumbnail/{o}','PhotoController@thumbnail')->where('o','[0-9]+');
Route::get('/p/view/{o}','PhotoController@view')->where('o','[0-9]+');
Route::get('/v/view/{id}','VideoController@view')->where('id','[0-9]+');
Route::post('/p/delete/{id}','PhotoController@delete')->where('id','[0-9]+');
Route::post('/p/delete/{o}','PhotoController@delete')->where('o','[0-9]+');
Route::post('/v/delete/{id}','VideoController@delete')->where('id','[0-9]+');
Route::post('/p/duplicates','PhotoController@duplicatesUpdate');
Route::post('/v/duplicates','VideoController@duplicatesUpdate');
Route::post('/p/deletes','PhotoController@deletesUpdate');
Route::post('/v/deletes','VideoController@deletesUpdate');
Route::post('/p/undelete/{id}','PhotoController@undelete')->where('id','[0-9]+');
Route::post('/p/undelete/{o}','PhotoController@undelete')->where('o','[0-9]+');
Route::post('/v/undelete/{id}','VideoController@undelete')->where('id','[0-9]+');