Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-04-26 18:42:58 -07:00
commit 1384ca658a
3 changed files with 9 additions and 5 deletions

View file

@ -47,7 +47,7 @@ class ManufacturerPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('admin/manufacturers/table.url'), 'title' => trans('admin/manufacturers/table.url'),
'visible' => true, 'visible' => true,
'formatter' => 'linkFormatter', 'formatter' => 'externalLinkFormatter',
], ],
[ [
'field' => 'support_url', 'field' => 'support_url',
@ -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

@ -597,7 +597,7 @@
@if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!='')) @if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!=''))
<a href="{{ $asset->present()->dynamicWarrantyUrl() }}" target="_blank"> <a href="{{ $asset->present()->dynamicWarrantyUrl() }}" target="_blank">
<i class="fa fa-external-link"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i> <i class="fa fa-external-link"><span class="sr-only">{{ trans('admin/hardware/general.mfg_warranty_lookup', ['manufacturer' => $asset->model->manufacturer->name]) }}</span></i>
</a> </a>
@endif @endif
</div> </div>

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 '<i class="fa fa-external-link"></i> <a href="' + value + '" target="_blank">' + value + '</a>';
}
return value;
} }
} }