diff --git a/app/controllers/ImagesController.php b/app/controllers/ImagesController.php index 8aae15b9..1ac3fc04 100644 --- a/app/controllers/ImagesController.php +++ b/app/controllers/ImagesController.php @@ -3,6 +3,7 @@ use Entities\Image; use Entities\Track; use Illuminate\Support\Facades\App; + use Illuminate\Support\Facades\Redirect; class ImagesController extends Controller { public function getImage($id, $type) { @@ -18,6 +19,11 @@ $response = Response::make('', 200); $filename = $image->getFile($coverType['id']); + if (!is_file($filename)) { + $redirect = URL::to('/images/icons/profile_' . Image::$ImageTypes[$coverType['id']]['name'] . '.png'); + return Redirect::to($redirect); + } + if (Config::get('app.sendfile')) { $response->header('X-Sendfile', $filename); } else { diff --git a/app/library/Gravatar.php b/app/library/Gravatar.php index 32091437..dd1b69a3 100644 --- a/app/library/Gravatar.php +++ b/app/library/Gravatar.php @@ -1,5 +1,8 @@ + (scope, element, attrs) -> + size = attrs.pfmSrcSize || 'normal' + url = attrs.pfmSrcLoader + + element.attr 'src', '/images/icons/loading_' + size + '.png' + + image = element.clone() + image.removeAttr 'pfm-src-loader' + image.removeAttr 'pfm-src-size' + + image[0].onload = -> + element.replaceWith image + image.css {opacity: 0} + image.animate {opacity: 1}, 250 + + image[0].src = url \ No newline at end of file diff --git a/public/template.php b/public/template.php new file mode 100644 index 00000000..cacc5516 --- /dev/null +++ b/public/template.php @@ -0,0 +1,3 @@ +
  • - + {{album.title}} {{album.created_at | pfmdate:'MM/dd/yyyy'}} diff --git a/public/templates/albums/show.html b/public/templates/albums/show.html index 80461e8c..e1a83818 100644 --- a/public/templates/albums/show.html +++ b/public/templates/albums/show.html @@ -22,7 +22,7 @@
    - +