Updated photo viewing
This commit is contained in:
parent
8f093f50b7
commit
ebfdf3f7d5
@ -42,6 +42,11 @@ class LoginController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function showLoginForm()
|
public function showLoginForm()
|
||||||
{
|
{
|
||||||
return view('adminlte::auth.login');
|
$login_note = '';
|
||||||
|
|
||||||
|
if (file_exists('login_note.txt'))
|
||||||
|
$login_note = file_get_contents('login_note.txt');
|
||||||
|
|
||||||
|
return view('adminlte::auth.login')->with('login_note',$login_note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ class PhotoController extends Controller
|
|||||||
{
|
{
|
||||||
return view('catalog.duplicatereview',[
|
return view('catalog.duplicatereview',[
|
||||||
'return'=>url('/p/duplicates'),
|
'return'=>url('/p/duplicates'),
|
||||||
'catalog'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->paginate(50) : Photo::where('id',$id)->paginate(1)
|
'catalog'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->with('software.model.make')->paginate(10) : Photo::where('id',$id)->paginate(1)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,15 +73,15 @@ class PhotoController extends Controller
|
|||||||
// Set if delete
|
// Set if delete
|
||||||
$po->remove = $request->input('remove.'.$id) ? 1 : NULL;
|
$po->remove = $request->input('remove.'.$id) ? 1 : NULL;
|
||||||
|
|
||||||
$po->isDirty() AND $po->save();
|
$po->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->action('PhotoController@duplicates','?page='.$request->input('page'));
|
return redirect()->action('PhotoController@duplicates','?page='.$request->input('page'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info($id)
|
public function info(Photo $o)
|
||||||
{
|
{
|
||||||
return view('photo.view', ['photo'=> Photo::findOrFail($id)]);
|
return view('photo.view',['o'=>$o]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function thumbnail($id)
|
public function thumbnail($id)
|
||||||
|
@ -10,7 +10,7 @@ use App\Models\{Person,Tag};
|
|||||||
|
|
||||||
abstract class Catalog extends Model
|
abstract class Catalog extends Model
|
||||||
{
|
{
|
||||||
protected $dates = ['date_created'];
|
protected static $includeSubSecTime = FALSE;
|
||||||
|
|
||||||
public function people()
|
public function people()
|
||||||
{
|
{
|
||||||
@ -22,6 +22,38 @@ abstract class Catalog extends Model
|
|||||||
return $this->belongsToMany(Tag::class);
|
return $this->belongsToMany(Tag::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeDuplicates($query) {
|
||||||
|
if (! $this->exists)
|
||||||
|
return $query;
|
||||||
|
|
||||||
|
// Exclude this record
|
||||||
|
$query->where('id','<>',$this->attributes['id']);
|
||||||
|
|
||||||
|
// Exclude those marked as remove
|
||||||
|
$query->where(function ($q) {
|
||||||
|
$q->where('remove','<>',TRUE)
|
||||||
|
->orWhere('remove','=',NULL);
|
||||||
|
});
|
||||||
|
|
||||||
|
$query->where(function ($q) {
|
||||||
|
$q->where('signature','=',$this->attributes['signature'])
|
||||||
|
->orWhere('file_signature','=',$this->attributes['file_signature'])
|
||||||
|
|
||||||
|
// Where the signature is the same
|
||||||
|
->orWhere(function($q) {
|
||||||
|
// Or they have the same time taken with the same camera
|
||||||
|
if ($this->attributes['date_created'] AND $this->software_id) {
|
||||||
|
$q->where('date_created','=',$this->attributes['date_created'] ?: NULL);
|
||||||
|
|
||||||
|
if (static::$includeSubSecTime)
|
||||||
|
$q->where('subsectime','=',$this->attributes['subsectime'] ?: NULL);
|
||||||
|
|
||||||
|
$q->where('software_id','=',$this->attributes['software_id']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multimedia NOT duplicate.
|
* Multimedia NOT duplicate.
|
||||||
*
|
*
|
||||||
@ -66,21 +98,35 @@ abstract class Catalog extends Model
|
|||||||
|
|
||||||
abstract public function setDateCreated();
|
abstract public function setDateCreated();
|
||||||
abstract public function setLocation();
|
abstract public function setLocation();
|
||||||
abstract public function setMakeModel();
|
|
||||||
abstract public function setSignature();
|
abstract public function setSignature();
|
||||||
abstract public function setSubSecTime();
|
abstract public function setSubSecTime();
|
||||||
abstract public function setThumbnail();
|
abstract public function setThumbnail();
|
||||||
abstract public function view();
|
abstract public function getHtmlImageURL();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date the multimedia was created
|
* Date the multimedia was created
|
||||||
* @todo return Carbon date or NULL
|
|
||||||
*/
|
*/
|
||||||
public function date_taken(): string
|
public function date_taken(): string
|
||||||
{
|
{
|
||||||
return $this->date_created ? date('Y-m-d H:i:s',$this->date_created) : 'UNKNOWN';
|
return $this->date_created ? date('Y-m-d H:i:s',$this->date_created) : 'UNKNOWN';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function device(): string
|
||||||
|
{
|
||||||
|
$result = '';
|
||||||
|
|
||||||
|
if ($this->software->model->make)
|
||||||
|
$result .= $this->software->model->make->name;
|
||||||
|
|
||||||
|
if ($this->software->model)
|
||||||
|
$result .= ($result ? ' ' : '').$this->software->model->name;
|
||||||
|
|
||||||
|
if ($this->software)
|
||||||
|
$result .= ($result ? ' ' : '').$this->software->name;
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the date of the file
|
* Return the date of the file
|
||||||
* @todo return Carbon date or NULL
|
* @todo return Carbon date or NULL
|
||||||
@ -130,9 +176,9 @@ abstract class Catalog extends Model
|
|||||||
/**
|
/**
|
||||||
* Display the file signature
|
* Display the file signature
|
||||||
*/
|
*/
|
||||||
public function file_signature($short=FALSE)
|
public function file_signature($short=FALSE): string
|
||||||
{
|
{
|
||||||
return $short ? static::signaturetrim($this->file_signature) : $this->file_signature;
|
return $short ? static::stringtrim($this->file_signature) : $this->file_signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -349,7 +395,7 @@ abstract class Catalog extends Model
|
|||||||
/**
|
/**
|
||||||
* Determine if the image should be moved
|
* Determine if the image should be moved
|
||||||
*/
|
*/
|
||||||
public function shouldMove(): boolean
|
public function shouldMove(): bool
|
||||||
{
|
{
|
||||||
return ($this->filename != $this->file_path(TRUE,TRUE));
|
return ($this->filename != $this->file_path(TRUE,TRUE));
|
||||||
}
|
}
|
||||||
@ -372,7 +418,7 @@ abstract class Catalog extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find duplicate images based on some attributes of the current image
|
* Find duplicate images based on some attributes of the current image
|
||||||
* @todo Optimise this query
|
* @deprecate Use static::duplicates()
|
||||||
*/
|
*/
|
||||||
public function list_duplicates($includeme=FALSE)
|
public function list_duplicates($includeme=FALSE)
|
||||||
{
|
{
|
||||||
|
@ -2,13 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use DB;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class Photo extends Abstracted\Catalog
|
class Photo extends Abstracted\Catalog
|
||||||
{
|
{
|
||||||
protected $table = 'photo';
|
protected $table = 'photo';
|
||||||
|
|
||||||
|
protected static $includeSubSecTime = TRUE;
|
||||||
|
|
||||||
// Imagick Object
|
// Imagick Object
|
||||||
private $_o;
|
private $_o;
|
||||||
|
|
||||||
@ -24,12 +26,19 @@ class Photo extends Abstracted\Catalog
|
|||||||
return $this->belongsTo(Software::class);
|
return $this->belongsTo(Software::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getIDLinkAttribute()
|
||||||
|
{
|
||||||
|
return $this->HTMLLinkAttribute($this->id,url('p/info').'/');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date the photo was taken
|
* Date the photo was taken
|
||||||
*/
|
*/
|
||||||
public function date_taken(): string
|
public function date_taken(): string
|
||||||
{
|
{
|
||||||
return $this->date_created ? (date('Y-m-d H:i:s',$this->date_created).($this->subsectime ? '.'.$this->subsectime : '')) : 'UNKNOWN';
|
return $this->date_created
|
||||||
|
? ($this->date_created->format('Y-m-d H:i:s').($this->subsectime ? '.'.$this->subsectime : ''))
|
||||||
|
: 'UNKNOWN';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,9 +58,9 @@ class Photo extends Abstracted\Catalog
|
|||||||
return (($short OR preg_match('/^\//',$file)) ? '' : config('photo.dir').DIRECTORY_SEPARATOR).$file;
|
return (($short OR preg_match('/^\//',$file)) ? '' : config('photo.dir').DIRECTORY_SEPARATOR).$file;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIDLinkAttribute()
|
public function getHtmlImageURL(): string
|
||||||
{
|
{
|
||||||
return $this->HTMLLinkAttribute($this->id,url('p/info').'/');
|
return sprintf('<img height="240" src="%s"></img>',url('/p/thumbnail/'.$this->id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,9 +74,7 @@ class Photo extends Abstracted\Catalog
|
|||||||
if (array_key_exists('exif',$imo->getImageProfiles()))
|
if (array_key_exists('exif',$imo->getImageProfiles()))
|
||||||
$imo->removeImageProfile('exif');
|
$imo->removeImageProfile('exif');
|
||||||
|
|
||||||
$this->rotate($imo);
|
return $this->rotate($imo);
|
||||||
|
|
||||||
return $imo->getImageBlob();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -78,8 +85,7 @@ class Photo extends Abstracted\Catalog
|
|||||||
if (! $coordinate OR ! $hemisphere)
|
if (! $coordinate OR ! $hemisphere)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for ($i=0; $i<3; $i++)
|
for ($i=0; $i<3; $i++) {
|
||||||
{
|
|
||||||
$part = explode('/', $coordinate[$i]);
|
$part = explode('/', $coordinate[$i]);
|
||||||
|
|
||||||
if (count($part) == 1)
|
if (count($part) == 1)
|
||||||
@ -92,16 +98,15 @@ class Photo extends Abstracted\Catalog
|
|||||||
$coordinate[$i] = 0;
|
$coordinate[$i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
list($degrees, $minutes, $seconds) = $coordinate;
|
list($degrees,$minutes,$seconds) = $coordinate;
|
||||||
|
|
||||||
$sign = ($hemisphere == 'W' || $hemisphere == 'S') ? -1 : 1;
|
$sign = ($hemisphere == 'W' || $hemisphere == 'S') ? -1 : 1;
|
||||||
|
|
||||||
return round($sign*($degrees+$minutes/60+$seconds/3600),$degrees > 100 ? 3 : 4);
|
return round($sign*($degrees+$minutes/60+$seconds/3600),($degrees>100 ? 3 : 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an Imagick object or attribute
|
* Return an Imagick object or attribute
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
protected function o($attr=NULL)
|
protected function o($attr=NULL)
|
||||||
{
|
{
|
||||||
@ -123,8 +128,7 @@ class Photo extends Abstracted\Catalog
|
|||||||
case 3: return 'Upside Down';
|
case 3: return 'Upside Down';
|
||||||
case 6: return 'Rotate Right';
|
case 6: return 'Rotate Right';
|
||||||
case 8: return 'Rotate Left';
|
case 8: return 'Rotate Left';
|
||||||
default:
|
default: return 'unknown?';
|
||||||
return 'unknown?';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,8 +148,7 @@ class Photo extends Abstracted\Catalog
|
|||||||
if (! $this->o())
|
if (! $this->o())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch ($property)
|
switch ($property) {
|
||||||
{
|
|
||||||
case 'creationdate':
|
case 'creationdate':
|
||||||
if ($this->property('exif:DateTimeOriginal') == '0000:00:00 00:00:00'
|
if ($this->property('exif:DateTimeOriginal') == '0000:00:00 00:00:00'
|
||||||
&& $this->property('exif:DateTimeOriginal') == '0000:00:00 00:00:00')
|
&& $this->property('exif:DateTimeOriginal') == '0000:00:00 00:00:00')
|
||||||
@ -172,6 +175,10 @@ class Photo extends Abstracted\Catalog
|
|||||||
return $this->o() ? $this->_o->getImageProperties() : [];
|
return $this->o() ? $this->_o->getImageProperties() : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDateCreatedAttribute() {
|
||||||
|
return Carbon::createFromTimestamp($this->attributes['date_created']);
|
||||||
|
}
|
||||||
|
|
||||||
public function setDateCreated()
|
public function setDateCreated()
|
||||||
{
|
{
|
||||||
$this->date_created = $this->property('creationdate');
|
$this->date_created = $this->property('creationdate');
|
||||||
@ -181,9 +188,9 @@ class Photo extends Abstracted\Catalog
|
|||||||
{
|
{
|
||||||
$this->gps_lat = static::latlon(preg_split('/,\s?/',$this->property('exif:GPSLatitude')),$this->property('exif:GPSLatitudeRef'));
|
$this->gps_lat = static::latlon(preg_split('/,\s?/',$this->property('exif:GPSLatitude')),$this->property('exif:GPSLatitudeRef'));
|
||||||
$this->gps_lon = static::latlon(preg_split('/,\s?/',$this->property('exif:GPSLongitude')),$this->property('exif:GPSLongitudeRef'));
|
$this->gps_lon = static::latlon(preg_split('/,\s?/',$this->property('exif:GPSLongitude')),$this->property('exif:GPSLongitudeRef'));
|
||||||
#$this->gps_altitude = $this->property('gps_altitude');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @todo Now set software_id
|
||||||
public function setMakeModel()
|
public function setMakeModel()
|
||||||
{
|
{
|
||||||
$this->make = $this->property('exif:Make') ? $this->property('exif:Make') : NULL;
|
$this->make = $this->property('exif:Make') ? $this->property('exif:Make') : NULL;
|
||||||
@ -195,7 +202,6 @@ class Photo extends Abstracted\Catalog
|
|||||||
{
|
{
|
||||||
$this->signature = $this->property('signature');
|
$this->signature = $this->property('signature');
|
||||||
$this->file_signature = md5_file($this->file_path());
|
$this->file_signature = md5_file($this->file_path());
|
||||||
#$this->identifier = $this->property('identifier');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSubSecTime()
|
public function setSubSecTime()
|
||||||
@ -211,6 +217,7 @@ class Photo extends Abstracted\Catalog
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->thumbnail = exif_thumbnail($this->file_path());
|
$this->thumbnail = exif_thumbnail($this->file_path());
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// @todo Couldnt get the thumbnail, so we should create one.
|
// @todo Couldnt get the thumbnail, so we should create one.
|
||||||
Log::info(sprintf('Unable to create thumbnail for %s (%s)',$this->id,$e->getMessage()));
|
Log::info(sprintf('Unable to create thumbnail for %s (%s)',$this->id,$e->getMessage()));
|
||||||
@ -225,8 +232,7 @@ class Photo extends Abstracted\Catalog
|
|||||||
*/
|
*/
|
||||||
public function thumbnail($rotate=TRUE)
|
public function thumbnail($rotate=TRUE)
|
||||||
{
|
{
|
||||||
if (! $this->thumbnail)
|
if (! $this->thumbnail) {
|
||||||
{
|
|
||||||
return $this->o()->thumbnailimage(200,200,true,true) ? $this->_o->getImageBlob() : NULL;
|
return $this->o()->thumbnailimage(200,200,true,true) ? $this->_o->getImageBlob() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,9 +253,4 @@ class Photo extends Abstracted\Catalog
|
|||||||
{
|
{
|
||||||
return strtolower($mime ? 'image/jpeg' : pathinfo($this->filename,PATHINFO_EXTENSION));
|
return strtolower($mime ? 'image/jpeg' : pathinfo($this->filename,PATHINFO_EXTENSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function view()
|
|
||||||
{
|
|
||||||
return sprintf('<img height="240" src="%s"></img>',url('/p/thumbnail/'.$this->id));
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -132,6 +132,7 @@ class Video extends Abstracted\Catalog
|
|||||||
$this->gps_altitude = $this->property('gps_altitude');
|
$this->gps_altitude = $this->property('gps_altitude');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @todo Now set software_id
|
||||||
public function setMakeModel()
|
public function setMakeModel()
|
||||||
{
|
{
|
||||||
$this->make = $this->property('make');
|
$this->make = $this->property('make');
|
||||||
@ -170,7 +171,7 @@ class Video extends Abstracted\Catalog
|
|||||||
return strtolower($mime ? File::mime_by_ext(pathinfo($this->filename,PATHINFO_EXTENSION)) : pathinfo($this->filename,PATHINFO_EXTENSION));
|
return strtolower($mime ? File::mime_by_ext(pathinfo($this->filename,PATHINFO_EXTENSION)) : pathinfo($this->filename,PATHINFO_EXTENSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function view()
|
public function getHtmlImageURL()
|
||||||
{
|
{
|
||||||
return sprintf('<video width="320" height="240" src="%s" controls></video>',url('/v/view/'.$this->id));
|
return sprintf('<video width="320" height="240" src="%s" controls></video>',url('/v/view/'.$this->id));
|
||||||
}
|
}
|
||||||
|
@ -25,30 +25,20 @@
|
|||||||
<table class="table table-striped table-sm table-hover table-bordered">
|
<table class="table table-striped table-sm table-hover table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="w-50">Source</th>
|
|
||||||
<th class="w-50">Remove</th>
|
<th class="w-50">Remove</th>
|
||||||
|
<th class="w-50">Source</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@php $c=0; @endphp
|
|
||||||
@foreach ($catalog as $o)
|
@foreach ($catalog as $o)
|
||||||
@php
|
|
||||||
$d=$o->list_duplicates(TRUE); $src=[];
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@if($d->where('duplicate',null)->count() > 1)
|
<input type="hidden" name="items[]" value="{{ $o->id }}">
|
||||||
More than 1 source?
|
@include('photo.widgets.thumbnail',['o'=>$o])
|
||||||
|
|
||||||
@elseif($d->count())
|
|
||||||
@php($src=$d->first())
|
|
||||||
@include('photo.widgets.thumbnail',['o'=>$src])
|
|
||||||
@endif
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@if ($d->count() == 1)
|
@if (! ($d=$o->duplicates()->with('software.model.make')->get())->count())
|
||||||
<td>
|
<td>
|
||||||
No other duplicates found?
|
No other duplicates found?
|
||||||
</td>
|
</td>
|
||||||
@ -56,22 +46,26 @@
|
|||||||
|
|
||||||
@else
|
@else
|
||||||
@foreach($d as $item)
|
@foreach($d as $item)
|
||||||
@if($loop->first) @continue @endif
|
|
||||||
@php($diff=collect($src)->diffAssoc($item))
|
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="items[]" value="{{ $item->id }}">
|
<input type="hidden" name="items[]" value="{{ $item->id }}">
|
||||||
XX
|
@include('photo.widgets.thumbnail',['o'=>$item])
|
||||||
@include('photo.widgets.thumbnail',['o'=>$src])
|
|
||||||
</td>
|
</td>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><button class="btn btn-primary">Update</button></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{{--
|
||||||
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
|
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
|
||||||
<button class="btn btn-primary">Update</button>
|
--}}
|
||||||
</form>
|
</form>
|
||||||
@else
|
@else
|
||||||
NONE!
|
NONE!
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('contentheader_title')
|
@section('contentheader_title')
|
||||||
Photo
|
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
|
||||||
@endsection
|
@endsection
|
||||||
@section('contentheader_description')
|
@section('contentheader_description')
|
||||||
#{{ $o->id }}
|
#{{ $o->id }}
|
||||||
@ -16,46 +16,81 @@
|
|||||||
|
|
||||||
@section('main-content')
|
@section('main-content')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10 col-md-offset-1">
|
<div class="col-3">
|
||||||
<div class="panel panel-default">
|
<a href="{{ url('p/view',$o->id) }}"><img class="p-3" src="{{ url('p/thumbnail',$o->id) }}"></a>
|
||||||
<div class="panel-heading">
|
|
||||||
Photo {{ $photo->id }}<?php if ($photo->remove) : ?> - <strong>PENDING DELETE</strong><?php endif?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panel-body">
|
<span class="pagination justify-content-center">
|
||||||
<div class="col-md-2">
|
<nav>
|
||||||
<a href="{{ url('/p/view/'.$photo->id) }}"><img src="{{ url('/p/thumbnail/'.$photo->id) }}" width="200px"></a>
|
|
||||||
<div class="text-center">
|
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<li <?php if (! $x = $photo->previous()) : ?>class="disabled"<?php endif ?>><a href="{{ $x ? url('/p/info/'.$x->id) : '#' }}"><<</a></li>
|
<li class="page-item @if(! $x=$o->previous())disabled @endif" aria-disabled="@if(! $x)true @else false @endif" aria-label="« Previous">
|
||||||
<li <?php if (! $x = $photo->next()) : ?>class="disabled"<?php endif ?>><a href="{{ $x ? url('/p/info/'.$x->id) : '#' }}">>></a></li>
|
<a class="page-link" href="{{ $x ? url('p/info',$x->id) : '#' }}"><<</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="page-item active" aria-current="page"><span class="page-link">{{ $o->id }}</span></li>
|
||||||
|
|
||||||
|
<li class="page-item @if(! $x=$o->next())disabled @endif" aria-disabled="@if(! $x)true @else false @endif" aria-label="« Previous">
|
||||||
|
<a class="page-link" href="{{ $x ? url('p/info',$x->id) : '#' }}">>></a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="col-9">
|
||||||
<div class="col-md-10">
|
|
||||||
<div class="dl-horizontal">
|
<div class="dl-horizontal">
|
||||||
<dt>Signature</dt><dd>{{ $photo->signature(TRUE) }}</dd>
|
<dt>Signature</dt><dd>{{ $o->signature(TRUE) }}</dd>
|
||||||
<dt>Filename</dt><dd>{{ $photo->file_path(TRUE) }}<dd>
|
<dt>Filename</dt><dd>{{ $o->file_path(TRUE) }}<dd>
|
||||||
<?php if ($photo->shouldMove()) : ?>
|
|
||||||
<dt>NEW Filename</dt><dd>{{ $photo->file_path(TRUE,TRUE) }}<dd>
|
@if ($o->shouldMove())
|
||||||
<?php endif ?>
|
<dt>NEW Filename</dt><dd>{{ $o->file_path(TRUE,TRUE) }}<dd>
|
||||||
<dt>Size</dt><dd>{{ $photo->file_size() }}<dd>
|
@endif
|
||||||
<dt>Dimensions</dt><dd>{{ $photo->width }} x {{ $photo->height }} @ {{ $photo->orientation }}<dd>
|
|
||||||
<br/>
|
<dt>Size</dt><dd>{{ $o->file_size() }}<dd>
|
||||||
<dt>Date Taken</dt><dd>{{ $photo->date_taken() }}<dd>
|
<dt>Dimensions</dt><dd>{{ $o->dimensions }} @ {{ $o->orientation }}<dd>
|
||||||
<dt>Camera</dt><dd>{{ $photo->make }}<dd>
|
<hr>
|
||||||
<dt>Model</dt><dd>{{ $photo->model }}<dd>
|
<dt>Date Taken</dt><dd>{{ $o->date_taken() }}<dd>
|
||||||
<dt>Software</dt><dd>{{ $photo->software }}<dd>
|
<dt>Camera</dt><dd>{{ $o->device() }}<dd>
|
||||||
<br/>
|
<hr>
|
||||||
<dt>Location</dt><dd>
|
<dt>Location</dt><dd>
|
||||||
<?php if ($photo->gps() == 'UNKNOWN') : ?>
|
@if($o->gps() == 'UNKNOWN')
|
||||||
UNKNOWN
|
UNKNOWN
|
||||||
<?php else : ?>
|
@else
|
||||||
<div id="map" style="width: 400px; height: 300px"></div>
|
<div id="map" style="width: 400px; height: 300px"></div>
|
||||||
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
@endif
|
||||||
<script type="text/javascript">
|
|
||||||
var myLatLng = {lat: {{ $photo->gps_lat }}, lng: {{ $photo->gps_lon }}};
|
</dd>
|
||||||
|
<br/>
|
||||||
|
<dt>Exif Data</dt><dd>
|
||||||
|
<table>
|
||||||
|
@foreach ($o->properties() as $k => $v)
|
||||||
|
<tr><th>{{ $k }}<><td>{{ $v }}<td></tr>
|
||||||
|
@endforeach
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if ($o->remove)
|
||||||
|
<form action="{{ url('p/undelete',$o->id) }}" method="POST">
|
||||||
|
{{ csrf_field() }}
|
||||||
|
|
||||||
|
<button class="btn btn-primary">Undelete</button>
|
||||||
|
@else
|
||||||
|
<form action="{{ url('p/delete',$o->id) }}" method="POST">
|
||||||
|
{{ csrf_field() }}
|
||||||
|
|
||||||
|
<button class="btn btn-danger">Delete</button>
|
||||||
|
@endif
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('page-scripts')
|
||||||
|
@if($o->gps() !== 'UNKNOWN')
|
||||||
|
@js('//maps.google.com/maps/api/js?sensor=false')
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var myLatLng = {lat: {{ $o->gps_lat }}, lng: {{ $o->gps_lon }}};
|
||||||
var map = new google.maps.Map(document.getElementById("map"), {
|
var map = new google.maps.Map(document.getElementById("map"), {
|
||||||
zoom: 16,
|
zoom: 16,
|
||||||
center: myLatLng,
|
center: myLatLng,
|
||||||
@ -65,31 +100,6 @@
|
|||||||
map: map,
|
map: map,
|
||||||
position: myLatLng,
|
position: myLatLng,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php endif ?>
|
@endif
|
||||||
</dd>
|
@append
|
||||||
<br/>
|
|
||||||
<dt>Exif Data</dt><dd>
|
|
||||||
<table>
|
|
||||||
<?php foreach ($photo->properties() as $k => $v) : ?>
|
|
||||||
<tr><th>{{ $k }}<><td>{{ $v }}<td></tr>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</table>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($photo->remove) : ?>
|
|
||||||
<form action="{{ url('/p/undelete/'.$photo->id) }}" method="POST">
|
|
||||||
<button class="btn btn-default">Undelete</button>
|
|
||||||
<?php else : ?>
|
|
||||||
<form action="{{ url('/p/delete/'.$photo->id) }}" method="POST">
|
|
||||||
<button class="btn btn-default">Delete</button>
|
|
||||||
<?php endif ?>
|
|
||||||
{{ csrf_field() }}
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
@ -15,42 +15,29 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="user-block">
|
<div class="user-block">
|
||||||
<i class="float-left fa fa-2x fa-camera"></i><span class="username"><a href="#">#{{ $o->id }} - {{ \Illuminate\Support\Str::limit($o->filename,12).\Illuminate\Support\Str::substr($o->filename,-16) }}</a></span>
|
<i class="float-left fa fa-2x fa-camera"></i><span class="username"><a href="#">#{{ $o->id }} - {{ \Illuminate\Support\Str::limit($o->filename,12).\Illuminate\Support\Str::substr($o->filename,-16) }}</a></span>
|
||||||
<span class="description">{{ $o->date_created->toDateTimeString() }} [{{ $o->make }} {{ $o->model }} ({{ $o->software }})]</span>
|
<span class="description">{{ $o->date_created->toDateTimeString() }} [{{ $o->device() }}]</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.user-block -->
|
<!-- /.user-block -->
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fa fa-minus"></i>
|
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||||
</button>
|
<button type="button" class="btn btn-tool" data-card-widget="remove"><i class="fa fa-times"></i></button>
|
||||||
<button type="button" class="btn btn-tool" data-card-widget="remove"><i class="fa fa-times"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card-tools -->
|
<!-- /.card-tools -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- /.card-body -->
|
<!-- /.card-body -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{!! $o->view() !!}
|
{!! $o->getHtmlImageURL() !!}
|
||||||
|
|
||||||
<span class="float-right text-muted"> </span>
|
<span class="float-right text-muted"> </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- /.card-body -->
|
<!-- /.card-body -->
|
||||||
<div class="card-footer card-comments">
|
<div class="card-footer card-comments">
|
||||||
<div class="card-comment">
|
|
||||||
<div class="comment-text">
|
|
||||||
<table class="table table-striped table-sm table-hover small">
|
<table class="table table-striped table-sm table-hover small">
|
||||||
@foreach($data as $k=>$v)
|
@foreach($data as $k=>$v)
|
||||||
<tr><th>{{$k}}</th><td>{!! $src->{$v[1]} !!}</td></tr>
|
<tr><th>{{$k}}</th><td>{!! $o->{$v[1]} !!}</td></tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.comment-text -->
|
|
||||||
</div>
|
|
||||||
<!-- /.card-comment -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- /.card-footer -->
|
|
||||||
<div class="card-footer">
|
|
||||||
</div>
|
|
||||||
<!-- /.card-footer -->
|
|
||||||
</div>
|
</div>
|
@ -16,10 +16,10 @@ Route::get('/p/deletes/{id?}','PhotoController@deletes')->where('id','[0-9]+');
|
|||||||
Route::get('/v/deletes/{id?}','VideoController@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('/p/duplicates/{id?}','PhotoController@duplicates')->where('id','[0-9]+');
|
||||||
Route::get('/v/duplicates/{id?}','VideoController@duplicates')->where('id','[0-9]+');
|
Route::get('/v/duplicates/{id?}','VideoController@duplicates')->where('id','[0-9]+');
|
||||||
Route::get('/p/info/{id}','PhotoController@info')->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('/v/info/{id}','VideoController@info')->where('id','[0-9]+');
|
||||||
Route::get('/p/thumbnail/{id}','PhotoController@thumbnail')->where('id','[0-9]+');
|
Route::get('/p/thumbnail/{id}','PhotoController@thumbnail')->where('id','[0-9]+');
|
||||||
Route::get('/p/view/{id}','PhotoController@view')->where('id','[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::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/{id}','PhotoController@delete')->where('id','[0-9]+');
|
||||||
|
Loading…
Reference in New Issue
Block a user