Implemented a page to view a larger preview of a photo
This commit is contained in:
parent
bb6e77191e
commit
ef95fd31ba
@ -95,20 +95,20 @@ class AlbumController extends Controller
|
||||
return Theme::render('admin.edit_album', ['album' => $album]);
|
||||
}
|
||||
|
||||
public function monitorUpload($id, $upload_id)
|
||||
public function monitorUpload($id, $uploadId)
|
||||
{
|
||||
$this->authorize('admin-access');
|
||||
|
||||
$upload = AlbumController::loadUpload($upload_id, $id);
|
||||
$upload = AlbumController::loadUpload($uploadId, $id);
|
||||
|
||||
return Theme::render('admin.album_upload_progress', ['upload' => $upload, 'album' => $upload->album]);
|
||||
}
|
||||
|
||||
public function monitorUploadJson($id, $upload_id)
|
||||
public function monitorUploadJson($id, $uploadId)
|
||||
{
|
||||
$this->authorize('admin-access');
|
||||
|
||||
return response()->json(AlbumController::loadUpload($upload_id, $id)->toArray());
|
||||
return response()->json(AlbumController::loadUpload($uploadId, $id)->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Gallery;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use app\Http\Controllers\Admin\AlbumController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Photo;
|
||||
@ -22,6 +23,17 @@ class PhotoController extends Controller
|
||||
return response()->file($albumSource->getPathToPhoto($album, $photo, $thumbnail));
|
||||
}
|
||||
|
||||
public function show($albumUrlAlias, $photoFilename)
|
||||
{
|
||||
$album = PhotoController::loadAlbumByAlias($albumUrlAlias);
|
||||
$photo = PhotoController::loadPhotoByAlbumAndFilename($album, $photoFilename);
|
||||
|
||||
return Theme::render('gallery.photo', [
|
||||
'album' => $album,
|
||||
'photo' => $photo
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return Album
|
||||
|
@ -43,7 +43,7 @@ class Photo extends Model
|
||||
return $this->belongsTo(Album::class);
|
||||
}
|
||||
|
||||
public function thumbnailUrl($thumbnailName)
|
||||
public function thumbnailUrl($thumbnailName = null)
|
||||
{
|
||||
/** @var Album $album */
|
||||
//$album = Album::where('id', $this->album_id)->first();
|
||||
|
5
public/themes/bootstrap3/theme.css
vendored
5
public/themes/bootstrap3/theme.css
vendored
@ -23,6 +23,11 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.photo-metadata .metadata_name
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
border: solid 1px #ddd;
|
||||
border-top: 0;
|
||||
|
65
resources/views/themes/base/gallery/photo.blade.php
Normal file
65
resources/views/themes/base/gallery/photo.blade.php
Normal file
@ -0,0 +1,65 @@
|
||||
@extends('themes.base.layout')
|
||||
@section('title', 'Welcome')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h1>{{ $photo->name }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<a href="{{ $photo->thumbnailUrl() }}"><img src="{{ $photo->thumbnailUrl('fullsize') }}" alt="" class="img-thumbnail"/></a>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<p>Information about this photo:</p>
|
||||
|
||||
<table class="table table-striped photo-metadata">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="metadata_name">File name:</td>
|
||||
<td class="metadata_value">{{ $photo->name }}</td>
|
||||
</tr>
|
||||
|
||||
@if (strlen($photo->taken_at) > 0)
|
||||
<tr>
|
||||
<td class="metadata_name">Date taken:</td>
|
||||
<td class="metadata_value">{{ $photo->taken_at }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (strlen($photo->camera_make) > 0)
|
||||
<tr>
|
||||
<td class="metadata_name">Camera make:</td>
|
||||
<td class="metadata_value">{{ $photo->camera_make }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (strlen($photo->camera_model) > 0)
|
||||
<tr>
|
||||
<td class="metadata_name">Camera model:</td>
|
||||
<td class="metadata_value">{{ $photo->camera_model }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (strlen($photo->camera_software) > 0)
|
||||
<tr>
|
||||
<td class="metadata_name">Camera software:</td>
|
||||
<td class="metadata_value">{{ $photo->camera_software }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -31,5 +31,5 @@ Route::group(['prefix' => 'admin'], function () {
|
||||
// Gallery
|
||||
Route::get('/', 'Gallery\DefaultController@index')->name('home');
|
||||
Route::get('/{albumUrlAlias}', 'Gallery\AlbumController@index')->name('viewAlbum');
|
||||
Route::get('/{albumUrlAlias}/{photoFilename}', 'Gallery\PhotoController@view')->name('viewPhoto');
|
||||
Route::get('/{albumUrlAlias}/{photoFilename}', 'Gallery\PhotoController@show')->name('viewPhoto');
|
||||
Route::get('/photo/{albumUrlAlias}/{photoFilename}', 'Gallery\PhotoController@download')->name('downloadPhoto');
|
Loading…
Reference in New Issue
Block a user