fix templates

This commit is contained in:
Dennis Eichhorn 2024-04-17 17:45:07 +00:00
parent fd8b41cdaf
commit 3884f7e2d5
5 changed files with 66 additions and 59 deletions

View File

@ -132,6 +132,12 @@ final class BackendController extends Controller
public function viewEditorView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
if (!$request->hasData('id')) {
$response->header->status = RequestStatusCode::R_404;
$view->setTemplate('/Web/Backend/Error/404');
return $view;
}
/** @var \Modules\Editor\Models\EditorDoc $doc */
$doc = EditorDocMapper::get()

View File

@ -1,6 +1,6 @@
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Editor', 'Editor', 'Backend'); ?></div>
<div class="portlet-body">
<input name="title" type="text" class="wf-100" value="">
@ -17,7 +17,7 @@
<input id="bAttributeSave" formmethod="post" type="submit" class="save-form vh button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
<input type="submit" class="cancel-form vh button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
</div>
</div>
</section>
</div>
<div class="col-xs-12 col-md-6">

View File

@ -17,7 +17,7 @@ use phpOMS\Uri\UriFactory;
?>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Note', 'Editor', 'Backend'); ?></div>
<form id="<?= $this->form; ?>-create">
<div class="portlet-body">
@ -32,7 +32,7 @@ use phpOMS\Uri\UriFactory;
</div>
</div>
</form>
</div>
</section>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Notes', 'Editor', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>

View File

@ -24,7 +24,7 @@ echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-8">
<div class="portlet">
<section class="portlet">
<div class="portlet-body">
<form id="fEditor" method="<?= $isNewDoc ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}editor?{?}&csrf={$CSRF}'); ?>">
<div class="ipt-wrap">
@ -33,13 +33,13 @@ echo $this->data['nav']->render(); ?>
</div>
</form>
</div>
</div>
</section>
<div class="portlet">
<section class="portlet">
<div class="portlet-body">
<?= $this->getData('editor')->render('editor'); ?>
</div>
</div>
</section>
<section class="portlet">
<div class="portlet-body">
@ -55,14 +55,14 @@ echo $this->data['nav']->render(); ?>
</div>
<div class="col-xs-12 col-md-4">
<div class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Tags', 'Tag'); ?></div>
<div class="portlet-body">
<?= $this->getData('tagSelector')->render('iTag', 'tag', 'fEditor', false); ?>
</div>
</div>
</section>
<div class="portlet">
<section class="portlet">
<div class="portlet-body">
<form>
<table class="layout">
@ -75,6 +75,6 @@ echo $this->data['nav']->render(); ?>
</table>
</form>
</div>
</div>
</section>
</div>
</div>

View File

@ -67,7 +67,7 @@ echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Documents'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="editorList" class="default sticky">
@ -114,51 +114,52 @@ echo $this->data['nav']->render(); ?>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<?php if (!empty($parentPath)) : $url = UriFactory::build('{/base}/editor/list?path=' . $parentPath); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><i class="g-icon">folder_open</i></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>">..
</a>
<td>
<td>
<?php endif; ?>
<?php $count = 0; foreach ($collections as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/editor/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->name);
?>
<tr data-href="<?= $url; ?>">
<td><label class="checkbox" for="editorList-<?= $key; ?>">
<input type="checkbox" id="editorList-<?= $key; ?>" name="editorselect">
<span class="checkmark"></span>
</label>
<td><a href="<?= $url; ?>"><i class="g-icon">folder_open</i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $value->createdBy->id); ?>"><?= $this->printHtml($value->createdBy->name1); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php foreach ($docs as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/editor/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td><label class="checkbox" for="editorList-<?= $key; ?>">
<input type="checkbox" id="editorList-<?= $key; ?>" name="editorselect">
<span class="checkmark"></span>
</label>
<td><i class="g-icon">article</i>
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->title); ?></a>
<td data-label="<?= $this->getHtml('Creator'); ?>"><a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $value->createdBy->id); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?></a>
<td data-label="<?= $this->getHtml('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<!--
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
-->
<tbody>
<?php if (!empty($parentPath)) : $url = UriFactory::build('{/base}/editor/list?path=' . $parentPath); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><i class="g-icon">folder_open</i></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>">..
</a>
<td>
<td>
<?php endif; ?>
<?php $count = 0; foreach ($collections as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/editor/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->name);
?>
<tr data-href="<?= $url; ?>">
<td><label class="checkbox" for="editorList-<?= $key; ?>">
<input type="checkbox" id="editorList-<?= $key; ?>" name="editorselect">
<span class="checkmark"></span>
</label>
<td><a href="<?= $url; ?>"><i class="g-icon">folder_open</i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $value->createdBy->id); ?>"><?= $this->printHtml($value->createdBy->name1); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php foreach ($docs as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/editor/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td><label class="checkbox" for="editorList-<?= $key; ?>">
<input type="checkbox" id="editorList-<?= $key; ?>" name="editorselect">
<span class="checkmark"></span>
</label>
<td><i class="g-icon">article</i>
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->title); ?></a>
<td data-label="<?= $this->getHtml('Creator'); ?>"><a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $value->createdBy->id); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?></a>
<td data-label="<?= $this->getHtml('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<!--
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
-->
</section>
</div>
</div>