From 8c453d7b0ea64361a7655a71823d0ed1da518818 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 26 Dec 2019 16:46:35 +1100 Subject: [PATCH] Created photo thumbnail view --- app/Models/Abstracted/Catalog.php | 13 ++++++ .../catalog/widgets/duplicates.blade.php | 4 +- .../views/video/widgets/thumbnail.blade.php | 42 +++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 resources/views/video/widgets/thumbnail.blade.php diff --git a/app/Models/Abstracted/Catalog.php b/app/Models/Abstracted/Catalog.php index cb35bec..e83a86c 100644 --- a/app/Models/Abstracted/Catalog.php +++ b/app/Models/Abstracted/Catalog.php @@ -260,6 +260,19 @@ abstract class Catalog extends Model return $this->HTMLCheckbox('remove',$this->id,$this->remove); } + /** + * Return the object type + * @return string + */ + public function getTypeAttribute(): string + { + switch(get_class($this)) { + case 'App\Models\Photo': return 'photo'; + case 'App\Models\Video': return 'video'; + default: return 'unknown'; + } + } + /** * Display the GPS coordinates */ diff --git a/resources/views/catalog/widgets/duplicates.blade.php b/resources/views/catalog/widgets/duplicates.blade.php index 46f48c3..d7dce78 100644 --- a/resources/views/catalog/widgets/duplicates.blade.php +++ b/resources/views/catalog/widgets/duplicates.blade.php @@ -11,7 +11,7 @@ - @include('photo.widgets.thumbnail',['o'=>$o]) + @include($o->type.'.widgets.thumbnail',['o'=>$o]) @if (! ($d=$o->duplicates()->get())->count()) @@ -24,7 +24,7 @@ @foreach($d as $item) - @include('photo.widgets.thumbnail',['o'=>$item]) + @include($item->type.'.widgets.thumbnail',['o'=>$item]) @endforeach @endif diff --git a/resources/views/video/widgets/thumbnail.blade.php b/resources/views/video/widgets/thumbnail.blade.php new file mode 100644 index 0000000..1e0a79f --- /dev/null +++ b/resources/views/video/widgets/thumbnail.blade.php @@ -0,0 +1,42 @@ +['id','idlink'], + 'Signature'=>['signature','signature'], + 'File Signature'=>['file_signature','file_signature'], + 'Date Created'=>['date_created','date_created'], + 'Filename'=>['filename','filename'], + 'Filesize'=>['filesize','filesize'], + 'Dimensions'=>['height','dimensions'], + 'Length'=>['length','length'], + 'Duplicate'=>['duplicate','duplicatecheckbox'], + 'Flagged'=>['flag','flagcheckbox'], + 'Delete'=>['remove','removecheckbox'], +];?> + +
+
+
+ #{{ $o->id }} - {{ \Illuminate\Support\Str::limit($o->filename,12).\Illuminate\Support\Str::substr($o->filename,-16) }} + {{ $o->date_created ? $o->date_created->toDateTimeString() : '-' }} [{{ $o->device() }}] +
+ +
+ + +
+ +
+ + + + + + +
\ No newline at end of file