fix templates

This commit is contained in:
Dennis Eichhorn 2024-04-17 17:45:07 +00:00
parent 19d9fe5089
commit af4ff6668f
2 changed files with 23 additions and 33 deletions

View File

@ -68,28 +68,18 @@ final class BackendController extends Controller
public function viewProfileList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewProfileList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new View($this->app->l11nManager, $request, $response); $view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Profile/Theme/Backend/profile-list'); $view->setTemplate('/Modules/Profile/Theme/Backend/profile-list');
if ($request->getData('ptype') === 'p') { $view->data['accounts'] = ProfileMapper::getAll()
$view->data['accounts'] = ProfileMapper::getAll() ->with('account')
->with('account') ->with('image')
->with('image') ->paginate(
->where('id', $request->getDataInt('offset') ?? 0, '<') 'id',
->limit(25)->execute(); $request->getData('ptype'),
} elseif ($request->getData('ptype') === 'n') { $request->getDataInt('offset')
$view->data['accounts'] = ProfileMapper::getAll() )
->with('account') ->limit(25)
->with('image') ->executeGetArray();
->where('id', $request->getDataInt('offset') ?? 0, '>')
->limit(25)->execute();
} else {
$view->data['accounts'] = ProfileMapper::getAll()
->with('account')
->with('image')
->where('id', 0, '>')
->limit(25)->executeGetArray();
}
/** @var \Model\Setting $profileImage */ /** @var \Model\Setting $profileImage */
$profileImage = $this->app->appSettings->get(names: SettingsEnum::DEFAULT_PROFILE_IMAGE, module: 'Profile'); $profileImage = $this->app->appSettings->get(names: SettingsEnum::DEFAULT_PROFILE_IMAGE, module: 'Profile');

View File

@ -17,19 +17,19 @@ echo $this->data['nav']->render();
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<section class="box wf-100"> <section class="portlet">
<header><h1><?= $this->getHtml('CreateProfile'); ?></h1></header> <form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<div class="portlet-head"><?= $this->getHtml('CreateProfile'); ?></div>
<div class="inner"> <div class="portlet-body">
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>"> <div class="form-group">
<table class="layout wf-100" style="table-layout: fixed"> <label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<tbody> <?= $this->getData('accGrpSelector')->render('iAccount', ''); ?>
<tr><td><label for="iAccount"><?= $this->getHtml('Account'); ?></label> </div>
<tr><td><?= $this->getData('accGrpSelector')->render('iAccount', ''); ?> </div>
<tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-module"> <div class="portlet-foot">
</table> <input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-module">
</form> </div>
</div> </form>
</section> </section>
</div> </div>
</div> </div>