Added image view, next/previous and view update

This commit is contained in:
Deon George
2016-06-29 20:49:02 +10:00
parent 3361427c75
commit c5f0bfffd0
6 changed files with 168 additions and 42 deletions

View File

@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<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">
@@ -40,7 +40,7 @@
<!-- Branding Image -->
<a class="navbar-brand" href="{{ url('/') }}">
Laravel
Photo
</a>
</div>

View File

@@ -2,49 +2,81 @@
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Photo <?php echo $photo->id; ?></div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
Photo {{ $photo->id }}<?php if ($photo->remove) : ?> - <strong>PENDING DELETE</strong><?php endif?>
</div>
<div class="panel-body">
<div class="col-md-2"><img src="/thumbnail/<?php echo $photo->id; ?>" width="200px"></div>
<div class="col-md-10">
<div class="dl-horizontal">
<dt>Filename</dt><dd><?php echo $photo->file_path(TRUE); ?></dd>
<?php if ($photo->shouldMove()) : ?>
<dt>NEW Filename</dt><dd><?php echo $photo->file_path(TRUE,TRUE); ?></dd>
<?php endif ?>
<br/>
<dt>Date Taken</dt><dd><?php echo $photo->date_taken(); ?></dd>
<dt>Camera</dt><dd><?php echo $photo->make; ?></dd>
<dt>Model</dt><dd><?php echo $photo->model; ?></dd>
<br/>
<dt>Location</dt><dd>
<?php if ($photo->gps() == 'UNKNOWN') : ?>
UNKNOWN
<?php else : ?>
<div id="map" style="width: 400px; height: 300px"></div>
<div class="panel-body">
<div class="col-md-2">
<a href="{{ url('/view/'.$photo->id) }}"><img src="{{ url('/thumbnail/'.$photo->id) }}" width="200px"></a>
<div class="text-center">
<ul class="pagination">
<li <?php if (! $x = $photo->previous()) : ?>class="disabled"<?php endif ?>><a href="{{ $x ? url('/info/'.$x->id) : '#' }}">&lt;&lt;</a></li>
<li <?php if (! $x = $photo->next()) : ?>class="disabled"<?php endif ?>><a href="{{ $x ? url('/info/'.$x->id) : '#' }}">&gt;&gt;</a></li>
</ul>
</div>
</div>
<div class="col-md-10">
<div class="dl-horizontal">
<dt>Signature</dt><dd>{{ $photo->signature(TRUE) }}</dd>
<dt>Filename</dt><dd>{{ $photo->file_path(TRUE) }}<dd>
<?php if ($photo->shouldMove()) : ?>
<dt>NEW Filename</dt><dd>{{ $photo->file_path(TRUE,TRUE) }}<dd>
<?php endif ?>
<dt>Size</dt><dd>{{ $photo->size() }}<dd>
<br/>
<dt>Date Taken</dt><dd>{{ $photo->date_taken() }}<dd>
<dt>Camera</dt><dd>{{ $photo->make }}<dd>
<dt>Model</dt><dd>{{ $photo->model }}<dd>
<br/>
<dt>Location</dt><dd>
<?php if ($photo->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: <?php echo $photo->gps_lat; ?>, lng: <?php echo $photo->gps_lon; ?>};
var myLatLng = {lat: {{ $photo->gps_lat }}, lng: {{ $photo->gps_lon }}};
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 16,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
zoom: 16,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var marker = new google.maps.Marker({
map: map,
position: myLatLng,
map: map,
position: myLatLng,
});
</script>
<?php endif ?>
</dd>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif ?>
</dd>
<br/>
<dt>Exif Data</dt><dd>
<table>
<?php foreach ($photo->io()->getImageProperties() as $k => $v) : ?>
<?php if (in_array($k,['signature'])) continue ?>
<tr><th>{{ $k }}<><td>{{ $v }}<td></tr>
<?php endforeach ?>
</table>
</dd>
</div>
</div>
<?php if ($photo->remove) : ?>
<form action="{{ url('/undelete/'.$photo->id) }}" method="POST">
<button class="btn btn-default">Undelete</button>
<?php else : ?>
<form action="{{ url('/delete/'.$photo->id) }}" method="POST">
<button class="btn btn-default">Delete</button>
<?php endif ?>
{{ csrf_field() }}
</form>
</div>
</div>
</div>
</div>
</div>
@endsection