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:
Andy Heathershaw 2016-10-06 16:21:27 +01:00
parent 1946734b58
commit d0803b37d9
11 changed files with 57 additions and 15 deletions

View File

@ -70,8 +70,14 @@ class Album extends Model
{
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()

View File

@ -38,17 +38,23 @@ class AlbumController extends Controller
$this->authorizeForUser($this->getUser(), 'album.view', $album);
// The slideshow view needs access to all photos, not paged
$photos = $album->photos()
->orderBy(DB::raw('COALESCE(taken_at, created_at)'));
if ($requestedView != 'slideshow')
if ($album->photos()->count() == 0)
{
$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
{
$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), [

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,10 +1,13 @@
<?php
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' => [
'default' => 'Default',
'slideshow' => 'Slideshow'
],
'back_to_album' => 'Back to :name',
'index_no_results_heading' => 'This gallery is empty!',
'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_heading' => 'Start something amazing',
'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.'
];

View 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

View File

@ -27,11 +27,11 @@
</div>
@endforeach
@else
<div class="col-xs-12 text-center">
<img src="{{ $theme_url }}/images/empty-fuel-gauge.jpg" style="width: 300px;" />
<div class="col-xs-12 col-sm-8 col-sm-offset-2 text-center">
<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>
@endif
</div>