Skip to content

Commit ed6d020

Browse files
committed
Fixed permission name for locations
1 parent 8eb5600 commit ed6d020

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

app/Presenters/LocationPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public function fullName()
378378

379379
public function formattedNameLink() {
380380

381-
if (auth()->user()->can('location.view', $this)) {
381+
if (auth()->user()->can('locations.view', $this)) {
382382
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('locations.show', e($this->id)).'">'.e($this->name).'</a>';
383383
}
384384

resources/views/account/view-assets.blade.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
{{ trans('admin/users/table.email') }}
325325
</div>
326326
<div class="col-md-9">
327-
<a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
327+
<a href="mailto:{{ $user->email }}"><x-icon type="email" /> {{ $user->email }}</a>
328328
</div>
329329
</div>
330330
@endif
@@ -336,7 +336,7 @@
336336
{{ trans('general.website') }}
337337
</div>
338338
<div class="col-md-9">
339-
<a href="{{ $user->website }}" target="_blank">{{ $user->website }}</a>
339+
<a href="{{ $user->website }}" target="_blank"><x-icon type="external-link" /> {{ $user->website }}</a>
340340
</div>
341341
</div>
342342
@endif
@@ -348,7 +348,7 @@
348348
{{ trans('admin/users/table.phone') }}
349349
</div>
350350
<div class="col-md-9">
351-
<a href="tel:{{ $user->phone }}">{{ $user->phone }}</a>
351+
<a href="tel:{{ $user->phone }}"><x-icon type="phone" /> {{ $user->phone }}</a>
352352
</div>
353353
</div>
354354
@endif
@@ -360,7 +360,7 @@
360360
{{ trans('admin/users/table.location') }}
361361
</div>
362362
<div class="col-md-9">
363-
{{ link_to_route('locations.show', $user->userloc->name, [$user->userloc->id]) }}
363+
{!! $user->userloc->present()->formattedNameLink !!}
364364
</div>
365365
</div>
366366
@endif
@@ -528,10 +528,11 @@ class="table table-striped snipe-table"
528528
{{ $asset->serial }}
529529
</td>
530530
<td>
531-
{{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }}
531+
{!! ($asset->defaultLoc) ? $asset->defaultLoc->present()->formattedNameLink : '' !!}
532+
532533
</td>
533534
<td>
534-
{!! ($asset->defaultLoc) ? $asset->defaultLoc->present()->formattedNameLink : trans('general.deleted') !!}
535+
{!! ($asset->location) ? $asset->location->present()->formattedNameLink : '' !!}
535536
</td>
536537
<td>
537538
{{ ($asset->expected_checkin) ? $asset->expected_checkin_formatted_date : '' }}

0 commit comments

Comments
 (0)