FEATURE: add possibilityy to upload and assign files to content pages
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Handlers;
|
namespace App\Handlers;
|
||||||
|
|
||||||
use App\Enumerations\ModuleNamesWithIds;
|
|
||||||
use App\Enumerations\TemplatePathsHumanReadableRootOnly;
|
use App\Enumerations\TemplatePathsHumanReadableRootOnly;
|
||||||
use App\Enumerations\WidgetTypes;
|
use App\Enumerations\WidgetTypes;
|
||||||
use App\Handlers\Contracts\AppHandler;
|
use App\Handlers\Contracts\AppHandler;
|
||||||
@@ -29,7 +28,8 @@ abstract class Handler implements AppHandler
|
|||||||
'basicInfo' => trans('admin/contents.basicInfo'),
|
'basicInfo' => trans('admin/contents.basicInfo'),
|
||||||
'meta' => trans('admin/contents.metaOptions'),
|
'meta' => trans('admin/contents.metaOptions'),
|
||||||
'publication' => trans('admin/contents.publicationOptions'),
|
'publication' => trans('admin/contents.publicationOptions'),
|
||||||
'appearance' => trans('admin/contents.appearance')
|
'appearance' => trans('admin/contents.appearance'),
|
||||||
|
'files' => trans('admin/contents.files')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +40,7 @@ abstract class Handler implements AppHandler
|
|||||||
'meta' => 'admin.content.formParts.metaInformation',
|
'meta' => 'admin.content.formParts.metaInformation',
|
||||||
'publication' => 'admin.content.formParts.publicationSetup',
|
'publication' => 'admin.content.formParts.publicationSetup',
|
||||||
'appearance' => 'admin.content.formParts.appearance',
|
'appearance' => 'admin.content.formParts.appearance',
|
||||||
|
'files' => 'admin.content.formParts.files'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,15 @@ class History implements HistoryHandler
|
|||||||
break;
|
break;
|
||||||
case 'metaDescription':
|
case 'metaDescription':
|
||||||
return Differ::htmlDiff($changeset->old_value, $changeset->new_value);
|
return Differ::htmlDiff($changeset->old_value, $changeset->new_value);
|
||||||
|
break;
|
||||||
|
case 'file':
|
||||||
|
if (!$changeset->old_value) {
|
||||||
|
// old value is null -> new file was uploaded
|
||||||
|
return trans('admin/history.uploadedFile', ['file' => $changeset->new_value]);
|
||||||
|
} else {
|
||||||
|
return trans('admin/history.deletedFile', ['file' => $changeset->old_value]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'status':
|
case 'status':
|
||||||
$statuses = ContentStatuses::getWithTranslations();
|
$statuses = ContentStatuses::getWithTranslations();
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ namespace App\Http\Controllers\Admin;
|
|||||||
use App\Enumerations\ActiveContentStatuses;
|
use App\Enumerations\ActiveContentStatuses;
|
||||||
use App\Events\CreateNewContent as CreateNewContentEvent;
|
use App\Events\CreateNewContent as CreateNewContentEvent;
|
||||||
use App\Http\Requests\CreateNewContentRequest;
|
use App\Http\Requests\CreateNewContentRequest;
|
||||||
|
use App\Http\Requests\Request;
|
||||||
use App\Models\Content;
|
use App\Models\Content;
|
||||||
|
use App\Models\ContentHasFile;
|
||||||
|
use App\Models\Directory;
|
||||||
use App\Models\File;
|
use App\Models\File;
|
||||||
use App\Models\Module;
|
use App\Models\Module;
|
||||||
use App\Models\Template;
|
use App\Models\Template;
|
||||||
@@ -105,17 +108,16 @@ class CreateNewContent extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// upload file - if provided
|
// upload file - if provided
|
||||||
if ($request->hasFile('titlePhoto')) {
|
$page->uploadTitlePhoto($request);
|
||||||
$file = $this->file->upload($request->file('titlePhoto'), $request);
|
|
||||||
|
|
||||||
$page->title_photo = $file['filename'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// save module-specific stuff
|
// save module-specific stuff
|
||||||
call_user_func_array([$module->handler, 'createNew'], [&$page, $request]);
|
call_user_func_array([$module->handler, 'createNew'], [&$page, $request]);
|
||||||
|
|
||||||
$page->save();
|
$page->save();
|
||||||
|
|
||||||
|
// upload files assigned to content page
|
||||||
|
$page->uploadRelatedFiles($request);
|
||||||
|
|
||||||
// fire event about creating new content page
|
// fire event about creating new content page
|
||||||
Event::fire(new CreateNewContentEvent($page));
|
Event::fire(new CreateNewContentEvent($page));
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ class EditContent extends Controller
|
|||||||
public function postEdit(EditContentRequest $request, $id)
|
public function postEdit(EditContentRequest $request, $id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
/**
|
||||||
|
* @var $page Content
|
||||||
|
*/
|
||||||
$page = Content::findOrFail($id);
|
$page = Content::findOrFail($id);
|
||||||
} catch (NotFoundHttpException $e) {
|
} catch (NotFoundHttpException $e) {
|
||||||
|
|
||||||
@@ -104,11 +107,7 @@ class EditContent extends Controller
|
|||||||
$request->titlePhotoFilename = $page->title_photo;
|
$request->titlePhotoFilename = $page->title_photo;
|
||||||
|
|
||||||
// upload file - if provided
|
// upload file - if provided
|
||||||
if ($request->hasFile('titlePhoto')) {
|
$page->uploadTitlePhoto($request);
|
||||||
$file = $this->file->upload($request->file('titlePhoto'), $request);
|
|
||||||
|
|
||||||
$request->titlePhotoFilename = $file['filename'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// array of fields in database and fields from request
|
// array of fields in database and fields from request
|
||||||
$fields = [
|
$fields = [
|
||||||
@@ -130,6 +129,7 @@ class EditContent extends Controller
|
|||||||
list($revision, $changedColumns) = $page->updateWithHistory($fields, $data);
|
list($revision, $changedColumns) = $page->updateWithHistory($fields, $data);
|
||||||
|
|
||||||
$changedColumns += call_user_func_array([$page->module_handler, 'edit'], [&$page, $request, $revision]);
|
$changedColumns += call_user_func_array([$page->module_handler, 'edit'], [&$page, $request, $revision]);
|
||||||
|
$changedColumns += $page->uploadRelatedFiles($request, $revision);
|
||||||
|
|
||||||
// was something changed?
|
// was something changed?
|
||||||
if ($changedColumns == 0) {
|
if ($changedColumns == 0) {
|
||||||
|
|||||||
+141
-13
@@ -3,7 +3,9 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Enumerations\ContentStatuses;
|
use App\Enumerations\ContentStatuses;
|
||||||
|
use App\Http\Requests\Request;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||||
|
|
||||||
@@ -38,6 +40,17 @@ class Content extends Model
|
|||||||
const STATUS_DRAFT = 'draft';
|
const STATUS_DRAFT = 'draft';
|
||||||
const STATUS_PROTECTED = 'protected';
|
const STATUS_PROTECTED = 'protected';
|
||||||
const STATUS_PUBLIC = 'public';
|
const STATUS_PUBLIC = 'public';
|
||||||
|
/**
|
||||||
|
* @var File
|
||||||
|
*/
|
||||||
|
private $file;
|
||||||
|
|
||||||
|
public function __construct(array $attributes = [])
|
||||||
|
{
|
||||||
|
parent::__construct($attributes);
|
||||||
|
|
||||||
|
$this->file = App::make(File::class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for query with setup filter for non-deleted and non-draft pages
|
* Getter for query with setup filter for non-deleted and non-draft pages
|
||||||
@@ -209,7 +222,7 @@ class Content extends Model
|
|||||||
* @param array $request
|
* @param array $request
|
||||||
* @param string $revisionId
|
* @param string $revisionId
|
||||||
*
|
*
|
||||||
* @return int number of changed columns
|
* @return array revisionID and number of changed columns
|
||||||
*/
|
*/
|
||||||
public function updateWithHistory(array $fields, array $request, $revisionId = null)
|
public function updateWithHistory(array $fields, array $request, $revisionId = null)
|
||||||
{
|
{
|
||||||
@@ -247,18 +260,7 @@ class Content extends Model
|
|||||||
|
|
||||||
if (trim($fieldValue) != $request[$fieldRequest]) {
|
if (trim($fieldValue) != $request[$fieldRequest]) {
|
||||||
|
|
||||||
// setup history object
|
$this->saveHistory();
|
||||||
$history = [
|
|
||||||
'user_id' => \Auth::user()->id,
|
|
||||||
'content_id' => $this->id,
|
|
||||||
'edit_batch' => $revisionId,
|
|
||||||
'column' => $fieldRequest,
|
|
||||||
'old_value' => $fieldValue,
|
|
||||||
'new_value' => $request[$fieldRequest]
|
|
||||||
];
|
|
||||||
|
|
||||||
// save history
|
|
||||||
ContentHistory::create($history);
|
|
||||||
|
|
||||||
// save change into database
|
// save change into database
|
||||||
if ($commonField) {
|
if ($commonField) {
|
||||||
@@ -281,6 +283,99 @@ class Content extends Model
|
|||||||
return [$revisionId, $changed];
|
return [$revisionId, $changed];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload and set some image as title photo
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
*/
|
||||||
|
public function uploadTitlePhoto(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->hasFile('titlePhoto')) {
|
||||||
|
$file = $this->file->upload($request->file('titlePhoto'), $request);
|
||||||
|
|
||||||
|
$this->title_photo = $file['filename'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload and assign files to newly created content page
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
* @param null $revisionId
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function uploadRelatedFiles(Request $request, $revisionId = null)
|
||||||
|
{
|
||||||
|
$files = $request->all()['files'];
|
||||||
|
$changed = 0;
|
||||||
|
|
||||||
|
// check if any file was removed
|
||||||
|
if ($revisionId) {
|
||||||
|
$changed += $this->removeRelatedFiles($revisionId, $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
// allow uploading only on created pages
|
||||||
|
if (!$this->id || !$files[0]) {
|
||||||
|
return $changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find or create new directory for files assigned to content
|
||||||
|
$directory = Directory::firstOrCreate([
|
||||||
|
'name' => '.content_files',
|
||||||
|
'hidden' => true
|
||||||
|
]);
|
||||||
|
$request->directoryId = $directory->id;
|
||||||
|
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (!$file) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$uploaded = $this->file->upload($file, $request);
|
||||||
|
|
||||||
|
// add assignement
|
||||||
|
ContentHasFile::create([
|
||||||
|
'file_id' => $uploaded['id'],
|
||||||
|
'content_id' => $this->id
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($revisionId) {
|
||||||
|
$this->saveHistory($revisionId, 'file', null, ['file' => $uploaded['file']->getClientOriginalName()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$changed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete files from association
|
||||||
|
*
|
||||||
|
* @param $revisionId
|
||||||
|
* @param $request
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
private function removeRelatedFiles($revisionId, $request)
|
||||||
|
{
|
||||||
|
$files = array_keys((array)$request->keepAssigned);
|
||||||
|
|
||||||
|
$allFiles = $this->files()
|
||||||
|
->whereNotIn('id', $files)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
foreach ($allFiles as $file) {
|
||||||
|
$this->saveHistory($revisionId, 'file', $file->original_filename, ['file' => null]);
|
||||||
|
|
||||||
|
ContentHasFile::where('content_id', $this->id)
|
||||||
|
->where('file_id', $file->id)
|
||||||
|
->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
return count($allFiles);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark relationship with its historical records
|
* Mark relationship with its historical records
|
||||||
*
|
*
|
||||||
@@ -300,4 +395,37 @@ class Content extends Model
|
|||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\User', 'user_id');
|
return $this->belongsTo('App\Models\User', 'user_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Related files to content page
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
|
public function files()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(File::class, 'contents_has_files');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save history entry into database
|
||||||
|
*
|
||||||
|
* @param $revisionId
|
||||||
|
* @param $fieldRequest
|
||||||
|
* @param $fieldValue
|
||||||
|
* @param $request
|
||||||
|
*/
|
||||||
|
private function saveHistory($revisionId, $fieldRequest, $fieldValue, $request)
|
||||||
|
{ // setup history object
|
||||||
|
$history = [
|
||||||
|
'user_id' => \Auth::user()->id,
|
||||||
|
'content_id' => $this->id,
|
||||||
|
'edit_batch' => $revisionId,
|
||||||
|
'column' => $fieldRequest,
|
||||||
|
'old_value' => $fieldValue,
|
||||||
|
'new_value' => $request[$fieldRequest]
|
||||||
|
];
|
||||||
|
|
||||||
|
// save history
|
||||||
|
ContentHistory::create($history);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ContentHasFile extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
public $timestamps = false;
|
||||||
|
public $table = 'contents_has_files';
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'content_id',
|
||||||
|
'file_id'
|
||||||
|
];
|
||||||
|
}
|
||||||
+1
-1
@@ -106,7 +106,7 @@ class File extends Model
|
|||||||
// save optional fields
|
// save optional fields
|
||||||
$optionalFields = ['name', 'description', 'keywords', 'directoryId'];
|
$optionalFields = ['name', 'description', 'keywords', 'directoryId'];
|
||||||
foreach ($optionalFields as $field) {
|
foreach ($optionalFields as $field) {
|
||||||
if ($request->has($field)) {
|
if (isset($request->{$field})) {
|
||||||
|
|
||||||
$snakeField = snake_case($field);
|
$snakeField = snake_case($field);
|
||||||
$newFile->$snakeField = $request->$field;
|
$newFile->$snakeField = $request->$field;
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AssignFilesToPages extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('contents_has_files', function (Blueprint $table) {
|
||||||
|
$table->integer('content_id');
|
||||||
|
$table->integer('file_id');
|
||||||
|
$table->primary(['content_id', 'file_id']);
|
||||||
|
|
||||||
|
$table->foreign('content_id')
|
||||||
|
->references('id')
|
||||||
|
->on('contents')
|
||||||
|
->onDelete('cascade')
|
||||||
|
->onUpdate('cascade');
|
||||||
|
|
||||||
|
$table->foreign('file_id')
|
||||||
|
->references('id')
|
||||||
|
->on('files')
|
||||||
|
->onDelete('cascade')
|
||||||
|
->onUpdate('cascade');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::drop('contents_has_files');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,10 @@
|
|||||||
<li class="tabs-title">
|
<li class="tabs-title">
|
||||||
<a href="#appearance">@lang('staticpages::admin.appearance')</a>
|
<a href="#appearance">@lang('staticpages::admin.appearance')</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="tabs-title">
|
||||||
|
<a href="#files">@lang('staticpages::admin.files')</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tabs-content" data-tabs-content="static-page-controls">
|
<div class="tabs-content" data-tabs-content="static-page-controls">
|
||||||
@@ -169,6 +173,20 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="tabs-panel" id="files">
|
||||||
|
<div class="row">
|
||||||
|
<div class="columns large-12">
|
||||||
|
<label>
|
||||||
|
@lang('staticpages::admin.files')
|
||||||
|
|
||||||
|
|
||||||
|
<input type="file" name="files[]" multiple />
|
||||||
|
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ return [
|
|||||||
"field_published_to" => "Publikováno do",
|
"field_published_to" => "Publikováno do",
|
||||||
"field_title" => "Titulek stránky",
|
"field_title" => "Titulek stránky",
|
||||||
"field_url" => "URL",
|
"field_url" => "URL",
|
||||||
|
"files" => "Soubory",
|
||||||
"homepageProtected" => "Domovská stránka je zobrazena jen pro přihlášené uživatele. Toto může i nemusí být chyba.",
|
"homepageProtected" => "Domovská stránka je zobrazena jen pro přihlášené uživatele. Toto může i nemusí být chyba.",
|
||||||
"homepageSetup" => "Domovská stránka úspěšně nastavena.",
|
"homepageSetup" => "Domovská stránka úspěšně nastavena.",
|
||||||
"invalidPage" => "Požadovaná stránka neexistuje.",
|
"invalidPage" => "Požadovaná stránka neexistuje.",
|
||||||
"invalidStatus" => "Nelze změnit stav stránky na něco nedefinovaného.",
|
"invalidStatus" => "Nelze změnit stav stránky na něco nedefinovaného.",
|
||||||
|
"lockUrl" => "Zachovat URL?",
|
||||||
"makeDraft" => "Převést na koncept",
|
"makeDraft" => "Převést na koncept",
|
||||||
"makeProtected" => "Zobrazit jen pro přihlášené",
|
"makeProtected" => "Zobrazit jen pro přihlášené",
|
||||||
"makePublic" => "Publikovat",
|
"makePublic" => "Publikovat",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ return [
|
|||||||
"backToEdit" => "Zpět na editaci obsahu",
|
"backToEdit" => "Zpět na editaci obsahu",
|
||||||
"backToOverview" => "Zpět na přehled historie",
|
"backToOverview" => "Zpět na přehled historie",
|
||||||
"changedFromTo" => "Změna z <del>:from</del> na <ins>:to</ins>",
|
"changedFromTo" => "Změna z <del>:from</del> na <ins>:to</ins>",
|
||||||
|
"columnFile" => "Přiřazené soubory",
|
||||||
"columnIs_homepage" => "Domovská stránka",
|
"columnIs_homepage" => "Domovská stránka",
|
||||||
"columnMetaDescription" => "Popis",
|
"columnMetaDescription" => "Popis",
|
||||||
"columnMetaKeywords" => "Klíčová slova",
|
"columnMetaKeywords" => "Klíčová slova",
|
||||||
@@ -13,10 +14,12 @@ return [
|
|||||||
"columnTitle" => "Titulek",
|
"columnTitle" => "Titulek",
|
||||||
"columnTitlePhotoFilename" => "Titulní obrázek",
|
"columnTitlePhotoFilename" => "Titulní obrázek",
|
||||||
"columnUrl" => "URL",
|
"columnUrl" => "URL",
|
||||||
|
"deletedFile" => "Odebrán soubor <del>:file</del>.",
|
||||||
"diff" => "Rozdíl",
|
"diff" => "Rozdíl",
|
||||||
"diffPageName" => "Rozdíl v :column",
|
"diffPageName" => "Rozdíl v :column",
|
||||||
"emptyValue" => "<em>nic</em>",
|
"emptyValue" => "<em>nic</em>",
|
||||||
"numOfChanges" => "Jedna změna|:count změny|:count změn",
|
"numOfChanges" => "Jedna změna|:count změny|:count změn",
|
||||||
"pageName" => "Historie :name",
|
"pageName" => "Historie :name",
|
||||||
"setupAsHomepage" => "Nastaveno jako domovská stránka",
|
"setupAsHomepage" => "Nastaveno jako domovská stránka",
|
||||||
|
"uploadedFile" => "Nahrán soubor <ins>:file</ins>.",
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -43,5 +43,6 @@ return [
|
|||||||
'homepageProtected' => 'Your homepage is displayed only for logged in users. This may or may not be an error.',
|
'homepageProtected' => 'Your homepage is displayed only for logged in users. This may or may not be an error.',
|
||||||
'parentPage' => 'Parent page',
|
'parentPage' => 'Parent page',
|
||||||
'alreadyHomepage' => 'Homepage',
|
'alreadyHomepage' => 'Homepage',
|
||||||
|
'files' => 'Files',
|
||||||
'lockUrl' => 'Keep URL'
|
'lockUrl' => 'Keep URL'
|
||||||
];
|
];
|
||||||
@@ -7,6 +7,7 @@ return [
|
|||||||
'columnMetaKeywords' => 'Meta keywords',
|
'columnMetaKeywords' => 'Meta keywords',
|
||||||
'columnMetaDescription' => 'Description',
|
'columnMetaDescription' => 'Description',
|
||||||
'columnStatus' => 'Page visibility',
|
'columnStatus' => 'Page visibility',
|
||||||
|
'columnFile' => 'Assigned file',
|
||||||
'columnTemplate' => 'Template',
|
'columnTemplate' => 'Template',
|
||||||
'columnIs_homepage' => 'Homepage',
|
'columnIs_homepage' => 'Homepage',
|
||||||
'columnParentPage' => 'Parent page',
|
'columnParentPage' => 'Parent page',
|
||||||
@@ -18,6 +19,7 @@ return [
|
|||||||
'diffPageName' => 'Difference of :column',
|
'diffPageName' => 'Difference of :column',
|
||||||
'backToOverview' => 'Back to history overview',
|
'backToOverview' => 'Back to history overview',
|
||||||
'backToEdit' => 'Back to editation form',
|
'backToEdit' => 'Back to editation form',
|
||||||
'setupAsHomepage' => 'Setup as homepage'
|
'setupAsHomepage' => 'Setup as homepage',
|
||||||
|
'uploadedFile' => 'File <ins>:file</ins> was uploaded.',
|
||||||
|
'deletedFile' => 'File <del>:file</del> was removed from this page.',
|
||||||
];
|
];
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<div class="row">
|
||||||
|
|
||||||
|
@if(count($page->files))
|
||||||
|
<div class="column large-6">
|
||||||
|
<ul>
|
||||||
|
@foreach($page->files as $file)
|
||||||
|
<li><label><input type="checkbox" name="keepAssigned[{{$file->id}}]" checked /> {{$file->original_filename}}</label></li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="columns large-6">
|
||||||
|
<label>
|
||||||
|
@lang('admin/contents.files')
|
||||||
|
|
||||||
|
<input type="file" name="files[]" multiple />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user