Updates for Videos

This commit is contained in:
Deon George
2019-12-15 23:34:42 +11:00
parent 075d31e9f4
commit 49933382f3
14 changed files with 376 additions and 254 deletions

View File

@@ -8,7 +8,9 @@
Photo #{{ $o->id }}
@endsection
@section('contentheader_description')
@if($o->duplicate)<button class="btn btn-sm btn-warning">DUPLICATE</button>@endif @if($o->remove)<button class="btn btn-sm btn-danger">PENDING DELETE</button>@endif
@if(! $o->scanned)<button class="btn btn-sm btn-info">TO SCAN</button>@endif
@if($o->duplicate)<button class="btn btn-sm btn-warning">DUPLICATE</button>@endif
@if($o->remove)<button class="btn btn-sm btn-danger">PENDING DELETE</button>@endif
@endsection
@section('page_title')
#{{ $o->id }}
@@ -17,7 +19,7 @@
@section('main-content')
<div class="row">
<div class="col-3">
<a href="{{ url('p/view',$o->id) }}"><img class="p-3" src="{{ url('p/thumbnail',$o->id) }}"></a>
<a href="{{ url('p/view',$o->id) }}">{!! $o->getHtmlImageURL() !!}</a>
<span class="pagination justify-content-center">
<nav>
@@ -51,15 +53,15 @@
<dt>Date Taken</dt><dd>{{ $o->date_taken() }}<dd>
<dt>Camera</dt><dd>{{ $o->device() }}<dd>
<hr>
<dt>Location</dt><dd>
@if($o->gps() == 'UNKNOWN')
UNKNOWN
@else
<div id="map" style="width: 400px; height: 300px"></div>
@endif
<dt>Location</dt>
<dd>
@if($o->gps() == 'UNKNOWN')
UNKNOWN
@else
<div id="map" style="width: 400px; height: 300px"></div>
@endif
</dd>
<br/>
<hr>
<dt>Exif Data</dt><dd>
<table>
@foreach ($o->properties() as $k => $v)
@@ -67,19 +69,28 @@
@endforeach
</table>
</dd>
<hr>
@if($x = $o->duplicates()->get())
<dt>Duplicates</dt>
<dd>
@foreach($x as $oo)
@if(! $loop->first)| @endif
{!! $oo->id_link !!}
@endforeach
</dd>
@endif
</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
{{ csrf_field() }}
</form>
</div>
</div>

View File

@@ -18,6 +18,7 @@
<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>
@@ -25,4 +26,26 @@
</a>
</li>
</ul>
</li>
<li class="pt-3 nav-item has-treeview @if(preg_match('#^v/(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">
<i class="nav-icon fa fa-video-camera"></i> <p>VIDEOS<i class="fa fa-angle-left right"></i></p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="{{ url('v/duplicates') }}" class="nav-link @if(preg_match('#^v/duplicates$#',request()->path())) active @endif">
<i class="fa fa-link nav-icon"></i> <p>Duplicate</p>
<span class="badge badge-warning right">{{ \App\Models\Video::where('duplicate',TRUE)->count() }}</span>
</a>
</li>
<li class="nav-item">
<a href="{{ url('v/deletes') }}" class="nav-link @if(preg_match('#^v/deletes$/'.'#',request()->path())) active @endif">
<i class="fa fa-calendar nav-icon"></i> <p>Delete</p>
<span class="badge badge-danger right">{{ \App\Models\Video::where('remove',TRUE)->count() }}</span>
</a>
</li>
</ul>
</li>

View File

