FIX: fix removing image after resaving page
This commit is contained in:
@@ -147,7 +147,11 @@ class EditContent extends Controller
|
|||||||
$request->url = Str::slug($request->url);
|
$request->url = Str::slug($request->url);
|
||||||
$request->parentPage = $request->parentPage ? $request->parentPage : null;
|
$request->parentPage = $request->parentPage ? $request->parentPage : null;
|
||||||
|
|
||||||
$request->titlePhotoFilename = $file ? $file['filename'] : null;
|
if (!$file) {
|
||||||
|
$request->titlePhotoFilename = empty($request->existingTitlePhoto) ? null : $request->existingTitlePhoto;
|
||||||
|
} else {
|
||||||
|
$request->titlePhotoFilename = $file['filename'];
|
||||||
|
}
|
||||||
|
|
||||||
// array of fields in database and fields from request
|
// array of fields in database and fields from request
|
||||||
$fields = [
|
$fields = [
|
||||||
|
|||||||
+569
-564
File diff suppressed because it is too large
Load Diff
@@ -53,5 +53,6 @@ return [
|
|||||||
'status' => 'Status',
|
'status' => 'Status',
|
||||||
'moduleName' => 'Module',
|
'moduleName' => 'Module',
|
||||||
'actions' => 'Actions',
|
'actions' => 'Actions',
|
||||||
'invalidTemplateSelected' => 'Invalid template selected! This page cannot be rendered!'
|
'invalidTemplateSelected' => 'Invalid template selected! This page cannot be rendered!',
|
||||||
|
'deleteTitlePhoto' => 'Delete title photo'
|
||||||
];
|
];
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
@if($page->title_photo)
|
@if($page->title_photo)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 title-photo text-center">
|
<div id="titlePhotoContainer"
|
||||||
<img src="{{config('app.upload_url')}}/{{$page->title_photo}}" alt="" />
|
class="col-lg-4 col-lg-offset-4 col-md-6 col-md-offset-3 col-sm-12 title-photo text-center">
|
||||||
|
<input type="hidden" id="existingTitlePhoto" value="{{$page->title_photo}}" name="existingTitlePhoto">
|
||||||
|
<p><img src="{{config('app.upload_url')}}/{{$page->title_photo}}" alt="" /></p>
|
||||||
|
<p>
|
||||||
|
<a href="javascript:void(0)" id="removeTitlePhoto" class="btn btn-warning" data-toggle="tooltip"
|
||||||
|
title="@lang('admin/contents.deleteTitlePhoto')"><i
|
||||||
|
class="fa fa-trash"></i></a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Reference in New Issue
Block a user