This commit is contained in:
Kekskurse 2021-01-12 18:17:36 +01:00
parent d4258392dd
commit 907bbc7967
2 changed files with 6 additions and 2 deletions

View file

@ -35,6 +35,10 @@ class PublicController extends BaseController
$tenant = Tenant::query()->where("url", "=", $tenant)->firstOrFail();
$gallery = Gallery::getByTenantAndUrl($tenant->id, $gallery);
$images = Image::query()->where("gallery", "=", $gallery->id)->get();
$domains = explode(",", env("DOMAINS", "localhost"));
foreach($images as $image) {
$image->domain = $domains[array_rand($domains)];
}
return view("themes.gallery.default.list", ["gallery" => $gallery, "tenant" => $tenant, "images" => $images]);
}

View file

@ -7,8 +7,8 @@
<div id="mygallery">
@foreach($images as $image)
<a href="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file">
<img style="height: 200px;" alt="{{ $image->filename }}" src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file"/>
<a href="{{$image->domain}}/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file">
<img style="height: 200px;" alt="{{ $image->filename }}" src="{{$image->domain}}/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file"/>
</a>
@endforeach
</div>