More Laravel/AdminLTE updates
This commit is contained in:
parent
6a17fd3716
commit
bafc34b1c0
63
app/Console/Commands/PhotoAutoDelete.php
Normal file
63
app/Console/Commands/PhotoAutoDelete.php
Normal 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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
15
app/Http/Controllers/HomeController.php
Normal file
15
app/Http/Controllers/HomeController.php
Normal 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');
|
||||
}
|
||||
}
|
@ -10,12 +10,14 @@ use App\Models\{Person,Tag};
|
||||
|
||||
abstract class Catalog extends Model
|
||||
{
|
||||
public function People()
|
||||
protected $dates = ['date_created'];
|
||||
|
||||
public function people()
|
||||
{
|
||||
return $this->belongsToMany(Person::class);
|
||||
}
|
||||
|
||||
public function Tags()
|
||||
public function tags()
|
||||
{
|
||||
return $this->belongsToMany(Tag::class);
|
||||
}
|
||||
@ -29,7 +31,7 @@ abstract class Catalog extends Model
|
||||
{
|
||||
return $query->where(function($query)
|
||||
{
|
||||
$query->where('duplicate','!=',TRUE)
|
||||
$query->where('duplicate','<>',TRUE)
|
||||
->orWhere('duplicate','=',NULL);
|
||||
});
|
||||
}
|
||||
@ -43,7 +45,7 @@ abstract class Catalog extends Model
|
||||
{
|
||||
return $query->where(function($query)
|
||||
{
|
||||
$query->where('remove','!=',TRUE)
|
||||
$query->where('remove','<>',TRUE)
|
||||
->orWhere('remove','=',NULL);
|
||||
});
|
||||
}
|
||||
@ -57,7 +59,7 @@ abstract class Catalog extends Model
|
||||
{
|
||||
return $query->where(function($query)
|
||||
{
|
||||
$query->where('scanned','!=',TRUE)
|
||||
$query->where('scanned','<>',TRUE)
|
||||
->orWhere('scanned','=',NULL);
|
||||
});
|
||||
}
|
||||
@ -72,14 +74,16 @@ abstract class Catalog extends Model
|
||||
|
||||
/**
|
||||
* 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 the date of the file
|
||||
* @todo return Carbon date or NULL
|
||||
*/
|
||||
public function file_date($type,$format=FALSE)
|
||||
{
|
||||
@ -101,6 +105,7 @@ abstract class Catalog extends Model
|
||||
|
||||
/**
|
||||
* Determine the new name for the image
|
||||
* @todo Make Generic for Photo and Video
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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,'/'),'/');
|
||||
}
|
||||
@ -131,37 +136,18 @@ abstract class Catalog extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the photo size
|
||||
* Return the file size
|
||||
* @deprecated
|
||||
*/
|
||||
public function file_size()
|
||||
{
|
||||
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
|
||||
*/
|
||||
public function getDimensionsAttribute()
|
||||
public function getDimensionsAttribute(): string
|
||||
{
|
||||
return $this->width.'x'.$this->height;
|
||||
}
|
||||
@ -174,6 +160,16 @@ abstract class Catalog extends Model
|
||||
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
|
||||
*/
|
||||
@ -182,6 +178,22 @@ abstract class Catalog extends Model
|
||||
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
|
||||
*/
|
||||
@ -193,11 +205,19 @@ abstract class Catalog extends Model
|
||||
/**
|
||||
* 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 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
|
||||
*/
|
||||
@ -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)
|
||||
{
|
||||
return sprintf('<input type="checkbox" name="%s[%s]" value="1"%s>',$name,$id,$value ? ' checked="checked"' : '');
|
||||
}
|
||||
|
||||
public function isParentWritable($dir)
|
||||
public function isParentWritable($dir): bool
|
||||
{
|
||||
if (file_exists($dir) AND is_writable($dir) AND is_dir($dir))
|
||||
return TRUE;
|
||||
|
||||
elseif ($dir == dirname($dir) OR file_exists($dir))
|
||||
return FALSE;
|
||||
|
||||
else
|
||||
return ($this->isParentWritable(dirname($dir)));
|
||||
}
|
||||
@ -228,6 +248,7 @@ abstract class Catalog extends Model
|
||||
* Determine if a file is moveable
|
||||
*
|
||||
* 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()
|
||||
{
|
||||
@ -270,7 +291,7 @@ abstract class Catalog extends Model
|
||||
/**
|
||||
* Return my class shortname
|
||||
*/
|
||||
public function objectType()
|
||||
public function objectType(): string
|
||||
{
|
||||
return (new \ReflectionClass($this))->getShortName();
|
||||
}
|
||||
@ -301,24 +322,49 @@ abstract class Catalog extends Model
|
||||
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
|
||||
*/
|
||||
public function shouldMove()
|
||||
public function shouldMove(): boolean
|
||||
{
|
||||
return ($this->filename != $this->file_path(TRUE,TRUE));
|
||||
}
|
||||
|
||||
protected function TextTrueFalse($value)
|
||||
protected function TextTrueFalse($value): string
|
||||
{
|
||||
return $value ? 'TRUE' : 'FALSE';
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Check if this is redundant
|
||||
*
|
||||
* @param bool $includeme
|
||||
* @return mixed
|
||||
*/
|
||||
public function list_duplicate($includeme=FALSE)
|
||||
{
|
||||
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
|
||||
* @todo Optimise this query
|
||||
*/
|
||||
public function list_duplicates($includeme=FALSE)
|
||||
{
|
||||
@ -338,7 +385,7 @@ abstract class Catalog extends Model
|
||||
if (! $includeme)
|
||||
$o->where(function($query)
|
||||
{
|
||||
$query->where('remove','!=',TRUE)
|
||||
$query->where('remove','<>',TRUE)
|
||||
->orWhere('remove','=',NULL);
|
||||
});
|
||||
|
||||
|
@ -22,13 +22,14 @@ class Photo extends Abstracted\Catalog
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the new name for the image
|
||||
* @todo Implement in Parent
|
||||
*/
|
||||
public function file_path($short=FALSE,$new=FALSE)
|
||||
{
|
||||
|
6
composer.lock
generated
6
composer.lock
generated
@ -1330,11 +1330,11 @@
|
||||
},
|
||||
{
|
||||
"name": "leenooks/laravel",
|
||||
"version": "6.0.5",
|
||||
"version": "6.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://dev.leenooks.net/leenooks/laravel",
|
||||
"reference": "1096f0e28d489524c9c2134f3d7319530370673c"
|
||||
"reference": "1774987deadcf9e3124b8589f7f8a60541f5953d"
|
||||
},
|
||||
"require": {
|
||||
"creativeorange/gravatar": "^1.0",
|
||||
@ -1371,7 +1371,7 @@
|
||||
"laravel",
|
||||
"leenooks"
|
||||
],
|
||||
"time": "2019-10-30T06:31:32+00:00"
|
||||
"time": "2019-11-22T03:22:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "maximebf/debugbar",
|
||||
|
15
public/css/adminlte.min.css
vendored
15
public/css/adminlte.min.css
vendored
File diff suppressed because one or more lines are too long
0
public/css/custom.css
vendored
Normal file
0
public/css/custom.css
vendored
Normal file
13
public/css/fixes.css
vendored
13
public/css/fixes.css
vendored
@ -60,11 +60,18 @@ div.login-box .input-group .input-group-append span.fa {
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 0.85em;
|
||||
font-size: 0.65em;
|
||||
}
|
||||
|
||||
/* Change brand logo on collapse */
|
||||
body.sidebar-mini.sidebar-collapse img.brand-image.img-circle.elevation-3 {
|
||||
margin-left: 0px;
|
||||
max-height: 25px;
|
||||
/* margin-left: 0px; */
|
||||
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 |
8
public/js/adminlte.min.js
vendored
8
public/js/adminlte.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
Click here to reset your password: <a href="{{ $link = url('password/reset', $token).'?email='.urlencode($user->getEmailForPasswordReset()) }}"> {{ $link }} </a>
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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 = [
|
||||
'ID'=>['id','idlink'],
|
||||
@ -13,7 +27,7 @@
|
||||
];?>
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-md-offset-1">
|
||||
<div class="panel panel-default">
|
||||
@ -43,7 +57,7 @@
|
||||
@elseif($d->count())
|
||||
@php($src = $d->first())
|
||||
{!! $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)
|
||||
<tr><th>{{$k}}</th><td>{!! $src->{$v[1]} !!}</td></tr>
|
||||
@endforeach
|
||||
@ -76,5 +90,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -1,82 +1,80 @@
|
||||
@extends('adminlte::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('htmlheader_title')
|
||||
Duplicates
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
Review Duplicate Items
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
{{ $catalog->count() }} to review
|
||||
@endsection
|
||||
@section('page_title')
|
||||
Duplicates
|
||||
@endsection
|
||||
|
||||
@section('main-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">
|
||||
<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)
|
||||
<form action="{{ $return }}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<table class="table table-striped table-sm table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-50">Source</th>
|
||||
<th class="w-50">Remove</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php $c=0; @endphp
|
||||
@foreach ($catalog as $o)
|
||||
@php
|
||||
$d=$o->list_duplicates(TRUE); $src=[];
|
||||
@endphp
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<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>
|
||||
@include('photo.widgets.thumbnail',['o'=>$src])
|
||||
@endif
|
||||
</td>
|
||||
|
||||
@if ($d->count() == 1)
|
||||
<td>
|
||||
No other duplicates found?
|
||||
</td>
|
||||
@continue
|
||||
|
||||
@else
|
||||
@foreach($d as $item)
|
||||
<input type="hidden" name="items[]" value="{{ $item->id }}">
|
||||
@if($src AND $item->id == $src->id) @continue @endif
|
||||
@if($loop->first) @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>
|
||||
<input type="hidden" name="items[]" value="{{ $item->id }}">
|
||||
XX
|
||||
@include('photo.widgets.thumbnail',['o'=>$src])
|
||||
</td>
|
||||
@endforeach
|
||||
@endif
|
||||
</tr>
|
||||
</tbody>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="pagenext" value="{{ $catalog->hasMorePages() ? $catalog->currentPage()+1 : NULL }}">
|
||||
<button class="btn btn-default">Update</button>
|
||||
{{ csrf_field() }}
|
||||
<button class="btn btn-primary">Update</button>
|
||||
</form>
|
||||
@else
|
||||
NONE!
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -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
|
@ -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>
|
@ -18,7 +18,7 @@
|
||||
@include('widgets.summary.boxes')
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{--
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
@ -33,4 +33,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
--}}
|
||||
@endsection
|
@ -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>
|
@ -1,7 +1,20 @@
|
||||
@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')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<div class="panel panel-default">
|
||||
@ -79,5 +92,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
56
resources/views/photo/widgets/thumbnail.blade.php
Normal file
56
resources/views/photo/widgets/thumbnail.blade.php
Normal 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"> </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>
|
28
resources/views/vendor/adminlte/layouts/partials/sidebarmenu.blade.php
vendored
Normal file
28
resources/views/vendor/adminlte/layouts/partials/sidebarmenu.blade.php
vendored
Normal 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>
|
@ -1,10 +1,20 @@
|
||||
<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>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Photos</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>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
@ -12,12 +22,22 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Videos</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>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
|
@ -11,10 +11,7 @@
|
||||
|
|
||||
*/
|
||||
|
||||
#Route::get('/', function () {
|
||||
# return view('welcome');
|
||||
#});
|
||||
|
||||
Route::get('/home','HomeController@home');
|
||||
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]+');
|
||||
|
Loading…
Reference in New Issue
Block a user