2017-09-10 21:12:57 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
2016-09-01 16:37:49 +01:00
|
|
|
@section('title', $album->name)
|
|
|
|
|
2016-09-09 15:06:34 +01:00
|
|
|
@section('breadcrumb')
|
2017-03-27 14:04:09 +01:00
|
|
|
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('albums.index') }}">@lang('navigation.breadcrumb.albums')</a></li>
|
|
|
|
<li class="breadcrumb-item active">{{ $album->name }}</li>
|
2016-09-09 15:06:34 +01:00
|
|
|
@endsection
|
|
|
|
|
2016-09-01 16:37:49 +01:00
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
2017-03-27 14:04:09 +01:00
|
|
|
<div class="col">
|
2017-03-31 22:05:57 +01:00
|
|
|
<a class="pull-right btn btn-secondary" href="{{ $album->url() }}" target="_blank"><i class="fa fa-fw fa-eye"></i> @lang('admin.open_album')</a>
|
2016-09-09 15:06:34 +01:00
|
|
|
|
|
|
|
<h1 class="page-title">{{ $album->name }}</h1>
|
2017-09-04 21:05:35 +01:00
|
|
|
<p>{!! nl2br(e($album->description)) !!}</p>
|
2016-09-02 21:27:50 +01:00
|
|
|
|
2017-09-04 21:05:35 +01:00
|
|
|
<div class="mt-4">
|
2016-09-02 21:27:50 +01:00
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
2017-02-17 11:38:10 +00:00
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'photos', 'tab_icon' => 'photo', 'tab_text' => trans('admin.album_photos_tab')])
|
2017-04-16 09:00:57 +01:00
|
|
|
@can('upload-photos', $album)
|
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'upload', 'tab_icon' => 'upload', 'tab_text' => trans('admin.album_upload_tab')])
|
|
|
|
@endcan
|
2017-09-04 17:23:31 +01:00
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'cameras', 'tab_icon' => 'camera', 'tab_text' => trans('admin.album_cameras_tab')])
|
2017-04-16 09:00:57 +01:00
|
|
|
@can('change-permissions', $album)
|
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'permissions', 'tab_icon' => 'lock', 'tab_text' => trans('admin.album_security_tab')])
|
|
|
|
@endcan
|
2017-09-04 17:23:31 +01:00
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'redirects', 'tab_icon' => 'retweet', 'tab_text' => trans('admin.album_redirects_tab')])
|
2017-02-17 11:38:10 +00:00
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'settings', 'tab_icon' => 'cog', 'tab_text' => trans('admin.album_settings_tab')])
|
2016-09-02 21:27:50 +01:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
2016-09-06 15:07:13 +01:00
|
|
|
{{-- Photos --}}
|
2017-04-10 17:29:45 +01:00
|
|
|
@include(Theme::viewName('partials.album_photos_tab'))
|
2017-04-16 09:00:57 +01:00
|
|
|
@can('upload-photos', $album)
|
|
|
|
{{-- Upload --}}
|
|
|
|
@include(Theme::viewName('partials.album_upload_tab'))
|
|
|
|
@endcan
|
2017-09-04 17:23:31 +01:00
|
|
|
{{-- Cameras --}}
|
|
|
|
@include(Theme::viewName('partials.album_cameras_tab'))
|
2017-04-16 09:00:57 +01:00
|
|
|
@can('change-permissions', $album)
|
|
|
|
{{-- Permissions --}}
|
|
|
|
@include(Theme::viewName('partials.album_permissions_tab'))
|
|
|
|
@endcan
|
2017-09-04 17:23:31 +01:00
|
|
|
{{-- Redirects --}}
|
|
|
|
@include(Theme::viewName('partials.album_redirects_tab'))
|
2016-09-06 15:07:13 +01:00
|
|
|
{{-- Settings --}}
|
2017-04-16 09:00:57 +01:00
|
|
|
@include(Theme::viewName('partials.album_settings_tab'))
|
2016-09-02 21:27:50 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-09-01 16:37:49 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-12 21:41:47 +01:00
|
|
|
|
|
|
|
<!-- Form used for the replace image popup -->
|
|
|
|
<form id="replace-image-form" method="post" action="{{ route('photos.store') }}" enctype="multipart/form-data" style="display: none;">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
<input type="hidden" name="album_id" value="{{ $album->id }}"/>
|
|
|
|
<input type="hidden" name="photo_id" value=""/>
|
|
|
|
<input type="hidden" name="queue_token" value="{{ $queue_token }}"/>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="file" class="form-control" name="photo[]"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
2016-09-06 15:07:13 +01:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script type="text/javascript">
|
2016-09-22 07:34:18 +01:00
|
|
|
var language = [];
|
2016-10-05 05:02:47 +01:00
|
|
|
language.action_cancel = '{!! addslashes(trans('forms.cancel_action')) !!}';
|
|
|
|
language.action_continue = '{!! addslashes(trans('forms.continue_action')) !!}';
|
|
|
|
language.action_delete = '{!! addslashes(trans('forms.delete_action')) !!}';
|
|
|
|
language.change_album_message = '{!! addslashes(trans('admin.change_album_message')) !!}';
|
|
|
|
language.change_album_title = '{!! addslashes(trans('admin.change_album_title')) !!}';
|
|
|
|
language.delete_bulk_confirm_message = '{!! addslashes(trans('admin.delete_bulk_photos_message')) !!}';
|
|
|
|
language.delete_bulk_confirm_title = '{!! addslashes(trans('admin.delete_bulk_photos_title')) !!}';
|
|
|
|
language.delete_confirm_message = '{!! addslashes(trans('admin.delete_photo_message')) !!}';
|
|
|
|
language.delete_confirm_title = '{!! addslashes(trans('admin.delete_photo_title')) !!}';
|
2017-03-27 14:04:09 +01:00
|
|
|
language.not_an_image_file = '{!! addslashes(trans('admin.upload_file_not_image_messages')) !!}';
|
2016-10-30 19:10:20 +00:00
|
|
|
language.select_all_choice_all_action = '{!! addslashes(trans('admin.select_all_choice.all_action')) !!}';
|
|
|
|
language.select_all_choice_message = '{!! addslashes(trans('admin.select_all_choice.message')) !!}';
|
|
|
|
language.select_all_choice_title = '{!! addslashes(trans('admin.select_all_choice.title')) !!}';
|
|
|
|
language.select_all_choice_visible_action = '{!! addslashes(trans('admin.select_all_choice.visible_action')) !!}';
|
2016-09-22 07:34:18 +01:00
|
|
|
language.image_failed = '{!! addslashes(trans('admin.upload_file_status_failed')) !!}';
|
|
|
|
language.image_uploaded = '{!! addslashes(trans('admin.upload_file_status_success')) !!}';
|
2017-09-12 21:41:47 +01:00
|
|
|
language.replace_image_message = '{!! addslashes(trans('admin.replace_image_message')) !!}';
|
|
|
|
language.replace_image_title = '{!! addslashes(trans('admin.replace_image_title')) !!}';
|
2016-09-22 07:34:18 +01:00
|
|
|
language.upload_status = '{!! addslashes(trans('admin.upload_file_status_progress')) !!}';
|
|
|
|
|
|
|
|
var urls = [];
|
2016-10-28 05:30:57 +01:00
|
|
|
urls.analyse = '{{ route('albums.analyse', ['id' => $album->id, 'queue_token' => $queue_token]) }}';
|
2016-10-05 05:02:47 +01:00
|
|
|
urls.delete_photo = '{{ route('photos.destroy', ['id' => 0]) }}';
|
2016-10-05 05:35:14 +01:00
|
|
|
urls.flip_photo = '{{ route('photos.flip', ['id' => 0, 'horizontal' => -1, 'vertical' => -2]) }}';
|
2016-10-05 05:02:47 +01:00
|
|
|
urls.move_photo = '{{ route('photos.move', ['photoId' => 0]) }}';
|
2016-10-05 05:35:14 +01:00
|
|
|
urls.regenerate_thumbnails = '{{ route('photos.regenerateThumbnails', ['photoId' => 0]) }}';
|
|
|
|
urls.rotate_photo = '{{ route('photos.rotate', ['id' => 0, 'angle' => 1]) }}';
|
2016-09-22 07:34:18 +01:00
|
|
|
|
2016-10-28 05:30:57 +01:00
|
|
|
var viewModel = new UploadPhotosViewModel('{{ $album->id }}', '{{ $queue_token }}', language, urls);
|
2017-04-10 17:29:45 +01:00
|
|
|
var editViewModel = new EditPhotosViewModel('{{ $album->id }}', language, urls);
|
2016-09-11 09:04:07 +01:00
|
|
|
|
2016-10-30 19:10:20 +00:00
|
|
|
@foreach ($photos as $photo)
|
2017-04-10 17:29:45 +01:00
|
|
|
editViewModel.data.photoIDsAvailable.push({{ $photo->id }});
|
2016-10-30 19:10:20 +00:00
|
|
|
@endforeach
|
|
|
|
|
2016-10-05 05:02:47 +01:00
|
|
|
// Populate the list of albums in the view model
|
|
|
|
@foreach ($albums as $album)
|
2017-04-16 09:50:40 +01:00
|
|
|
@if(Gate::check('edit', $album) && Gate::check('upload-photos', $album))
|
|
|
|
editViewModel.data.albums.push({
|
|
|
|
'id': '{{ $album->id }}',
|
|
|
|
'name': '{!! addslashes($album->name) !!}'
|
|
|
|
});
|
|
|
|
@endif
|
2017-04-10 17:29:45 +01:00
|
|
|
@endforeach
|
2016-09-09 09:45:11 +01:00
|
|
|
|
2017-09-10 10:24:15 +01:00
|
|
|
function renderLabelsFields()
|
|
|
|
{
|
|
|
|
$('.labels-field').selectize({
|
|
|
|
plugins: ['remove_button'],
|
|
|
|
delimiter: ',',
|
|
|
|
persist: false,
|
|
|
|
options: [
|
|
|
|
@foreach ($labels as $label)
|
|
|
|
{
|
|
|
|
value: '{{ $label->id }}',
|
|
|
|
text: '{{ $label->name}}'
|
|
|
|
},
|
|
|
|
@endforeach
|
|
|
|
],
|
|
|
|
create: function(input) {
|
|
|
|
return {
|
|
|
|
value: input,
|
|
|
|
text: input
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-09-06 15:07:13 +01:00
|
|
|
$(document).ready(function() {
|
2016-09-11 09:04:07 +01:00
|
|
|
{{-- Photo uploads using AJAX --}}
|
|
|
|
if (window.FormData)
|
|
|
|
{
|
2016-09-24 08:17:51 +01:00
|
|
|
$('#bulk-upload-form').submit(function(event) {
|
|
|
|
// Set the in progress flag - no need to unset it as this is a synchronous process so the browser
|
|
|
|
// will reload the page in some way after completion
|
2016-10-30 18:36:34 +00:00
|
|
|
if (!viewModel.isBulkUploadInProgress())
|
|
|
|
{
|
|
|
|
viewModel.isBulkUploadInProgress(true);
|
|
|
|
|
|
|
|
// Wait a minute to give KnockoutJS chance to update the UI
|
|
|
|
window.setTimeout(function() {
|
|
|
|
$('#bulk-upload-form').submit();
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Already set the flag, let the upload commence
|
2016-09-24 08:17:51 +01:00
|
|
|
return true;
|
|
|
|
});
|
2016-09-11 09:04:07 +01:00
|
|
|
}
|
2016-09-22 07:34:18 +01:00
|
|
|
|
2017-02-17 08:57:05 +00:00
|
|
|
{{-- Select All/None links on the permissions tab --}}
|
|
|
|
$('a.select-all').click(function() {
|
2017-08-31 17:20:58 +01:00
|
|
|
$('input:checkbox', $(this).closest('.card-body')).prop('checked', true);
|
2017-02-17 08:57:05 +00:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
$('a.select-none').click(function() {
|
2017-08-31 17:20:58 +01:00
|
|
|
$('input:checkbox', $(this).closest('.card-body')).prop('checked', false);
|
2017-02-17 08:57:05 +00:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2017-03-21 21:48:55 +00:00
|
|
|
{{-- Type-ahead support for users textbox on the permissions tab --}}
|
2017-04-18 17:25:27 +01:00
|
|
|
var userDataSource = new Bloodhound({
|
2017-03-21 21:48:55 +00:00
|
|
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
|
|
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
|
|
|
remote: {
|
|
|
|
url: '{{ route('users.searchJson') }}?q=%QUERY',
|
|
|
|
wildcard: '%QUERY'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#user-search-textbox').typeahead(null, {
|
|
|
|
name: 'user-search',
|
|
|
|
display: 'name',
|
|
|
|
source: userDataSource
|
|
|
|
});
|
|
|
|
$('#user-search-textbox').bind('typeahead:select', function(ev, suggestion) {
|
|
|
|
$('#user-id-field').val(suggestion.id);
|
2017-04-18 17:25:27 +01:00
|
|
|
});
|
2017-03-21 21:48:55 +00:00
|
|
|
|
2017-09-10 10:24:15 +01:00
|
|
|
{{-- Selectize support for photo labelling --}}
|
|
|
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e)
|
|
|
|
{
|
|
|
|
var target = $(e.target).attr('href');
|
|
|
|
if (target === '#photos-tab') {
|
|
|
|
renderLabelsFields();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
window.setTimeout(renderLabelsFields, 500);
|
|
|
|
|
2016-10-05 05:02:47 +01:00
|
|
|
// Bind the view models to the relevant tab
|
2017-04-10 17:29:45 +01:00
|
|
|
var appEdit = new Vue(editViewModel);
|
|
|
|
|
2017-03-27 14:04:09 +01:00
|
|
|
var appUpload = new Vue(viewModel);
|
2017-03-31 22:05:57 +01:00
|
|
|
appUpload.$watch('isUploadInProgress', function(value) {
|
|
|
|
if (value)
|
|
|
|
{
|
|
|
|
$('#upload-progress-modal').modal('show');
|
|
|
|
}
|
2017-04-08 09:41:41 +01:00
|
|
|
else if (this.statusMessages.length === 0)
|
2017-03-31 22:05:57 +01:00
|
|
|
{
|
|
|
|
$('#upload-progress-modal').modal('hide');
|
|
|
|
}
|
|
|
|
});
|
2017-09-10 10:24:15 +01:00
|
|
|
});
|
2016-09-06 15:07:13 +01:00
|
|
|
</script>
|
|
|
|
@endpush
|