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
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Profile/Theme/Backend/profile-list');
if ($request->getData('ptype') === 'p') {
$view->data['accounts'] = ProfileMapper::getAll()
->with('account')
->with('image')
->where('id', $request->getDataInt('offset') ?? 0, '<')
->limit(25)->execute();
} elseif ($request->getData('ptype') === 'n') {
$view->data['accounts'] = ProfileMapper::getAll()
->with('account')
->with('image')
->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();
}
$view->data['accounts'] = ProfileMapper::getAll()
->with('account')
->with('image')
->paginate(
'id',
$request->getData('ptype'),
$request->getDataInt('offset')
)
->limit(25)
->executeGetArray();
/** @var \Model\Setting $profileImage */
$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="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('CreateProfile'); ?></h1></header>
<div class="inner">
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed">
<tbody>
<tr><td><label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<tr><td><?= $this->getData('accGrpSelector')->render('iAccount', ''); ?>
<tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-module">
</table>
</form>
</div>
<section class="portlet">
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<div class="portlet-head"><?= $this->getHtml('CreateProfile'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<?= $this->getData('accGrpSelector')->render('iAccount', ''); ?>
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-module">
</div>
</form>
</section>
</div>
</div>