Added some stock photos (royalty free from pexels.com) for empty albums and to replace the fuel gauge on the main screen.
This commit is contained in:
parent
1946734b58
commit
d0803b37d9
@ -70,8 +70,14 @@ class Album extends Model
|
|||||||
{
|
{
|
||||||
return $this->getAlbumSource()->getUrlToPhoto($photo, $thumbnailName);
|
return $this->getAlbumSource()->getUrlToPhoto($photo, $thumbnailName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
// Rotate standard images
|
||||||
|
$images = [
|
||||||
|
asset('themes/base/images/empty-album-1.jpg'),
|
||||||
|
asset('themes/base/images/empty-album-2.jpg'),
|
||||||
|
asset('themes/base/images/empty-album-3.jpg')
|
||||||
|
];
|
||||||
|
return $images[rand(0, count($images) - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function url()
|
public function url()
|
||||||
|
@ -38,17 +38,23 @@ class AlbumController extends Controller
|
|||||||
|
|
||||||
$this->authorizeForUser($this->getUser(), 'album.view', $album);
|
$this->authorizeForUser($this->getUser(), 'album.view', $album);
|
||||||
|
|
||||||
// The slideshow view needs access to all photos, not paged
|
if ($album->photos()->count() == 0)
|
||||||
$photos = $album->photos()
|
|
||||||
->orderBy(DB::raw('COALESCE(taken_at, created_at)'));
|
|
||||||
|
|
||||||
if ($requestedView != 'slideshow')
|
|
||||||
{
|
{
|
||||||
$photos = $photos->paginate(UserConfig::get('items_per_page'));
|
$requestedView = 'empty';
|
||||||
|
$photos = [];
|
||||||
|
}
|
||||||
|
else if ($requestedView != 'slideshow')
|
||||||
|
{
|
||||||
|
$photos = $album->photos()
|
||||||
|
->orderBy(DB::raw('COALESCE(taken_at, created_at)'))
|
||||||
|
->paginate(UserConfig::get('items_per_page'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$photos = $photos->get();
|
// The slideshow view needs access to all photos, not paged
|
||||||
|
$photos = $album->photos()
|
||||||
|
->orderBy(DB::raw('COALESCE(taken_at, created_at)'))
|
||||||
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Theme::render(sprintf('gallery.album_%s', $requestedView), [
|
return Theme::render(sprintf('gallery.album_%s', $requestedView), [
|
||||||
|
BIN
public/themes/base/images/empty-album-1.jpg
Normal file
BIN
public/themes/base/images/empty-album-1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
BIN
public/themes/base/images/empty-album-2.jpg
Normal file
BIN
public/themes/base/images/empty-album-2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
BIN
public/themes/base/images/empty-album-3.jpg
Normal file
BIN
public/themes/base/images/empty-album-3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 62 KiB |
BIN
public/themes/base/images/smartphone-photo.jpg
Normal file
BIN
public/themes/base/images/smartphone-photo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
public/themes/base/images/take-a-photo.jpg
Normal file
BIN
public/themes/base/images/take-a-photo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 190 KiB |
Binary file not shown.
Before Width: | Height: | Size: 19 KiB |
@ -1,10 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
|
'album_no_results_heading' => 'Let\'s get snapping!',
|
||||||
|
'album_no_results_text' => 'This album is currently empty. If you are the owner of this album, you can upload photos using the :admin_link.',
|
||||||
|
'album_no_results_text_2' => 'Did you know you can upload photos straight from your smartphone or tablet. Simply access the above link on your device.',
|
||||||
'album_views' => [
|
'album_views' => [
|
||||||
'default' => 'Default',
|
'default' => 'Default',
|
||||||
'slideshow' => 'Slideshow'
|
'slideshow' => 'Slideshow'
|
||||||
],
|
],
|
||||||
'back_to_album' => 'Back to :name',
|
'back_to_album' => 'Back to :name',
|
||||||
'index_no_results_heading' => 'This gallery is empty!',
|
'index_no_results_heading' => 'Start something amazing',
|
||||||
'index_no_results_text' => 'If you are the owner of this gallery, you can create new albums and upload photos using the :admin_link.'
|
'index_no_results_text' => 'This gallery is currently empty. If you are the owner of this gallery, you can create new albums and upload photos using the :admin_link.'
|
||||||
];
|
];
|
27
resources/views/themes/base/gallery/album_empty.blade.php
Normal file
27
resources/views/themes/base/gallery/album_empty.blade.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@extends('themes.base.layout')
|
||||||
|
@section('title', $album->name)
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
<div class="breadcrumb">
|
||||||
|
<div class="container">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li><a href="{{ route('home') }}">@lang('navigation.breadcrumb.home')</a></li>
|
||||||
|
<li class="active">{{ $album->name }}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container album-container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-sm-8 col-sm-offset-2 text-center">
|
||||||
|
<h1>@lang('gallery.album_no_results_heading')</h1>
|
||||||
|
<p style="line-height: 1.6em;">@lang('gallery.album_no_results_text', ['admin_link' => sprintf('<a href="%s">%s</a>', route('admin'), trans('admin.title'))])</p>
|
||||||
|
<p style="margin-bottom: 30px; line-height: 1.6em;">@lang('gallery.album_no_results_text_2')</p>
|
||||||
|
|
||||||
|
<img src="{{ asset('themes/base/images/smartphone-photo.jpg') }}" class="img-responsive img-rounded" style="display: inline;" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -27,11 +27,11 @@
|
|||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@else
|
@else
|
||||||
<div class="col-xs-12 text-center">
|
<div class="col-xs-12 col-sm-8 col-sm-offset-2 text-center">
|
||||||
<img src="{{ $theme_url }}/images/empty-fuel-gauge.jpg" style="width: 300px;" />
|
|
||||||
|
|
||||||
<h1>@lang('gallery.index_no_results_heading')</h1>
|
<h1>@lang('gallery.index_no_results_heading')</h1>
|
||||||
<p>@lang('gallery.index_no_results_text', ['admin_link' => sprintf('<a href="%s">%s</a>', route('admin'), trans('admin.title'))])</p>
|
<p style="margin-bottom: 30px; line-height: 2em;">@lang('gallery.index_no_results_text', ['admin_link' => sprintf('<a href="%s">%s</a>', route('admin'), trans('admin.title'))])</p>
|
||||||
|
|
||||||
|
<img src="{{ asset('themes/base/images/take-a-photo.jpg') }}" class="img-responsive img-rounded" style="display: inline;" />
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user