Test image upload preview

This commit is contained in:
Dennis Eichhorn 2019-09-03 21:00:28 +02:00
parent 1ab01d6ea2
commit 24333efe70
4 changed files with 16 additions and 0 deletions

View File

@ -40,6 +40,15 @@ return [
],
],
'^.*/organization/unit/create.*$' => [
[
'dest' => '\Modules\Media\Controller\BackendController::setUpFileUploader',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::UNIT,
],
],
[
'dest' => '\Modules\Organization\Controller\BackendController:viewUnitCreate',
'verb' => RouteVerb::GET,

View File

@ -165,6 +165,9 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Organization/Theme/Backend/unit-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004703001, $request, $response));
$uploadView = new \Modules\Media\Theme\Backend\Components\InlinePreview\BaseView($this->app, $request, $response);
$view->addData('media-preview-upload', $uploadView);
$selectorView = new \Modules\Organization\Theme\Backend\Components\UnitTagSelector\UnitTagSelectorView($this->app, $request, $response);
$view->addData('unit-selector', $selectorView);

View File

@ -23,4 +23,5 @@ return ['Organization' => [
'Status' => 'Status',
'Unit' => 'Unit',
'Units' => 'Units',
'UnitLogo' => 'Unit Logo',
]];

View File

@ -25,6 +25,9 @@ echo $this->getData('nav')->render(); ?>
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" placeholder="&#xf040; Orange Management" required>
<tr><td><label for="iParent"><?= $this->getHtml('UnitLogo') ?></label>
<tr><td><img id="preview-logo" class="preview" src="#" accept="image/*" alt="<?= $this->getHtml('UnitLogo') ?>">
<tr><td><?= $this->getData('media-preview-upload')->render('fUnitCreate', 'logo', '/Modules/Organization'); ?>
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
<tr><td><?= $this->getData('unit-selector')->render('iParent', false); ?>
<tr><td><label for="iStatus"><?= $this->getHtml('Status') ?></label>