@@ -1,90 +1,116 @@
@extends('layouts.app')
@extends('adminlte::layouts.app')
@section('content')
<div class="container">
@section('htmlheader_title')
Video - {{ $o->id }}
@endsection
@section('contentheader_title')
Video #{{ $o->id }}
@endsection
@section('contentheader_description')
@if(! $o->scanned)<button class="btn btn-sm btn-info">TO SCAN</button>@endif
@if($o->duplicate)<button class="btn btn-sm btn-warning">DUPLICATE</button>@endif
@if($o->remove)<button class="btn btn-sm btn-danger">PENDING DELETE</button>@endif
@endsection
@section('page_title')
#{{ $o->id }}
@endsection
@section('main-content')
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
Video {{ $video->id }}<?php if ($video->remove) : ?> - <strong>PENDING DELETE</strong><?php endif?><?php if ($video->duplicate) : ?> - <strong>DUPLICATE</strong><?php endif?>
</div>
<div class="col-4">
<a href="{{ url('p/view',$o->id) }}">{!! $o->getHtmlImageURL() !!}</a>
<div class="panel-body">
<div class="col-md-4">
<div class="text-center">
{!! $video->view() !!}
<ul class="pagination">
<li <?php if (! $x = $video->previous()) : ?>class="disabled"<?php endif ?>><a href="{{ $x ? url('/v/info/'.$x->id) : '#' }}">&lt;&lt;</a></li>
<li <?php if (! $x = $video->next()) : ?>class="disabled"<?php endif ?>><a href="{{ $x ? url('/v/info/'.$x->id) : '#' }}">&gt;&gt;</a></li>
</ul>
</div>
<span class="pagination justify-content-center">
<nav>
<ul class="pagination">
<li class="page-item @if(! $x=$o->previous())disabled @endif" aria-disabled="@if(! $x)true @else false @endif" aria-label="&laquo; Previous">
<a class="page-link" href="{{ $x ? url('p/info',$x->id) : '#' }}">&lt;&lt;</a>
</li>
</div>
<div class="col-md-8">
<div class="dl-horizontal">
<dt>Signature</dt><dd>{{ $video->signature(TRUE) }}</dd>
<dt>Filename</dt><dd>{{ $video->file_path(TRUE) }}<dd>
<?php if ($video->shouldMove()) : ?>
<dt>NEW Filename</dt><dd>{{ $video->file_path(TRUE,TRUE) }}<dd>
<?php endif ?>
<dt>Size</dt><dd>{{ $video->file_size() }}<dd>
<dt>Dimensions</dt><dd>{{ $video->width }} x {{ $video->height }}<dd>
<dt>Length</dt><dd>{{ $video->length }}<dd>
<dt>Type</dt><dd>{{ $video->type }}<dd>
<dt>Codec</dt><dd>{{ $video->codec }}<dd>
<dt>Audio Channels</dt><dd>{{ $video->audiochannels }}<dd>
<dt>Channels Mode</dt><dd>{{ $video->channelmode }}<dd>
<dt>Sample Rate</dt><dd>{{ $video->samplerate }}<dd>
<br/>
<dt>Date Taken</dt><dd>{{ $video->date_taken() }}<dd>
<dt>Camera</dt><dd>{{ $video->make }}<dd>
<dt>Model</dt><dd>{{ $video->model }}<dd>
<dt>Software</dt><dd>{{ $video->software }}<dd>
<dt>Identifier</dt><dd>{{ $video->identifier }}<dd>
<br/>
<dt>Location</dt><dd>
<?php if ($video->gps() == 'UNKNOWN') : ?>
UNKNOWN
<?php else : ?>
<div id="map" style="width: 400px; height: 300px"></div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var myLatLng = {lat: {{ $video->gps_lat }}, lng: {{ $video->gps_lon }}};
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 16,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var marker = new google.maps.Marker({
map: map,
position: myLatLng,
});
</script>
<?php endif ?>
</dd>
@if($x = $video->list_duplicate())
<dt>Duplicates</dt><dd>
@php
$y=''; foreach($video->list_duplicate() as $id) $y.=($y ? '|' : '').sprintf('<a href="%s">%s</a>',url('/v/info/'.$id),$id);
echo($y);
@endphp
</dd>
@endif
</div>
</div>
<li class="page-item active" aria-current="page"><span class="page-link">{{ $o->id }}</span></li>
<?php if ($video->remove) : ?>
<form action="{{ url('/v/undelete/'.$video->id) }}" method="POST">
<button class="btn btn-default">Undelete</button>
<?php else : ?>
<form action="{{ url('/v/delete/'.$video->id) }}" method="POST">
<button class="btn btn-default">Delete</button>
<?php endif ?>
{{ csrf_field() }}
</form>
</div>
<li class="page-item @if(! $x=$o->next())disabled @endif" aria-disabled="@if(! $x)true @else false @endif" aria-label="&laquo; Previous">
<a class="page-link" href="{{ $x ? url('p/info',$x->id) : '#' }}">&gt;&gt;</a>
</li>
</ul>
</nav>
</span>
</div>
<div class="col-8">
<div class="dl-horizontal">
<dt>Signature</dt><dd>{{ $o->signature(TRUE) }}</dd>
<dt>Filename</dt><dd>{{ $o->file_path(TRUE) }}<dd>
@if ($o->shouldMove())
<dt>NEW Filename</dt><dd>{{ $o->file_path(TRUE,TRUE) }}<dd>
@endif
<dt>Size</dt><dd>{{ $o->file_size() }}<dd>
<dt>Dimensions</dt><dd>{{ $o->dimensions }}<dd>
<dt>Length</dt><dd>{{ $o->length }}<dd>
<dt>Type</dt><dd>{{ $o->type }}<dd>
<dt>Codec</dt><dd>{{ $o->codec }}<dd>
<dt>Audio Channels</dt><dd>{{ $o->audiochannels }}<dd>
<dt>Channels Mode</dt><dd>{{ $o->channelmode }}<dd>
<dt>Sample Rate</dt><dd>{{ $o->samplerate }}<dd>
<hr>
<dt>Date Taken</dt><dd>{{ $o->date_taken() }}<dd>
<dt>Camera</dt><dd>{{ $o->make }}<dd>
<dt>Model</dt><dd>{{ $o->model }}<dd>
<dt>Software</dt><dd>{{ $o->software }}<dd>
<dt>Identifier</dt><dd>{{ $o->identifier }}<dd>
<hr>
<dt>Location</dt>
<dd>
@if($o->gps() == 'UNKNOWN')
UNKNOWN
@else
<div id="map" style="width: 400px; height: 300px"></div>
@endif
</dd>
@if($x = $o->duplicates()->get())
<dt>Duplicates</dt>
<dd>
@foreach($x as $oo)
@if(! $loop->first)| @endif
{!! $oo->id_link !!}
@endforeach
</dd>
@endif
</div>
@if ($o->remove)
<form action="{{ url('v/undelete',$o->id) }}" method="POST">
<button class="btn btn-primary">Undelete</button>
@else
<form action="{{ url('v/delete',$o->id) }}" method="POST">
<button class="btn btn-danger">Delete</button>
@endif
{{ csrf_field() }}
</form>
</div>
</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"), {
zoom: 16,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var marker = new google.maps.Marker({
map: map,
position: myLatLng,
});
</script>
@endif
@append