This commit is contained in:
Kekskurse 2021-01-20 01:01:05 +01:00
parent 97e1efe20d
commit 5285d2c046
2 changed files with 17 additions and 3 deletions

View file

@ -18,7 +18,7 @@ class ImageDetails extends Migration
$table->dateTime("DateTimeOriginal")->nullable()->default(null); $table->dateTime("DateTimeOriginal")->nullable()->default(null);
$table->integer("rating")->default(100); $table->integer("rating")->default(100);
$table->string("name")->nullable()->default(null); $table->string("name")->nullable()->default(null);
$table->string("description")->nullable()->default(null); $table->mediumText("description")->nullable()->default(null);
}); });
} }

View file

@ -1,22 +1,36 @@
@extends('layout/template') @extends('layout/template')
@section('content') @section('content')
<div class="row" style="background-color: #607c89;min-height: calc(100vh - 200px);padding-top:20px;"> <div class="row" style="background-color: #607c89;min-height: calc(100vh - 300px);padding-top:20px;">
<div class="col-md-12" style="text-align: center;"> <div class="col-md-12" style="text-align: center;">
<div> <div>
<div class="fotorama" data-nav="thumbs" data-keyboard="true" data-ratio="800/600" data-width="1200" data-maxheight="80%" data-allowfullscreen="true"> <div class="fotorama" data-nav="thumbs" data-keyboard="true" data-ratio="800/600" data-width="1200" data-maxheight="80%" data-allowfullscreen="true">
@foreach($images as $image) @foreach($images as $image)
<a href="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=big"><img src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=pixel"></a> <a href="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=big" data-description="{{ $image->description }}" data-name="{{ $image->name }}"><img src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=pixel"></a>
@endforeach @endforeach
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<h1 id="filename"></h1>
<p id="description"></p>
</div>
</div>
@endsection @endsection
@section('js') @section('js')
<script>
$('.fotorama').on('fotorama:show', function (e, fotorama) {
console.log(e.type, fotorama.activeFrame);
$("#filename").html(fotorama.activeFrame.name);
$("#description").html(fotorama.activeFrame.description);
});
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script>
<style type="text/css"> <style type="text/css">