mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 15:44:11 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
1384ca658a
|
@ -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',
|
||||||
],
|
],
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue