Skip to content
Snippets Groups Projects
Commit b42ae910 authored by Kevin von Spiczak's avatar Kevin von Spiczak
Browse files

[TASK] better error messages for no results

parent 0e33b327
No related branches found
No related tags found
1 merge request!27[FEATURE] save filters in session
......@@ -85,6 +85,7 @@ class BackendController extends ActionController {
*
* @param array $filters
* @return void
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function indexAction(array $filters = []): void {
$pageUid = (int) GeneralUtility::_GP('id');
......@@ -145,9 +146,6 @@ class BackendController extends ActionController {
$this->view->assign('filters', $filters);
$this->view->assign('jobs', $jobs);
if (!$totalJobCount && $pageUid) {
// clear previously set filters again,
// without this, the user would be stuck without filters and just the flash message
$backendUser->pushModuleData('tools_beuser/index.php/web_SgJobsBackend_filters', []);
$this->addFlashMessage(
LocalizationUtility::translate('backend.notice.noRecords', 'SgJobs'), '', FlashMessage::INFO
);
......
......@@ -12,7 +12,7 @@
<f:section name="main">
<f:flashMessages />
<f:if condition="{jobs}">
<f:if condition="{pageUid}">
<f:then>
<f:render partial="Filter" arguments="{_all}"/>
<f:render partial="CreateJob" arguments="{_all}"/>
......@@ -27,31 +27,40 @@
</h2>
</f:if>
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="tx_sgjobs_domain_model_job" class="table table-striped table-hover">
<sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<f:for each="{paginatedJobs}" as="job">
<tr data-uid="{job.uid}">
<td nowrap="nowrap" class="col-icon">
<f:format.raw><sg:backend.icon table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
</td>
<td style="white-space: normal;">
<be:link.editRecord uid="{job.uid}" table="tx_sgjobs_domain_model_job">
<span>{job.title} - {job.company.name}, {job.company.city}</span>
</be:link.editRecord>
</td>
<td nowrap="nowrap" class="col-control">
<f:format.raw><sg:backend.control table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
</td>
</tr>
</f:for>
</tbody>
</sg:backend.widget.paginate>
</table>
</div>
</div>
<f:if condition="{jobs}">
<f:then>
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="tx_sgjobs_domain_model_job" class="table table-striped table-hover">
<sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<f:for each="{paginatedJobs}" as="job">
<tr data-uid="{job.uid}">
<td nowrap="nowrap" class="col-icon">
<f:format.raw><sg:backend.icon table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
</td>
<td style="white-space: normal;">
<be:link.editRecord uid="{job.uid}" table="tx_sgjobs_domain_model_job">
<span>{job.title} - {job.company.name}, {job.company.city}</span>
</be:link.editRecord>
</td>
<td nowrap="nowrap" class="col-control">
<f:format.raw><sg:backend.control table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
</td>
</tr>
</f:for>
</tbody>
</sg:backend.widget.paginate>
</table>
</div>
</div>
</f:then>
<f:else>
<p>
<f:translate key="backend.noJobsMessage"/>
</p>
</f:else>
</f:if>
</f:then>
<f:else>
<f:render partial="SelectRoot" arguments="{pages: pages}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment