2017-09-10 21:12:57 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
2016-09-01 17:31:16 +01:00
|
|
|
@section('title', 'Gallery Admin')
|
|
|
|
|
2016-09-09 15:06:34 +01:00
|
|
|
@section('breadcrumb')
|
2017-04-16 09:00:57 +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>
|
2018-07-11 07:52:59 +01:00
|
|
|
@include(Theme::viewName('partials.admin_album_breadcrumb'), ['show_current_link' => true])
|
2017-04-16 09:00:57 +01:00
|
|
|
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.edit_album')</li>
|
2016-09-09 15:06:34 +01:00
|
|
|
@endsection
|
|
|
|
|
2016-09-01 17:31:16 +01:00
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
2017-04-16 09:00:57 +01:00
|
|
|
<div class="col">
|
2016-09-09 15:06:34 +01:00
|
|
|
<h1>@lang('admin.edit_album', ['album_name' => $album->name])</h1>
|
|
|
|
<p>@lang('admin.edit_album_intro')</p>
|
|
|
|
<p>@lang('admin.edit_album_intro2', ['album_name' => $album->name])</p>
|
2016-09-01 17:31:16 +01:00
|
|
|
<hr/>
|
|
|
|
|
2017-04-16 09:00:57 +01:00
|
|
|
<form method="post" action="{{ route('albums.update', [$album->id]) }}">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
{{ method_field('PUT') }}
|
|
|
|
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-04-16 09:00:57 +01:00
|
|
|
<label for="album-name" class="control-label">@lang('forms.name_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<input type="text" id="album-name" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" />
|
2017-04-16 09:00:57 +01:00
|
|
|
|
|
|
|
@if ($errors->has('name'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-04-16 09:00:57 +01:00
|
|
|
<strong>{{ $errors->first('name') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="form-group">
|
2017-04-16 09:00:57 +01:00
|
|
|
<label for="album-description" class="control-label" name="name">@lang('forms.description_label')</label>
|
2017-09-01 14:52:06 +01:00
|
|
|
<textarea class="form-control{{ $errors->has('description') ? ' is-invalid' : '' }}" id="album-description" rows="5" name="description">{{ old('description') }}</textarea>
|
2017-04-16 09:00:57 +01:00
|
|
|
|
|
|
|
@if ($errors->has('description'))
|
2017-09-01 14:52:06 +01:00
|
|
|
<div class="invalid-feedback">
|
2017-04-16 09:00:57 +01:00
|
|
|
<strong>{{ $errors->first('description') }}</strong>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</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>
|
|
|
|
<select class="form-control" name="parent_album_id" id="parent-album">
|
|
|
|
<option value="">@lang('forms.parent_album_placeholder')</option>
|
|
|
|
@foreach ($parent_albums as $key => $value)
|
|
|
|
<option value="{{ $key }}"{{ $key == $album->id || $value->isChildOf($album) ? ' disabled="disabled"' : '' }}{{ $key == old('parent_album_id') ? ' selected="selected"' : '' }}>{{ $value->display_name }}{{ $key == old('parent_album_id') ? ' ' . trans('forms.select_current_text') : '' }}</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
2017-09-04 20:37:42 +01:00
|
|
|
<div id="change-parent-warning" class="alert alert-warning" style="display: none;">
|
2017-09-03 08:40:39 +01:00
|
|
|
@lang('admin.edit_album_change_parent_warning')
|
2017-09-04 20:37:42 +01:00
|
|
|
|
|
|
|
<div class="mt-3">
|
|
|
|
<label class="custom-control custom-checkbox">
|
|
|
|
<input type="checkbox" class="custom-control-input" name="preserve_url_redirect" checked="checked">
|
|
|
|
<span class="custom-control-indicator"></span>
|
|
|
|
<span class="custom-control-description">@lang('admin.edit_album_change_parent_add_alias')</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
2017-09-03 08:40:39 +01:00
|
|
|
</div>
|
|
|
|
|
2017-04-16 09:00:57 +01:00
|
|
|
<div class="text-right">
|
|
|
|
<a href="{{ route('albums.show', ['id' => $album->id]) }}" class="btn btn-link">@lang('forms.cancel_action')</a>
|
|
|
|
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-check"></i> @lang('forms.save_action')</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2016-09-01 17:31:16 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-04 20:37:42 +01:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
// Show the change parent warning
|
|
|
|
var current_parent_id = '{{ $album->parent_album_id }}';
|
|
|
|
$('#parent-album').change(function() {
|
|
|
|
if ($('#parent-album').val() != current_parent_id)
|
|
|
|
{
|
|
|
|
$('#change-parent-warning').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('#change-parent-warning').hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|