Remove auto-link from from manufacturer warranty

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-04-26 18:16:23 -07:00
parent 73d45bb587
commit deff312381
2 changed files with 7 additions and 3 deletions

View file

@ -56,7 +56,7 @@ class ManufacturerPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('admin/manufacturers/table.support_url'), 'title' => trans('admin/manufacturers/table.support_url'),
'visible' => true, 'visible' => true,
'formatter' => 'linkFormatter', 'formatter' => 'externalLinkFormatter',
], ],
[ [
@ -85,7 +85,7 @@ class ManufacturerPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('admin/manufacturers/table.warranty_lookup_url'), 'title' => trans('admin/manufacturers/table.warranty_lookup_url'),
'visible' => false, 'visible' => false,
'formatter' => 'linkFormatter', 'formatter' => 'externalLinkFormatter',
], ],
[ [

View file

@ -511,8 +511,12 @@
} }
function externalLinkFormatter(value) { function externalLinkFormatter(value) {
if (value) { if (value) {
return '<a href="' + value + '" target="_blank">' + value + '</a>'; if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) {
return '<a href="' + value + '" target="_blank">' + value + ' <i class="fa fa-external-link"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i></a>';
}
return value;
} }
} }