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

@ -0,0 +1,63 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Bus\DispatchesJobs;
use App\Jobs\PhotoDelete;
use App\Models\Photo;
class PhotoAutoDelete extends Command
{
use DispatchesJobs;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'photo:autodelete';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Auto Delete Photos';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
Photo::where('remove',1)->chunk(10,function($chunk) {
foreach ($chunk as $o) {
foreach ($o->list_duplicates(TRUE) as $oo) {
if (! $oo->signature OR ! $oo->file_signature)
continue;
if ($oo->signature == $o->signature AND $oo->file_signature == $o->file_signature) {
if ($oo->remove) {
$this->info(sprintf('Removing: %s (%s)',$oo->id,$oo->filename));
$this->dispatch((new PhotoDelete($o))->onQueue('delete'));
}
}
}
}
});
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers;
class HomeController extends Controller
{
public function __construct()
{
//$this->middleware('guest');
}
public function home() {
return view('home');
}
}

View File

@ -10,12 +10,14 @@ use App\Models\{Person,Tag};
abstract class Catalog extends Model abstract class Catalog extends Model
{ {
public function People() protected $dates = ['date_created'];
public function people()
{ {
return $this->belongsToMany(Person::class); return $this->belongsToMany(Person::class);
} }
public function Tags() public function tags()
{ {
return $this->belongsToMany(Tag::class); return $this->belongsToMany(Tag::class);
} }
@ -29,7 +31,7 @@ abstract class Catalog extends Model
{ {
return $query->where(function($query) return $query->where(function($query)
{ {
$query->where('duplicate','!=',TRUE) $query->where('duplicate','<>',TRUE)
->orWhere('duplicate','=',NULL); ->orWhere('duplicate','=',NULL);
}); });
} }
@ -43,7 +45,7 @@ abstract class Catalog extends Model
{ {
return $query->where(function($query) return $query->where(function($query)
{ {
$query->where('remove','!=',TRUE) $query->where('remove','<>',TRUE)
->orWhere('remove','=',NULL); ->orWhere('remove','=',NULL);
}); });
} }
@ -57,7 +59,7 @@ abstract class Catalog extends Model
{ {
return $query->where(function($query) return $query->where(function($query)
{ {
$query->where('scanned','!=',TRUE) $query->where('scanned','<>',TRUE)
->orWhere('scanned','=',NULL); ->orWhere('scanned','=',NULL);
}); });
} }
@ -72,14 +74,16 @@ abstract class Catalog extends Model
/** /**
* Date the multimedia was created * Date the multimedia was created
* @todo return Carbon date or NULL
*/ */
public function date_taken() 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';
} }
/** /**
* Return the date of the file * Return the date of the file
* @todo return Carbon date or NULL
*/ */
public function file_date($type,$format=FALSE) public function file_date($type,$format=FALSE)
{ {
@ -101,6 +105,7 @@ abstract class Catalog extends Model
/** /**
* Determine the new name for the image * Determine the new name for the image
* @todo Make Generic for Photo and Video
*/ */
public function file_path($short=FALSE,$new=FALSE) public function file_path($short=FALSE,$new=FALSE)
{ {
@ -117,7 +122,7 @@ abstract class Catalog extends Model
/** /**
* Calculate a file path ID based on the id of the file * Calculate a file path ID based on the id of the file
*/ */
public function file_path_id($sep=3,$depth=9) public function file_path_id($sep=3,$depth=9): string
{ {
return trim(chunk_split(sprintf("%0{$depth}s",$this->id),$sep,'/'),'/'); return trim(chunk_split(sprintf("%0{$depth}s",$this->id),$sep,'/'),'/');
} }
@ -131,37 +136,18 @@ abstract class Catalog extends Model
} }
/** /**
* Return the photo size * Return the file size
* @deprecated
*/ */
public function file_size() public function file_size()
{ {
return (! is_readable($this->file_path())) ? NULL : filesize($this->file_path()); return (! is_readable($this->file_path())) ? NULL : filesize($this->file_path());
} }
public function getFileSizeAttribute()
{
return (! is_readable($this->file_path())) ? NULL : filesize($this->file_path());
}
public function getDateCreatedTextAttribute()
{
if ($this->date_created)
return date('d-m-Y H:i:s',$this->date_created);
}
public function getDuplicateTextAttribute()
{
return $this->TextTrueFalse($this->duplicate);
}
public function getFlagTextAttribute()
{
return $this->TextTrueFalse($this->flag);
}
/** /**
* Return item dimensions * Return item dimensions
*/ */
public function getDimensionsAttribute() public function getDimensionsAttribute(): string
{ {
return $this->width.'x'.$this->height; return $this->width.'x'.$this->height;
} }
@ -174,6 +160,16 @@ abstract class Catalog extends Model
return $this->HTMLCheckbox('duplicate',$this->id,$this->duplicate); return $this->HTMLCheckbox('duplicate',$this->id,$this->duplicate);
} }
/**
* Return the file size
*
* @return false|int|null
*/
public function getFileSizeAttribute()
{
return (! is_readable($this->file_path())) ? NULL : filesize($this->file_path());
}
/** /**
* Return HTML Checkbox for flagged * Return HTML Checkbox for flagged
*/ */
@ -182,6 +178,22 @@ abstract class Catalog extends Model
return $this->HTMLCheckbox('flag',$this->id,$this->flag); return $this->HTMLCheckbox('flag',$this->id,$this->flag);
} }
/**
* @deprecated
*/
public function getDuplicateTextAttribute()
{
return $this->TextTrueFalse($this->duplicate);
}
/**
* @deprecated
*/
public function getFlagTextAttribute()
{
return $this->TextTrueFalse($this->flag);
}
/** /**
* Return HTML Checkbox for remove * Return HTML Checkbox for remove
*/ */
@ -193,11 +205,19 @@ abstract class Catalog extends Model
/** /**
* Display the GPS coordinates * Display the GPS coordinates
*/ */
public function gps() public function gps(): string
{ {
return ($this->gps_lat AND $this->gps_lon) ? sprintf('%s/%s',$this->gps_lat,$this->gps_lon) : 'UNKNOWN'; return ($this->gps_lat AND $this->gps_lon) ? sprintf('%s/%s',$this->gps_lat,$this->gps_lon) : 'UNKNOWN';
} }
/**
* Return an HTML checkbox
*/
protected function HTMLCheckbox($name,$id,$value)
{
return sprintf('<input type="checkbox" name="%s[%s]" value="1"%s>',$name,$id,$value ? ' checked="checked"' : '');
}
/** /**
* Get ID Info link * Get ID Info link
*/ */
@ -207,19 +227,19 @@ abstract class Catalog extends Model
} }
/** /**
* Return an HTML checkbox * Determine if the parent dir is writable
*
* @param $dir
* @return bool
*/ */
protected function HTMLCheckbox($name,$id,$value) public function isParentWritable($dir): bool
{
return sprintf('<input type="checkbox" name="%s[%s]" value="1"%s>',$name,$id,$value ? ' checked="checked"' : '');
}
public function isParentWritable($dir)
{ {
if (file_exists($dir) AND is_writable($dir) AND is_dir($dir)) if (file_exists($dir) AND is_writable($dir) AND is_dir($dir))
return TRUE; return TRUE;
elseif ($dir == dirname($dir) OR file_exists($dir)) elseif ($dir == dirname($dir) OR file_exists($dir))
return FALSE; return FALSE;
else else
return ($this->isParentWritable(dirname($dir))); return ($this->isParentWritable(dirname($dir)));
} }
@ -228,6 +248,7 @@ abstract class Catalog extends Model
* Determine if a file is moveable * Determine if a file is moveable
* *
* useID boolean Determine if the path is based on the the ID or date * useID boolean Determine if the path is based on the the ID or date
* @todo Change to boolean and rename isMoveable() Log any FALSE reason.
*/ */
public function moveable() public function moveable()
{ {
@ -270,7 +291,7 @@ abstract class Catalog extends Model
/** /**
* Return my class shortname * Return my class shortname
*/ */
public function objectType() public function objectType(): string
{ {
return (new \ReflectionClass($this))->getShortName(); return (new \ReflectionClass($this))->getShortName();
} }
@ -301,24 +322,49 @@ abstract class Catalog extends Model
return $short ? static::signaturetrim($this->signature) : $this->signature; return $short ? static::signaturetrim($this->signature) : $this->signature;
} }
public static function signaturetrim($signature,$chars=6) /**
* Trim a string
*
* @todo rename stringtrim
* @param string $string
* @param int $chrs
* @return string
*/
public static function stringtrim(string $string,int $chrs=6)
{ {
return sprintf('%s...%s',substr($signature,0,$chars),substr($signature,-1*$chars)); return sprintf('%s...%s',substr($string,0,$chrs),substr($string,-1*$chrs));
}
/**
* @deprecated
* @param string $string
* @param int $chrs
* @return string
*/
public static function signaturetrim(string $string,int $chrs=6)
{
return static::stringtrim($string,$chrs);
} }
/** /**
* Determine if the image should be moved * Determine if the image should be moved
*/ */
public function shouldMove() public function shouldMove(): boolean
{ {
return ($this->filename != $this->file_path(TRUE,TRUE)); return ($this->filename != $this->file_path(TRUE,TRUE));
} }
protected function TextTrueFalse($value) protected function TextTrueFalse($value): string
{ {
return $value ? 'TRUE' : 'FALSE'; return $value ? 'TRUE' : 'FALSE';
} }
/**
* @todo Check if this is redundant
*
* @param bool $includeme
* @return mixed
*/
public function list_duplicate($includeme=FALSE) public function list_duplicate($includeme=FALSE)
{ {
return $this->list_duplicates($includeme)->pluck('id'); return $this->list_duplicates($includeme)->pluck('id');
@ -326,6 +372,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
*/ */
public function list_duplicates($includeme=FALSE) public function list_duplicates($includeme=FALSE)
{ {
@ -338,7 +385,7 @@ abstract class Catalog extends Model
if (! $includeme) if (! $includeme)
$o->where(function($query) $o->where(function($query)
{ {
$query->where('remove','!=',TRUE) $query->where('remove','<>',TRUE)
->orWhere('remove','=',NULL); ->orWhere('remove','=',NULL);
}); });

View File

@ -22,13 +22,14 @@ class Photo extends Abstracted\Catalog
/** /**
* Date the photo was taken * Date the photo was taken
*/ */
public function date_taken() 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 ? (date('Y-m-d H:i:s',$this->date_created).($this->subsectime ? '.'.$this->subsectime : '')) : 'UNKNOWN';
} }
/** /**
* Determine the new name for the image * Determine the new name for the image
* @todo Implement in Parent
*/ */
public function file_path($short=FALSE,$new=FALSE) public function file_path($short=FALSE,$new=FALSE)
{ {

6
composer.lock generated
View File

@ -1330,11 +1330,11 @@
}, },
{ {
"name": "leenooks/laravel", "name": "leenooks/laravel",
"version": "6.0.5", "version": "6.0.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://dev.leenooks.net/leenooks/laravel", "url": "https://dev.leenooks.net/leenooks/laravel",
"reference": "1096f0e28d489524c9c2134f3d7319530370673c" "reference": "1774987deadcf9e3124b8589f7f8a60541f5953d"
}, },
"require": { "require": {
"creativeorange/gravatar": "^1.0", "creativeorange/gravatar": "^1.0",
@ -1371,7 +1371,7 @@
"laravel", "laravel",
"leenooks" "leenooks"
], ],
"time": "2019-10-30T06:31:32+00:00" "time": "2019-11-22T03:22:37+00:00"
}, },
{ {
"name": "maximebf/debugbar", "name": "maximebf/debugbar",

File diff suppressed because one or more lines are too long

0
public/css/custom.css vendored Normal file
View File

13
public/css/fixes.css vendored
View File

@ -60,11 +60,18 @@ div.login-box .input-group .input-group-append span.fa {
} }
body { body {
font-size: 0.85em; font-size: 0.65em;
} }
/* Change brand logo on collapse */ /* Change brand logo on collapse */
body.sidebar-mini.sidebar-collapse img.brand-image.img-circle.elevation-3 { body.sidebar-mini.sidebar-collapse img.brand-image.img-circle.elevation-3 {
margin-left: 0px; /* margin-left: 0px; */
max-height: 25px; max-height: 27px;
border-radius: 0;
}
body.sidebar-mini img.brand-image.img-circle.elevation-3 {
/* margin-left: 0px; */
max-height: 27px;
border-radius: 0;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
Click here to reset your password: <a href="{{ $link = url('password/reset', $token).'?email='.urlencode($user->getEmailForPasswordReset()) }}"> {{ $link }} </a>

View File

@ -1,66 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Login</div>
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" action="{{ url('/login') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}">
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password">
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="remember"> Remember Me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
<i class="fa fa-btn fa-sign-in"></i> Login
</button>
<a class="btn btn-link" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,47 +0,0 @@
@extends('layouts.app')
<!-- Main Content -->
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Reset Password</div>
<div class="panel-body">
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif
<form class="form-horizontal" role="form" method="POST" action="{{ url('/password/email') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}">
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
<i class="fa fa-btn fa-envelope"></i> Send Password Reset Link
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,70 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Reset Password</div>
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" action="{{ url('/password/reset') }}">
{{ csrf_field() }}
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}">
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password">
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation">
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
<i class="fa fa-btn fa-refresh"></i> Reset Password
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,82 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Register</div>
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-4 control-label">Name</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}">
@if ($errors->has('name'))
<span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}">
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password">
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation">
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
<i class="fa fa-btn fa-user"></i> Register
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,4 +1,18 @@
@extends('layouts.app') @extends('adminlte::layouts.app')
@section('htmlheader_title')
Deletes
@endsection
@section('contentheader_title')
Deletes
@endsection
@section('contentheader_description')
#
@endsection
@section('page_title')
Deletes
@endsection
<?php $data = [ <?php $data = [
'ID'=>['id','idlink'], 'ID'=>['id','idlink'],
@ -13,7 +27,7 @@
];?> ];?>
@section('content') @section('content')
<div class="container">
<div class="row"> <div class="row">
<div class="col-md-11 col-md-offset-1"> <div class="col-md-11 col-md-offset-1">
<div class="panel panel-default"> <div class="panel panel-default">
@ -43,7 +57,7 @@
@elseif($d->count()) @elseif($d->count())
@php($src = $d->first()) @php($src = $d->first())
{!! $src->view() !!} {!! $src->view() !!}
<table class="table table-striped table-condensed 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>{!! $src->{$v[1]} !!}</td></tr>
@endforeach @endforeach
@ -76,5 +90,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> @endsection
@endsection

View File

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

View File

@ -1,16 +0,0 @@
<!-- resources/views/common/errors.blade.php -->
@if (count($errors) > 0)
<!-- Form Error List -->
<div class="alert alert-danger">
<strong>Whoops! Something went wrong!</strong>
<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif

View File

@ -1,47 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Be right back.</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
<style>
html, body {
height: 100%;
}
body {
margin: 0;
padding: 0;
width: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
</div>
</div>
</body>
</html>

View File

@ -18,7 +18,7 @@
@include('widgets.summary.boxes') @include('widgets.summary.boxes')
</div> </div>
</div> {{--
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
@ -33,4 +33,5 @@
</div> </div>
</div> </div>
</div> </div>
--}}
@endsection @endsection

View File

@ -1,85 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Photo</title>
<!-- Fonts -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700">
<!-- Styles -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
{{-- <link href="{{ elixir('css/app.css') }}" rel="stylesheet"> --}}
<style>
body {
font-family: 'Lato';
}
.fa-btn {
margin-right: 6px;
}
</style>
</head>
<body id="app-layout">
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<!-- Collapsed Hamburger -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Branding Image -->
<a class="navbar-brand" href="{{ url('/') }}">
Photo
</a>
</div>
<div class="collapse navbar-collapse" id="app-navbar-collapse">
<!-- Left Side Of Navbar -->
<ul class="nav navbar-nav">
<li><a href="{{ url('/p/deletes') }}">Photo Deletes</a></li>
<li><a href="{{ url('/p/duplicates') }}">Photo Duplicates</a></li>
<li><a href="{{ url('/v/deletes') }}">Video Deletes</a></li>
<li><a href="{{ url('/v/duplicates') }}">Video Duplicates</a></li>
</ul>
<!-- Right Side Of Navbar -->
<ul class="nav navbar-nav navbar-right">
<!-- Authentication Links -->
@if (Auth::guest())
<li><a href="{{ url('/login') }}">Login</a></li>
<li><a href="{{ url('/register') }}">Register</a></li>
@else
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ url('/logout') }}"><i class="fa fa-btn fa-sign-out"></i>Logout</a></li>
</ul>
</li>
@endif
</ul>
</div>
</div>
</nav>
@yield('content')
<!-- JavaScripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js" integrity="sha384-I6F5OKECLVtK/BL+8iSLDEHowSAfUo76ZL9+kGAgTRdiByINKJaqTPH/QVNS1VDb" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
{{-- <script src="{{ elixir('js/app.js') }}"></script> --}}
</body>
</html>

View File

@ -1,7 +1,20 @@
@extends('adminlte::layouts.app') @extends('adminlte::layouts.app')
@section('htmlheader_title')
Photo - {{ $o->id }}
@endsection
@section('contentheader_title')
Photo
@endsection
@section('contentheader_description')
#{{ $o->id }}
@endsection
@section('page_title')
#{{ $o->id }}
@endsection
@section('main-content') @section('main-content')
<div class="container">
<div class="row"> <div class="row">
<div class="col-md-10 col-md-offset-1"> <div class="col-md-10 col-md-offset-1">
<div class="panel panel-default"> <div class="panel panel-default">
@ -79,5 +92,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> @endsection
@endsection

View File

@ -0,0 +1,56 @@
<?php $data = [
'ID'=>['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'],
'Duplicate'=>['duplicate','duplicatecheckbox'],
'Flagged'=>['flag','flagcheckbox'],
'Delete'=>['remove','removecheckbox'],
];?>
<div class="card card-widget">
<div class="card-header">
<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>
<span class="description">{{ $o->date_created->toDateTimeString() }} [{{ $o->make }} {{ $o->model }} ({{ $o->software }})]</span>
</div>
<!-- /.user-block -->
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-card-widget="remove"><i class="fa fa-times"></i>
</button>
</div>
<!-- /.card-tools -->
</div>
<!-- /.card-body -->
<div class="card-body">
{!! $o->view() !!}
<span class="float-right text-muted">&nbsp;</span>
</div>
<!-- /.card-body -->
<div class="card-footer card-comments">
<div class="card-comment">
<div class="comment-text">
<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>
</div>
<!-- /.comment-text -->
</div>
<!-- /.card-comment -->
</div>
<!-- /.card-footer -->
<div class="card-footer">
</div>
<!-- /.card-footer -->
</div>

View File

@ -0,0 +1,28 @@
<li class="nav-header">MENU</li>
<li class="nav-item">
<a href="{{ url('home') }}" class="nav-link @if(preg_match('#^home/[0-9]+$#',request()->path()))active @endif">
<i class="nav-icon fa fa-home"></i> <p>Home</p>
</a>
</li>
<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>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="{{ url('p/duplicates') }}" class="nav-link @if(preg_match('#^p/duplicates$#',request()->path())) active @endif">
<i class="fa fa-link nav-icon"></i> <p>Duplicate</p>
<span class="badge badge-warning right">{{ \App\Models\Photo::where('duplicate',TRUE)->count() }}</span>
</a>
</li>
<li class="nav-item">
<a href="{{ url('p/deletes') }}" class="nav-link @if(preg_match('#^p/deletes$/'.'#',request()->path())) active @endif">
<i class="fa fa-calendar nav-icon"></i> <p>Delete</p>
<span class="badge badge-danger right">{{ \App\Models\Photo::where('remove',TRUE)->count() }}</span>
</a>
</li>
</ul>
</li>

View File

@ -1,10 +1,20 @@
<div class="col-12 col-sm-6 col-md-3"> <div class="col-12 col-sm-6 col-md-3">
<div class="info-box"> <div class="info-box bg-gradient-info">
<span class="info-box-icon bg-info elevation-1"><i class="fa fa-camera"></i></span> <span class="info-box-icon bg-info elevation-1"><i class="fa fa-camera"></i></span>
<div class="info-box-content"> <div class="info-box-content">
<span class="info-box-text">Photos</span> <span class="info-box-text">Photos</span>
<span class="info-box-number">{{ \App\Models\Photo::count() }}</span> <span class="info-box-number">{{ \App\Models\Photo::count() }}</span>
<div class="progress">
<span class="progress-bar" style="width: 100%"></span>
</div>
<span class="progress-description">
<table class="table table-borderless table-sm small">
<tr><td>To Scan</td><td>{{ \App\Models\Photo::NotScanned()->count() }}</td></tr>
<tr><td>Duplicate</td><td>{{ \App\Models\Photo::where('duplicate',TRUE)->count() }}</td></tr>
<tr><td>To Delete</td><td>{{ \App\Models\Photo::where('remove',TRUE)->count() }}</td></tr>
</table>
</span>
</div> </div>
<!-- /.info-box-content --> <!-- /.info-box-content -->
</div> </div>
@ -12,12 +22,22 @@
</div> </div>
<div class="col-12 col-sm-6 col-md-3"> <div class="col-12 col-sm-6 col-md-3">
<div class="info-box"> <div class="info-box bg-gradient-info">
<span class="info-box-icon bg-info elevation-1"><i class="fa fa-video-camera"></i></span> <span class="info-box-icon bg-info elevation-1"><i class="fa fa-video-camera"></i></span>
<div class="info-box-content"> <div class="info-box-content">
<span class="info-box-text">Videos</span> <span class="info-box-text">Videos</span>
<span class="info-box-number">{{ \App\Models\Video::count() }}</span> <span class="info-box-number">{{ \App\Models\Video::count() }}</span>
<div class="progress">
<span class="progress-bar" style="width: 100%"></span>
</div>
<span class="progress-description">
<table class="table table-borderless table-sm small">
<tr><td>To Scan</td><td>{{ \App\Models\Video::NotScanned()->count() }}</td></tr>
<tr><td>Duplicate</td><td>{{ \App\Models\Video::where('duplicate',TRUE)->count() }}</td></tr>
<tr><td>To Delete</td><td>{{ \App\Models\Video::where('remove',TRUE)->count() }}</td></tr>
</table>
</span>
</div> </div>
<!-- /.info-box-content --> <!-- /.info-box-content -->
</div> </div>

View File

@ -11,10 +11,7 @@
| |
*/ */
#Route::get('/', function () { Route::get('/home','HomeController@home');
# return view('welcome');
#});
Route::get('/p/deletes/{id?}','PhotoController@deletes')->where('id','[0-9]+'); 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]+');