2017-09-10 21:12:57 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
2016-09-01 16:23:39 +01:00
|
|
|
@section('title', 'Gallery Admin')
|
|
|
|
|
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">@lang('navigation.breadcrumb.create_album')</li>
|
2016-09-09 15:06:34 +01:00
|
|
|
@endsection
|
|
|
|
|
2016-09-01 16:23:39 +01:00
|
|
|
@section('content')
|
2018-09-16 22:11:53 +01:00
|
|
|
<div class="container" id="create-album-app">
|
2016-09-01 16:23:39 +01:00
|
|
|
<div class="row">
|
2017-03-27 14:04:09 +01:00
|
|
|
<div class="col">
|
2016-09-01 16:23:39 +01:00
|
|
|
<h1>@lang('admin.create_album')</h1>
|
|
|
|
<p>@lang('admin.create_album_intro')</p>
|
|
|
|
<p>@lang('admin.create_album_intro2')</p>
|
|
|
|
<hr/>
|
|
|
|
|
2017-03-27 14:04:09 +01:00
|
|
|
<form action="{{ route('albums.store') }}" method="POST">
|
|
|
|
{{ csrf_field() }}
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-03-27 14:04:09 +01:00
|
|
|
<label class="form-control-label" for="album-name">@lang('forms.name_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<input type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" id="album-name" name="name" value="{{ old('name') }}">
|
2017-03-27 14:04:09 +01:00
|
|
|
|
|
|
|
@if ($errors->has('name'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-03-27 14:04:09 +01:00
|
|
|
<strong>{{ $errors->first('name') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-control-label" for="album-description">@lang('forms.description_label')</label>
|
2017-04-16 09:50:40 +01:00
|
|
|
<textarea class="form-control" id="album-description" name="description" rows="5">{{ old('description') }}</textarea>
|
2017-03-27 14:04:09 +01:00
|
|
|
</div>
|
|
|
|
|
2017-04-17 17:11:59 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-control-label" for="parent-album">@lang('forms.parent_album_label')</label>
|
2018-09-16 22:11:53 +01:00
|
|
|
<select class="form-control" name="parent_album_id" id="parent-album" v-model="parent_id">
|
2017-04-17 17:11:59 +01:00
|
|
|
<option value="">@lang('forms.parent_album_placeholder')</option>
|
|
|
|
@foreach ($parent_albums as $key => $value)
|
2018-09-16 22:11:53 +01:00
|
|
|
<option value="{{ $key }}">{{ $value->display_name }}</option>
|
2017-04-17 17:11:59 +01:00
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
2017-03-27 14:04:09 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-control-label" for="album-source">@lang('forms.album_source_label')</label>
|
2017-04-17 17:11:59 +01:00
|
|
|
<select class="form-control" name="storage_id" id="album-source">
|
2017-03-27 14:04:09 +01:00
|
|
|
@foreach ($album_sources as $key => $value)
|
2019-07-21 17:22:40 +01:00
|
|
|
<option value="{{ $key }}"{{ $key == old('storage_id', $default_storage_id) ? ' selected="selected"' : '' }}>{{ $value }}</option>
|
2017-03-27 14:04:09 +01:00
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
2018-09-23 22:20:03 +01:00
|
|
|
<div class="form-group">
|
2018-09-16 22:11:53 +01:00
|
|
|
<div class="mt-3 form-check">
|
|
|
|
<input type="checkbox" class="form-check-input" id="inherit-permissions" name="is_permissions_inherited" v-model="is_inherit_permissions" />
|
|
|
|
<label class="form-check-label" for="inherit-permissions">
|
|
|
|
@lang('forms.inherit_album_permissions')
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-03-27 14:04:09 +01:00
|
|
|
<div class="form-check">
|
2018-09-16 22:11:53 +01:00
|
|
|
<input class="form-check-input" type="checkbox" name="is_private" id="is-private" v-bind:disabled="isPrivateDisabled" v-model="is_private">
|
|
|
|
<label class="form-check-label" for="is-private">
|
2017-03-27 14:04:09 +01:00
|
|
|
<i class="fa fa-fw fa-lock"></i> @lang('forms.private_album_label')
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="text-right">
|
|
|
|
<a href="{{ route('albums.index') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
|
|
|
|
<button class="btn btn-success" type="submit"><i class="fa fa-fw fa-check"></i> @lang('forms.create_action')</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2016-09-01 16:23:39 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-16 22:11:53 +01:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script type="text/javascript">
|
|
|
|
var createAlbumViewModel = new CreateAlbumViewModel();
|
|
|
|
createAlbumViewModel.data.parent_id = '{{ old('parent_album_id') }}';
|
|
|
|
|
|
|
|
var app = null;
|
|
|
|
|
|
|
|
$(document).ready(function()
|
|
|
|
{
|
|
|
|
app = new Vue(createAlbumViewModel);
|
|
|
|
app.$watch('is_private', function()
|
|
|
|
{
|
|
|
|
// If user chooses to make the album private, it cannot then inherit permissions (secure by default)
|
|
|
|
if (app.is_private)
|
|
|
|
{
|
|
|
|
app.is_inherit_permissions = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
app.$watch('is_inherit_permissions', function()
|
|
|
|
{
|
|
|
|
// If user chooses to inherit permissions, it cannot also be private
|
|
|
|
if (app.is_inherit_permissions)
|
|
|
|
{
|
|
|
|
app.is_private = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|