Merge branch 'dev' into module_profiler

This commit is contained in:
Michal Kváček
2017-03-27 21:24:31 +02:00
4 changed files with 15 additions and 3 deletions
@@ -2,10 +2,12 @@
namespace App\CMS\Pipeline\SavePipeline\Process;
use App\CMS\Contracts\Content\SavePipeline\Process;
use App\CMS\Helpers\RootDirectory;
use App\Models\Content\Content;
use App\Models\FileManager\File;
class UploadTitlePhoto implements Process {
class UploadTitlePhoto implements Process
{
/**
* Process and modify given page
*
@@ -23,7 +25,10 @@ class UploadTitlePhoto implements Process {
$page->titlePhoto = isset($input['existingTitlePhoto']) ? $input['existingTitlePhoto'] : null;
if (!is_null($titlePhoto)) {
$file = $fileModel->upload($titlePhoto);
$root = RootDirectory::get();
$data = ['directoryId' => $root->id];
$file = $fileModel->upload($titlePhoto, (object)$data);
$page->titlePhoto = $file ? $file['filename'] : null;
}
@@ -153,6 +153,7 @@ header.top-bar h1 a {
.title-photo img {
border-radius: 0 0 5px 5px;
width: 100%;
}
.trainer {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 KiB

After

Width:  |  Height:  |  Size: 324 KiB

@@ -9,10 +9,16 @@
@section('content')
@if (!empty($page->titlePhoto))
<div class="row title-photo">
<img src="@upload($page->titlePhoto)" alt="">
</div>
@endif
<div class="row content-container">
<div class="column text-center m-b-25 show-for-large">
<h2>{{$page->title}}</h2>
<h1>{{$page->title}}</h1>
</div>
<div class="column text-center large-4">