From 363f6d52f8aa85b0781db61dd6c77d91417e6c60 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Sun, 17 Sep 2017 11:49:36 +0100 Subject: [PATCH] #44, #45, #46: Number of small tweaks and fixes to the slideshow view. Label view causes an exception when no photos are tagged to that label. --- app/Http/Controllers/Gallery/AlbumController.php | 2 +- app/Http/Controllers/Gallery/LabelController.php | 2 +- public/css/blue-twilight.css | 4 ++++ public/css/blue-twilight.min.css | 2 +- resources/assets/css/gallery.css | 4 ++++ .../views/themes/base/gallery/album_slideshow.blade.php | 6 +++--- .../themes/base/partials/album_view_selector.blade.php | 9 ++++++++- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Gallery/AlbumController.php b/app/Http/Controllers/Gallery/AlbumController.php index 83909bb..2f4faa5 100644 --- a/app/Http/Controllers/Gallery/AlbumController.php +++ b/app/Http/Controllers/Gallery/AlbumController.php @@ -43,7 +43,7 @@ class AlbumController extends Controller $requestedView = strtolower($request->get('view')); if (!in_array($requestedView, $validViews)) { - $requestedView = $album->default_view; + $requestedView = strtolower($album->default_view); if (!in_array($requestedView, $validViews)) { diff --git a/app/Http/Controllers/Gallery/LabelController.php b/app/Http/Controllers/Gallery/LabelController.php index 1bca422..f6ee722 100644 --- a/app/Http/Controllers/Gallery/LabelController.php +++ b/app/Http/Controllers/Gallery/LabelController.php @@ -64,7 +64,7 @@ class LabelController extends Controller ->get(); } - if ($photos->count() == 0) + if (count($photos) == 0) { $requestedView = 'empty'; } diff --git a/public/css/blue-twilight.css b/public/css/blue-twilight.css index 1e936d6..6105dea 100644 --- a/public/css/blue-twilight.css +++ b/public/css/blue-twilight.css @@ -29,6 +29,10 @@ width: 800px; } +.album-slideshow-container #image-preview img { + max-width: 100%; +} + .album-slideshow-container .thumbnails { overflow-x: scroll; overflow-y: hidden; diff --git a/public/css/blue-twilight.min.css b/public/css/blue-twilight.min.css index b890f17..9bbbc54 100644 --- a/public/css/blue-twilight.min.css +++ b/public/css/blue-twilight.min.css @@ -1,4 +1,4 @@ -.admin-sidebar-card{margin-bottom:15px}.album-expand-handle{cursor:pointer;margin-top:5px}.photo .loading{background-color:#fff;display:none;height:100%;left:0;opacity:.8;position:absolute;text-align:center;top:0;width:100%;z-index:1000}.photo .loading img{margin-top:40px}.album-slideshow-container #image-preview{height:600px;max-width:100%;width:800px}.album-slideshow-container .thumbnails{overflow-x:scroll;overflow-y:hidden;white-space:nowrap;width:auto}.stats-table .icon-col{font-size:1.4em;width:20%;vertical-align:middle}.stats-table .stat-col{font-size:1.8em;font-weight:bold;width:40%}.stats-table .text-col{font-size:1.2em;vertical-align:middle;width:40%}html{font-size:14px !important}button,input,optgroup,select,textarea{cursor:pointer;font-family:inherit !important}.album-photo-cards .card{margin-bottom:15px}.container,.container-fluid{margin-top:20px}.hidden{display:none}.tab-content{border:solid 1px #ddd;border-top:0;padding:20px}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,0.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.tt-hint{color:#999}.tt-menu{width:422px;margin-top:4px;padding:4px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.tt-suggestion{padding:3px 20px;line-height:24px}.tt-suggestion.tt-cursor,.tt-suggestion:hover{color:#fff;background-color:#0097cf}.tt-suggestion p{margin:0}/*! +.admin-sidebar-card{margin-bottom:15px}.album-expand-handle{cursor:pointer;margin-top:5px}.photo .loading{background-color:#fff;display:none;height:100%;left:0;opacity:.8;position:absolute;text-align:center;top:0;width:100%;z-index:1000}.photo .loading img{margin-top:40px}.album-slideshow-container #image-preview{height:600px;max-width:100%;width:800px}.album-slideshow-container #image-preview img{max-width:100%}.album-slideshow-container .thumbnails{overflow-x:scroll;overflow-y:hidden;white-space:nowrap;width:auto}.stats-table .icon-col{font-size:1.4em;width:20%;vertical-align:middle}.stats-table .stat-col{font-size:1.8em;font-weight:bold;width:40%}.stats-table .text-col{font-size:1.2em;vertical-align:middle;width:40%}html{font-size:14px !important}button,input,optgroup,select,textarea{cursor:pointer;font-family:inherit !important}.album-photo-cards .card{margin-bottom:15px}.container,.container-fluid{margin-top:20px}.hidden{display:none}.tab-content{border:solid 1px #ddd;border-top:0;padding:20px}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,0.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.tt-hint{color:#999}.tt-menu{width:422px;margin-top:4px;padding:4px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.tt-suggestion{padding:3px 20px;line-height:24px}.tt-suggestion.tt-cursor,.tt-suggestion:hover{color:#fff;background-color:#0097cf}.tt-suggestion p{margin:0}/*! * Bootstrap v4.0.0-beta (https://getbootstrap.com) * Copyright 2011-2017 The Bootstrap Authors * Copyright 2011-2017 Twitter, Inc. diff --git a/resources/assets/css/gallery.css b/resources/assets/css/gallery.css index 62f41e8..8d499c1 100644 --- a/resources/assets/css/gallery.css +++ b/resources/assets/css/gallery.css @@ -4,6 +4,10 @@ width: 800px; } +.album-slideshow-container #image-preview img { + max-width: 100%; +} + .album-slideshow-container .thumbnails { overflow-x: scroll; overflow-y: hidden; diff --git a/resources/views/themes/base/gallery/album_slideshow.blade.php b/resources/views/themes/base/gallery/album_slideshow.blade.php index f0cd0f1..f31dcf5 100644 --- a/resources/views/themes/base/gallery/album_slideshow.blade.php +++ b/resources/views/themes/base/gallery/album_slideshow.blade.php @@ -30,9 +30,9 @@
-
- - +
+ +
diff --git a/resources/views/themes/base/partials/album_view_selector.blade.php b/resources/views/themes/base/partials/album_view_selector.blade.php index 66f36f1..fd9ef47 100644 --- a/resources/views/themes/base/partials/album_view_selector.blade.php +++ b/resources/views/themes/base/partials/album_view_selector.blade.php @@ -12,9 +12,16 @@ @push('scripts') @endpush \ No newline at end of file