2016-09-02 10:42:05 +01:00
|
|
|
@extends('themes.base.layout')
|
2016-09-01 16:37:49 +01:00
|
|
|
@section('title', $album->name)
|
|
|
|
|
2016-09-09 15:06:34 +01:00
|
|
|
@section('breadcrumb')
|
|
|
|
<div class="breadcrumb">
|
|
|
|
<div class="container">
|
|
|
|
<ol class="breadcrumb">
|
2017-02-13 10:36:53 +00:00
|
|
|
<li><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
|
2016-09-09 15:06:34 +01:00
|
|
|
<li><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
|
|
|
|
<li><a href="{{ route('albums.index') }}">@lang('navigation.breadcrumb.albums')</a></li>
|
|
|
|
<li class="active">{{ $album->name }}</li>
|
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
2016-09-01 16:37:49 +01:00
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
2016-09-09 15:06:34 +01:00
|
|
|
<a class="pull-right btn btn-default" href="{{ $album->url() }}" target="_blank"><i class="fa fa-fw fa-eye"></i> @lang('admin.open_album')</a>
|
|
|
|
|
|
|
|
<h1 class="page-title">{{ $album->name }}</h1>
|
2016-09-01 16:37:49 +01:00
|
|
|
<p>{{ $album->description }}</p>
|
|
|
|
<hr/>
|
2016-09-02 21:27:50 +01:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<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')])
|
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'upload', 'tab_icon' => 'upload', 'tab_text' => trans('admin.album_upload_tab')])
|
|
|
|
@include(Theme::viewName('partials.tab'), ['tab_name' => 'permissions', 'tab_icon' => 'lock', 'tab_text' => trans('admin.album_security_tab')])
|
|
|
|
@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-02-16 17:32:01 +00:00
|
|
|
<div role="tabpanel" class="tab-pane{{ $active_tab == 'photos' ? ' active' : '' }}" id="photos-tab">
|
2016-09-07 21:44:28 +01:00
|
|
|
@if (count($photos) == 0)
|
2016-09-06 15:07:13 +01:00
|
|
|
<div class="text-center" style="margin-top: 30px;">
|
2016-09-06 19:47:25 +01:00
|
|
|
<h4 class="text-danger"><b>@lang('admin.album_no_photos_p1')</b></h4>
|
2016-09-06 15:07:13 +01:00
|
|
|
<p>@lang('admin.album_no_photos_p2')</p>
|
2017-02-15 09:14:52 +00:00
|
|
|
<p style="margin-top: 30px;"><button id="upload-button" class="btn btn-lg btn-success"><i class="fa fa-fw fa-upload"></i> @lang('admin.album_no_photos_button')</button></p>
|
2016-09-06 15:07:13 +01:00
|
|
|
</div>
|
2016-09-07 21:44:28 +01:00
|
|
|
@else
|
2016-10-05 05:02:47 +01:00
|
|
|
{!! Form::open(['route' => ['photos.updateBulk', $album->id], 'method' => 'PUT', 'id' => 'bulk-modify-form']) !!}
|
2016-09-07 21:44:28 +01:00
|
|
|
|
|
|
|
@foreach ($photos as $photo)
|
|
|
|
@include (Theme::viewName('partials.single_photo_admin'))
|
|
|
|
@endforeach
|
|
|
|
|
2016-10-05 05:02:47 +01:00
|
|
|
<div class="pull-left" style="margin-bottom: 15px;">
|
2016-10-30 19:10:20 +00:00
|
|
|
<p style="margin-bottom: 15px;">
|
|
|
|
<button data-bind="click: selectAll" type="button" class="btn btn-default">@lang('admin.select_all_action')</button>
|
|
|
|
<button data-bind="click: selectNone" type="button" class="btn btn-default">@lang('admin.select_none_action')</button>
|
|
|
|
</p>
|
|
|
|
<input data-bind="value: selectAllInAlbum" type="hidden" name="select-all-album"/>
|
|
|
|
|
|
|
|
<div data-bind="visible: selectAllInAlbum" class="alert alert-warning">
|
|
|
|
<p>@lang('admin.select_all_album_active')</p>
|
|
|
|
</div>
|
|
|
|
|
2016-09-11 09:04:07 +01:00
|
|
|
<p>{!! Form::label('bulk-action', trans('forms.bulk_edit_photos_label'), ['class' => 'control-label']) !!}</p>
|
2016-10-05 05:02:47 +01:00
|
|
|
{!! Form::hidden('new-album-id', $album->id) !!}
|
|
|
|
{!! Form::select('bulk-action', $bulk_actions, null, ['placeholder' => trans('forms.bulk_edit_photos_placeholder'), 'id' => 'bulk-action-apply', 'data-bind' => 'value: bulkModifyMethod, enable: photoIDs().length > 0']) !!}
|
|
|
|
<button type="submit" class="btn btn-sm btn-primary" name="bulk-apply" value="clicked" data-bind="click: bulkModifySelected, enable: photoIDs().length > 0">@lang('forms.apply_action')</button>
|
2016-09-11 09:04:07 +01:00
|
|
|
</div>
|
2016-09-07 21:44:28 +01:00
|
|
|
<div class="pull-right">
|
|
|
|
<button type="submit" class="btn btn-success">@lang('forms.save_action')</button>
|
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
|
|
{!! Form::close() !!}
|
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
|
{{ $photos->links() }}
|
|
|
|
</div>
|
2016-09-06 15:07:13 +01:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{-- Upload --}}
|
2017-02-16 17:32:01 +00:00
|
|
|
<div role="tabpanel" class="tab-pane{{ $active_tab == 'upload' ? ' active' : '' }}" id="upload-tab">
|
2016-09-24 08:17:51 +01:00
|
|
|
@if (!$is_upload_enabled)
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<p class="text-danger" style="font-weight: bold">@lang('admin.upload_disabled_heading')</p>
|
|
|
|
<p>@lang('admin.upload_disabled_text')</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<h4>@lang('admin.upload_single_file_heading')</h4>
|
|
|
|
<p>@lang('admin.upload_single_file_text')</p>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<p>@lang('admin.upload_single_file_text2', [
|
|
|
|
'file_size' => sprintf('<b>%s%s</b>', round($file_upload_limit, 2), trans('global.units.megabytes')),
|
|
|
|
'max_upload_size' => sprintf('<b>%s%s</b>', round($max_post_limit, 2), trans('global.units.megabytes'))
|
|
|
|
])</p>
|
|
|
|
</div>
|
2016-09-02 21:27:50 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-5" style="margin-bottom: 20px;">
|
|
|
|
{!! Form::open(['route' => 'photos.store', 'method' => 'POST', 'files' => true, 'id' => 'single-upload-form']) !!}
|
|
|
|
{!! Form::hidden('album_id', $album->id) !!}
|
2016-10-28 05:30:57 +01:00
|
|
|
{!! Form::hidden('queue_token', $queue_token) !!}
|
2016-09-02 21:27:50 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div class="form-group">
|
|
|
|
{!! Form::file('photo[]', ['class' => 'control-label', 'multiple' => 'multiple', 'id' => 'single-upload-files']) !!}
|
|
|
|
</div>
|
2016-09-02 21:27:50 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div>
|
2017-02-15 09:14:52 +00:00
|
|
|
<button type="submit" class="btn btn-success" data-bind="disable: (isUploadInProgress() || isBulkUploadInProgress()), text: isUploadInProgress() ? '@lang('admin.is_uploading')' : '@lang('forms.upload_action')'"><i class="fa fa-fw fa-upload"></i> @lang('forms.upload_action')</button>
|
2016-09-24 08:17:51 +01:00
|
|
|
</div>
|
|
|
|
{!! Form::close() !!}
|
2016-09-11 09:04:07 +01:00
|
|
|
</div>
|
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div class="col-sm-5">
|
|
|
|
<div class="text-center" data-bind="visible: isUploadInProgress">
|
|
|
|
<p><b>@lang('admin.is_uploading')</b></p>
|
|
|
|
<div class="progress">
|
|
|
|
<div class="progress-bar progress-bar-success" data-bind="style: { width: successfulPercentage() }">
|
|
|
|
<span class="sr-only"><span class="percentage-success" data-bind="text: successfulPercentage"></span></span>
|
|
|
|
</div>
|
|
|
|
<div class="progress-bar progress-bar-danger" data-bind="style: { width: failedPercentage() }">
|
|
|
|
<span class="sr-only"><span class="percentage-danger" data-bind="text: failedPercentage"></span></span>
|
|
|
|
</div>
|
2016-09-22 07:34:18 +01:00
|
|
|
</div>
|
2016-09-24 08:17:51 +01:00
|
|
|
<p data-bind="text: currentStatus"></p>
|
2016-09-11 09:04:07 +01:00
|
|
|
</div>
|
2016-09-22 07:34:18 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div data-bind="visible: statusMessages().length > 0">
|
|
|
|
<p data-bind="visible: !isUploadInProgress()" class="text-danger" style="font-weight: bold">
|
|
|
|
<span data-bind="text: imagesFailed"></span> @lang('admin.upload_file_number_failed')
|
|
|
|
</p>
|
|
|
|
<p data-bind="visible: imagesUploaded() > 0">
|
|
|
|
@lang('admin.upload_file_failed_continue')<br /><br/>
|
2016-10-28 05:30:57 +01:00
|
|
|
<a href="{{ route('albums.analyse', ['id' => $album->id, 'queue_token' => $queue_token]) }}" class="btn btn-primary">@lang('forms.continue_action')</a>
|
2016-09-24 08:17:51 +01:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<ul data-bind="foreach: statusMessages">
|
|
|
|
<li data-bind="css: message_class, text: message_text"></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2016-09-11 09:04:07 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-09-05 12:56:13 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<hr/>
|
|
|
|
<h4>@lang('admin.upload_bulk_heading')</h4>
|
|
|
|
<p>@lang('admin.upload_bulk_text')</p>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<p>@lang('admin.upload_bulk_text2', [
|
|
|
|
'max_upload_size' => sprintf('<b>%s%s</b>', round($max_post_limit_bulk, 2), trans('global.units.megabytes'))
|
|
|
|
])</p>
|
|
|
|
</div>
|
2016-09-05 12:56:13 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
{!! Form::open(['route' => 'photos.storeBulk', 'method' => 'POST', 'files' => true, 'id' => 'bulk-upload-form']) !!}
|
|
|
|
{!! Form::hidden('album_id', $album->id) !!}
|
2016-10-28 05:30:57 +01:00
|
|
|
{!! Form::hidden('queue_token', $queue_token) !!}
|
2016-09-05 12:56:13 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div class="form-group">
|
|
|
|
{!! Form::file('archive', ['class' => 'control-label']) !!}
|
|
|
|
</div>
|
2016-09-05 12:56:13 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
<div>
|
2017-02-15 09:14:52 +00:00
|
|
|
<button type="submit" class="btn btn-success" data-bind="disable: (isUploadInProgress() || isBulkUploadInProgress()), text: isBulkUploadInProgress() ? '@lang('admin.is_uploading')' : '@lang('forms.upload_action')'"><i class="fa fa-fw fa-upload"></i> @lang('forms.upload_action')</button>
|
2016-09-24 08:17:51 +01:00
|
|
|
</div>
|
|
|
|
{!! Form::close() !!}
|
|
|
|
@endif
|
2016-09-02 21:27:50 +01:00
|
|
|
</div>
|
|
|
|
|
2017-02-16 17:32:01 +00:00
|
|
|
{{-- Permissions --}}
|
|
|
|
<div role="tabpanel" class="tab-pane{{ $active_tab == 'permissions' ? ' active' : '' }}" id="permissions-tab">
|
|
|
|
<h4>@lang('admin.security_heading')</h4>
|
|
|
|
<p>@lang('admin.security_text')</p>
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<h5 style="font-weight: bold;">@lang('admin.security_groups_heading')</h5>
|
|
|
|
|
|
|
|
<form action="{{ route('albums.set_group_permissions', ['id' => $album->id]) }}" method="post">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
|
|
|
|
@if (count($existing_groups) > 0)
|
|
|
|
<div class="panel-group" id="groups-accordion" role="tablist" aria-multiselectable="true">
|
|
|
|
@foreach ($existing_groups as $group)
|
2017-03-21 21:48:55 +00:00
|
|
|
@include(Theme::viewName('partials.album_permissions'), [
|
|
|
|
'key_id' => 'group_' . $group->id,
|
|
|
|
'object_id' => $group->id,
|
|
|
|
'title' => $group->name,
|
|
|
|
'callback' => [$album, 'doesGroupHavePermission'],
|
|
|
|
'callback_object' => $group,
|
|
|
|
'parent_id' => 'groups-accordion'
|
|
|
|
])
|
2017-02-16 17:32:01 +00:00
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2017-03-21 21:48:55 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
|
|
|
<select class="form-control" name="group_id" style="margin-bottom: 2px;"@if (count($add_new_groups) == 0) disabled="disabled"@endif>
|
|
|
|
@foreach ($add_new_groups as $group)
|
|
|
|
<option value="{{ $group->id }}">{{ $group->name }}</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
|
|
<button type="submit" name="action" value="add_group" class="btn btn-primary">Assign Permissions</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6 text-right">
|
|
|
|
<button type="submit" name="action" value="update_group_permissions" class="btn btn-success">
|
|
|
|
<i class="fa fa-fw fa-check"></i> @lang('forms.save_action')
|
|
|
|
</button>
|
|
|
|
</div>
|
2017-02-16 17:32:01 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<h5 style="font-weight: bold;">@lang('admin.security_users_heading')</h5>
|
2017-02-17 11:38:10 +00:00
|
|
|
|
|
|
|
<form action="{{ route('albums.set_user_permissions', ['id' => $album->id]) }}" method="post">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
|
|
|
|
<div class="panel-group" id="users-accordion" role="tablist" aria-multiselectable="true">
|
|
|
|
{{-- Anonymous users --}}
|
2017-03-21 21:48:55 +00:00
|
|
|
@include(Theme::viewName('partials.album_permissions'), [
|
|
|
|
'key_id' => 'anonymous',
|
|
|
|
'object_id' => 'anonymous',
|
|
|
|
'title' => trans('admin.anonymous_users'),
|
|
|
|
'callback' => [$album, 'doesUserHavePermission'],
|
|
|
|
'callback_object' => null,
|
|
|
|
'parent_id' => 'users-accordion'
|
|
|
|
])
|
|
|
|
|
|
|
|
@foreach ($existing_users as $user)
|
|
|
|
@include(Theme::viewName('partials.album_permissions'), [
|
|
|
|
'key_id' => 'user_' . $user->id,
|
|
|
|
'object_id' => $user->id,
|
|
|
|
'title' => $user->name,
|
|
|
|
'callback' => [$album, 'doesUserHavePermission'],
|
|
|
|
'callback_object' => $user,
|
|
|
|
'parent_id' => 'users-accordion'
|
|
|
|
])
|
|
|
|
@endforeach
|
2017-02-17 11:38:10 +00:00
|
|
|
</div>
|
|
|
|
|
2017-03-21 21:48:55 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input class="form-control" name="user_name" id="user-search-textbox" size="20" style="margin-bottom: 2px;" />
|
|
|
|
<input type="hidden" name="user_id" id="user-id-field" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
|
|
<button type="submit" name="action" value="add_user" class="btn btn-primary">Assign Permissions</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6 text-right">
|
|
|
|
<button type="submit" name="action" value="update_user_permissions" class="btn btn-success">
|
|
|
|
<i class="fa fa-fw fa-check"></i> @lang('forms.save_action')
|
|
|
|
</button>
|
|
|
|
</div>
|
2017-02-17 11:38:10 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2017-02-16 17:32:01 +00:00
|
|
|
</div>
|
|
|
|
|
2016-09-06 15:07:13 +01:00
|
|
|
{{-- Settings --}}
|
2017-02-16 17:32:01 +00:00
|
|
|
<div role="tabpanel" class="tab-pane{{ $active_tab == 'settings' ? ' active' : '' }}" id="settings-tab">
|
2016-10-05 14:49:44 +01:00
|
|
|
{!! Form::model($album, ['route' => ['albums.update', $album->id], 'method' => 'PUT']) !!}
|
|
|
|
<h4><i class="fa fa-fw fa-info"></i> @lang('admin.album_basic_info_heading')</h4>
|
|
|
|
<p>@lang('admin.album_basic_info_intro')</p>
|
|
|
|
|
2016-10-28 14:05:53 +01:00
|
|
|
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}" style="margin-top: 20px;">
|
2016-10-05 14:49:44 +01:00
|
|
|
{!! Form::label('name', trans('forms.name_label'), ['class' => 'control-label']) !!}
|
|
|
|
{!! Form::text('name', old('name'), ['class' => 'form-control']) !!}
|
2016-10-28 14:05:53 +01:00
|
|
|
|
|
|
|
@if ($errors->has('name'))
|
|
|
|
<span class="help-block">
|
|
|
|
<strong>{{ $errors->first('name') }}</strong>
|
|
|
|
</span>
|
|
|
|
@endif
|
2016-10-05 14:49:44 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
{!! Form::label('description', trans('forms.description_label'), ['class' => 'control-label']) !!}
|
|
|
|
{!! Form::textarea('description', old('description'), ['class' => 'form-control']) !!}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<h4><i class="fa fa-fw fa-paint-brush"></i> @lang('admin.album_appearance_heading')</h4>
|
|
|
|
<p>@lang('admin.album_appearance_intro')</p>
|
|
|
|
|
|
|
|
<div class="form-group" style="margin-top: 20px;">
|
|
|
|
<label class="control-label">@lang('forms.default_album_view_label')</label>
|
|
|
|
{!! Form::select('default_view', $allowed_views, old('default_view'), ['class' => 'form-control']) !!}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<div class="row">
|
2016-10-27 11:36:37 +01:00
|
|
|
<div class="col-sm-6 col-sm-push-6">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">@lang('admin.save_changes_heading')</div>
|
2016-10-05 14:49:44 +01:00
|
|
|
<div class="panel-body">
|
2016-10-27 11:36:37 +01:00
|
|
|
<p>@lang('admin.save_changes_intro')</p>
|
|
|
|
<p class="text-right">
|
2017-02-15 09:14:52 +00:00
|
|
|
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-floppy-o"></i> @lang('forms.save_action')</button>
|
2016-10-05 14:49:44 +01:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-10-27 11:36:37 +01:00
|
|
|
<div class="col-sm-6 col-sm-pull-6">
|
|
|
|
<div class="panel panel-danger">
|
|
|
|
<div class="panel-heading">@lang('admin.danger_zone_heading')</div>
|
2016-10-05 14:49:44 +01:00
|
|
|
<div class="panel-body">
|
2016-10-27 11:36:37 +01:00
|
|
|
<p class="text-danger">@lang('admin.danger_zone_intro')</p>
|
|
|
|
<p>
|
|
|
|
<a href="{{ route('albums.delete', ['id' => $album->id]) }}" class="btn btn-danger">@lang('forms.delete_action')</a>
|
2016-10-05 14:49:44 +01:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-09-06 15:07:13 +01:00
|
|
|
</div>
|
2016-10-05 14:49:44 +01:00
|
|
|
{!! Form::close() !!}
|
2016-09-02 21:27:50 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-09-01 16:37:49 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
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')) !!}';
|
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')) !!}';
|
|
|
|
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);
|
2016-10-05 05:02:47 +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)
|
|
|
|
editViewModel.photoIDsAvailable.push('{{ $photo->id }}');
|
|
|
|
@endforeach
|
|
|
|
|
2016-10-05 05:02:47 +01:00
|
|
|
// Populate the list of albums in the view model
|
|
|
|
@foreach ($albums as $album)
|
|
|
|
editViewModel.albums.push({
|
|
|
|
'id': '{{ $album->id }}',
|
|
|
|
'name': '{!! addslashes($album->name) !!}'
|
2016-09-09 09:45:11 +01:00
|
|
|
});
|
2016-10-05 05:02:47 +01:00
|
|
|
@endforeach
|
2016-09-09 09:45:11 +01:00
|
|
|
|
2016-09-06 15:07:13 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('#upload-button').click(function() {
|
|
|
|
$('.nav-tabs a[href="#upload-tab"]').tab('show');
|
|
|
|
});
|
2016-09-08 23:22:29 +01:00
|
|
|
|
2016-09-09 09:45:11 +01:00
|
|
|
{{-- Photo editing tasks - the buttons beneath the photos in partials/single_photo_admin --}}
|
2016-10-05 05:02:47 +01:00
|
|
|
$('a.change-album').click(editViewModel.changeAlbum);
|
|
|
|
$('a.delete-photo').click(editViewModel.delete);
|
2016-10-05 05:35:14 +01:00
|
|
|
$('a.flip-photo-both').click(editViewModel.flipBoth);
|
|
|
|
$('a.flip-photo-horizontal').click(editViewModel.flipHorizontal);
|
|
|
|
$('a.flip-photo-vertical').click(editViewModel.flipVertical);
|
|
|
|
$('a.regenerate-thumbnails').click(editViewModel.regenerateThumbnails);
|
|
|
|
$('a.rotate-photo-left').click(editViewModel.rotateLeft);
|
|
|
|
$('a.rotate-photo-right').click(editViewModel.rotateRight);
|
2016-09-11 09:04:07 +01:00
|
|
|
|
|
|
|
{{-- Photo uploads using AJAX --}}
|
|
|
|
if (window.FormData)
|
|
|
|
{
|
|
|
|
$('#single-upload-form').submit(function(event) {
|
|
|
|
var fileSelect = $('#single-upload-files', this);
|
|
|
|
var uploadButton = $('button[type=submit]', this);
|
|
|
|
|
|
|
|
// Get the selected files
|
|
|
|
var notImageString = '{!! addslashes(trans('admin.upload_file_not_image_messages')) !!}';
|
|
|
|
var files = fileSelect[0].files;
|
|
|
|
|
|
|
|
// Reset statistics
|
2016-09-22 07:34:18 +01:00
|
|
|
viewModel.startUpload(files.length);
|
2016-09-11 09:04:07 +01:00
|
|
|
|
|
|
|
// Loop through each of the selected files and upload them individually
|
|
|
|
for (var i = 0; i < files.length; i++)
|
|
|
|
{
|
|
|
|
var file = files[i];
|
|
|
|
|
|
|
|
// We're only interested in image files
|
|
|
|
if (!file.type.match('image.*'))
|
|
|
|
{
|
|
|
|
alert(notImageString.replace(':file_name', file.name));
|
2016-09-24 08:17:51 +01:00
|
|
|
viewModel.onUploadFailed(null, file.name);
|
2016-09-11 09:04:07 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Upload the file
|
2016-09-22 07:34:18 +01:00
|
|
|
viewModel.uploadFile($(this), file);
|
2016-09-11 09:04:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Prevent standard form upload
|
|
|
|
event.preventDefault();
|
|
|
|
return false;
|
2016-09-22 07:34:18 +01:00
|
|
|
});
|
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() {
|
|
|
|
$('input:checkbox', $(this).closest('.panel-body')).prop('checked', true);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
$('a.select-none').click(function() {
|
|
|
|
$('input:checkbox', $(this).closest('.panel-body')).prop('checked', false);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2017-03-21 21:48:55 +00:00
|
|
|
{{-- Type-ahead support for users textbox on the permissions tab --}}
|
|
|
|
var userDataSource = new Bloodhound({
|
|
|
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
|
|
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
|
|
|
//prefetch: '../data/films/post_1960.json',
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
|
2016-10-05 05:02:47 +01:00
|
|
|
// Bind the view models to the relevant tab
|
|
|
|
ko.applyBindings(editViewModel, document.getElementById('photos-tab'));
|
|
|
|
ko.applyBindings(viewModel, document.getElementById('upload-tab'));
|
2016-09-06 15:07:13 +01:00
|
|
|
})
|
|
|
|
</script>
|
|
|
|
@endpush
|