PHRAS-3338 detail view add icon in title bar

This commit is contained in:
aina esokia
2021-01-15 12:08:18 +03:00
parent f4aea89fd7
commit ed1cdc6315
5 changed files with 50 additions and 5 deletions

View File

@@ -65498,7 +65498,18 @@ var previewRecordService = function previewRecordService(services) {
(0, _jquery2.default)('#PREVIEWBOX img.record.zoomable').draggable();
}
(0, _jquery2.default)('#SPANTITLE').empty().append(data.title);
var basketIcon = '';
if (data.containerType !== null) {
if (data.containerType === 'feedback') {
basketIcon = "<img src='/assets/common/images/icons/basket_validation.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
} else if (data.containerType === 'push') {
basketIcon = "<img src='/assets/common/images/icons/basket_push.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
} else {
basketIcon = "<img src='/assets/common/images/icons/basket.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
}
}
(0, _jquery2.default)('#SPANTITLE').empty().append(basketIcon + data.title);
(0, _jquery2.default)('#PREVIEWTITLE_COLLLOGO').empty().append(data.collection_logo);
(0, _jquery2.default)('#PREVIEWTITLE_COLLNAME').empty().append(data.databox_name + ' / ' + data.collection_name);

View File

@@ -65498,7 +65498,18 @@ var previewRecordService = function previewRecordService(services) {
(0, _jquery2.default)('#PREVIEWBOX img.record.zoomable').draggable();
}
(0, _jquery2.default)('#SPANTITLE').empty().append(data.title);
var basketIcon = '';
if (data.containerType !== null) {
if (data.containerType === 'feedback') {
basketIcon = "<img src='/assets/common/images/icons/basket_validation.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
} else if (data.containerType === 'push') {
basketIcon = "<img src='/assets/common/images/icons/basket_push.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
} else {
basketIcon = "<img src='/assets/common/images/icons/basket.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
}
}
(0, _jquery2.default)('#SPANTITLE').empty().append(basketIcon + data.title);
(0, _jquery2.default)('#PREVIEWTITLE_COLLLOGO').empty().append(data.collection_logo);
(0, _jquery2.default)('#PREVIEWTITLE_COLLNAME').empty().append(data.databox_name + ' / ' + data.collection_name);

View File

@@ -381,7 +381,18 @@ const previewRecordService = services => {
$('#PREVIEWBOX img.record.zoomable').draggable();
}
$('#SPANTITLE').empty().append(data.title);
let basketIcon = '';
if (data.containerType !== null ) {
if (data.containerType === 'feedback') {
basketIcon = "<img src='/assets/common/images/icons/basket_validation.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
} else if (data.containerType === 'push') {
basketIcon = "<img src='/assets/common/images/icons/basket_push.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
} else {
basketIcon = "<img src='/assets/common/images/icons/basket.png' title='' width='24' class='btn-image' style='width:24px;height: 24px;'/>";
}
}
$('#SPANTITLE').empty().append(basketIcon + data.title);
$('#PREVIEWTITLE_COLLLOGO')
.empty()
.append(data.collection_logo);

View File

@@ -103,6 +103,18 @@ class RecordController extends Controller
$recordTitle = htmlspecialchars($record->get_title());
}
$containerType = null;
if ($env === 'BASK') {
if ($record->get_container()->getValidation()) {
$containerType = 'feedback';
} elseif ($record->get_container()->getPusher()) {
$containerType = 'push';
} else {
$containerType = 'basket';
}
}
return $this->app->json([
"desc" => $this->render('prod/preview/caption.html.twig', [
'record' => $record,
@@ -131,6 +143,7 @@ class RecordController extends Controller
]),
"pos" => $record->getNumber(),
"title" => $recordTitle,
"containerType" => $containerType,
"databox_name" => $record->getDatabox()->get_dbname(),
"collection_name" => $record->getCollection()->get_name(),
"collection_logo" => $record->getCollection()->getLogo($record->getBaseId(), $this->app),

View File

@@ -270,8 +270,7 @@ class record_preview extends record_adapter
$this->title .= parent::get_title($options);
break;
case "BASK":
$this->title .= $this->name . ' - ' . parent::get_title($options)
. ' (' . $this->getNumber() . '/' . $this->total . ') ';
$this->title .= $this->name . ' (' . $this->getNumber() . '/' . $this->total . ') - ' . parent::get_title($options);
break;
case "REG":
$title = parent::get_title($options);