Skip to content

Commit

Permalink
[TASK] Adjust title and action columns in history/undo view
Browse files Browse the repository at this point in the history
To better identify the different record types, the record icon is now
displayed next to the record title and some unnecessary double quotes
are removed. The actions are now displayed as badges.

Also, in the h1 the table name and UID have been removed.

Resolves: #103433
Related: #103291
Releases: main
Change-Id: I5b09258ca688f0d4ecdd1737b00b8b5a156e6ace
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83528
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Jasmina Ließmann <minapokhalo+typo3@gmail.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Jasmina Ließmann <minapokhalo+typo3@gmail.com>
  • Loading branch information
minapok committed Apr 10, 2024
1 parent 7d9bd7f commit 73a1e9e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Build/Sources/Sass/component/_table.scss
Expand Up @@ -102,7 +102,7 @@
}

.col-recordtitle {
width: 200px;
width: 250px;
}

.col-state,
Expand Down
Expand Up @@ -279,6 +279,8 @@ protected function displayMultipleDiff(array $diff)
$elParts = explode(':', $key);
$singleLine['revertRecordUrl'] = $this->buildUrl(['rollbackFields' => $key]);
$singleLine['title'] = $this->generateTitle($elParts[0], $elParts[1]);
$singleLine['recordTable'] = $elParts[0];
$singleLine['recordUid'] = $elParts[1];
$lines[] = $singleLine;
}
$this->view->assign('revertAllUrl', $this->buildUrl(['rollbackFields' => 'ALL']));
Expand Down Expand Up @@ -442,8 +444,7 @@ protected function generateTitle($table, $uid): string
$title = '';
if (!empty($GLOBALS['TCA'][$table]['ctrl']['label'])) {
$record = $this->getRecord($table, (int)$uid) ?? [];
$title .= '"' . BackendUtility::getRecordTitle($table, $record) . '"';
$title .= ' (' . $table . ':' . $uid . ')';
$title .= BackendUtility::getRecordTitle($table, $record);
}
return $title;
}
Expand Down
Expand Up @@ -22,7 +22,7 @@
<source>Action</source>
</trans-unit>
<trans-unit id="column.recordTitle" resname="column.recordTitle">
<source>Record title</source>
<source>Title</source>
</trans-unit>
<trans-unit id="differences" resname="differences">
<source>Differences</source>
Expand Down
Expand Up @@ -15,7 +15,7 @@ <h3>{day}</h3>
<tr>
<th class="col-time">{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:time')}</th>
<th colspan="2">{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:user')}</th>
<th class="col-recordtitle">{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:column.recordTitle')}</th>
<th colspan="2">{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:column.recordTitle')}</th>
<th class="col-action">{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:column.action')}</th>
<th class="col-differences">{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:differences')}</th>
<th class="col-control nowrap"><span class="visually-hidden">{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels._CONTROL_')}</span></th>
Expand Down Expand Up @@ -57,9 +57,18 @@ <h3>{day}</h3>
</span>
</f:if>
</td>
<td class="col-recordtitle">{historyRow.title -> f:format.raw()}</td>
<td class="col-icon nowrap">
<span title="id={historyRow.recordUid}">
<core:iconForRecord table="{historyRow.recordTable}" row="{historyRow}" />
</span>
</td>
<td class="col-recordtitle">
{historyRow.title -> f:format.raw()} ({historyRow.recordTable}:{historyRow.recordUid})
</td>
<td class="col-action">
<strong><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:historyRow.actiontype.{historyRow.actiontype}" /></strong>
<span class="badge badge-secondary">
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:historyRow.actiontype.{historyRow.actiontype}" />
</span>
</td>
<td class="col-differences">
<f:if condition="{historyRow.fieldNames}">
Expand Down
Expand Up @@ -11,7 +11,7 @@ <h1>
{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:title')}
<f:if condition="{recordTable}">
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:headline.titleOf" />
{recordTableReadable} {recordTitle}
{recordTableReadable} "{recordTitle}"
</f:if>
</h1>
<f:render partial="RecordHistory/Settings" arguments="{_all}" />
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/backend/Resources/Public/Css/backend.css
Expand Up @@ -3468,7 +3468,7 @@ typo3-backend-form-selecttree-toolbar{display:block;border-bottom:1px solid rgba
.table .col-datetime{width:14ch;white-space:nowrap;box-sizing:content-box}
.table .col-avatar{width:32px;box-sizing:content-box}
.table .col-action,.table .col-username{width:15ch}
.table .col-recordtitle{width:200px}
.table .col-recordtitle{width:250px}
.table .col-action,.table .col-recordtitle,.table .col-state{min-width:120px}
.table .col-differences,.table .col-task{min-width:400px}
.table .col-clipboard,.table .col-control,.table .col-nowrap{white-space:nowrap!important}
Expand Down

0 comments on commit 73a1e9e

Please sign in to comment.