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 { ...@@ -85,6 +85,7 @@ class BackendController extends ActionController {
* *
* @param array $filters * @param array $filters
* @return void * @return void
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/ */
public function indexAction(array $filters = []): void { public function indexAction(array $filters = []): void {
$pageUid = (int) GeneralUtility::_GP('id'); $pageUid = (int) GeneralUtility::_GP('id');
...@@ -145,9 +146,6 @@ class BackendController extends ActionController { ...@@ -145,9 +146,6 @@ class BackendController extends ActionController {
$this->view->assign('filters', $filters); $this->view->assign('filters', $filters);
$this->view->assign('jobs', $jobs); $this->view->assign('jobs', $jobs);
if (!$totalJobCount && $pageUid) { 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( $this->addFlashMessage(
LocalizationUtility::translate('backend.notice.noRecords', 'SgJobs'), '', FlashMessage::INFO LocalizationUtility::translate('backend.notice.noRecords', 'SgJobs'), '', FlashMessage::INFO
); );
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<f:section name="main"> <f:section name="main">
<f:flashMessages /> <f:flashMessages />
<f:if condition="{jobs}"> <f:if condition="{pageUid}">
<f:then> <f:then>
<f:render partial="Filter" arguments="{_all}"/> <f:render partial="Filter" arguments="{_all}"/>
<f:render partial="CreateJob" arguments="{_all}"/> <f:render partial="CreateJob" arguments="{_all}"/>
...@@ -27,31 +27,40 @@ ...@@ -27,31 +27,40 @@
</h2> </h2>
</f:if> </f:if>
<div class="panel panel-default recordlist"> <f:if condition="{jobs}">
<div class="table-fit"> <f:then>
<table data-table="tx_sgjobs_domain_model_job" class="table table-striped table-hover"> <div class="panel panel-default recordlist">
<sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}"> <div class="table-fit">
<tbody> <table data-table="tx_sgjobs_domain_model_job" class="table table-striped table-hover">
<f:for each="{paginatedJobs}" as="job"> <sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tr data-uid="{job.uid}"> <tbody>
<td nowrap="nowrap" class="col-icon"> <f:for each="{paginatedJobs}" as="job">
<f:format.raw><sg:backend.icon table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw> <tr data-uid="{job.uid}">
</td> <td nowrap="nowrap" class="col-icon">
<td style="white-space: normal;"> <f:format.raw><sg:backend.icon table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
<be:link.editRecord uid="{job.uid}" table="tx_sgjobs_domain_model_job"> </td>
<span>{job.title} - {job.company.name}, {job.company.city}</span> <td style="white-space: normal;">
</be:link.editRecord> <be:link.editRecord uid="{job.uid}" table="tx_sgjobs_domain_model_job">
</td> <span>{job.title} - {job.company.name}, {job.company.city}</span>
<td nowrap="nowrap" class="col-control"> </be:link.editRecord>
<f:format.raw><sg:backend.control table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw> </td>
</td> <td nowrap="nowrap" class="col-control">
</tr> <f:format.raw><sg:backend.control table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
</f:for> </td>
</tbody> </tr>
</sg:backend.widget.paginate> </f:for>
</table> </tbody>
</div> </sg:backend.widget.paginate>
</div> </table>
</div>
</div>
</f:then>
<f:else>
<p>
<f:translate key="backend.noJobsMessage"/>
</p>
</f:else>
</f:if>
</f:then> </f:then>
<f:else> <f:else>
<f:render partial="SelectRoot" arguments="{pages: pages}"/> <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