Fix client link on portal dashboard

This commit is contained in:
Hillel Coren 2017-08-13 16:03:00 +03:00
parent 4f76a96048
commit d34531d178
2 changed files with 16 additions and 1 deletions

View File

@ -2,6 +2,8 @@
namespace App\Ninja\Presenters; namespace App\Ninja\Presenters;
use Utils;
class ClientPresenter extends EntityPresenter class ClientPresenter extends EntityPresenter
{ {
public function country() public function country()
@ -17,6 +19,19 @@ class ClientPresenter extends EntityPresenter
return $account->formatMoney($client->balance, $client); return $account->formatMoney($client->balance, $client);
} }
public function websiteLink()
{
$client = $this->entity;
if (! $client->website) {
return '';
}
$link = Utils::addHttp($client->website);
return link_to($link, $client->website, ['target' => '_blank']);
}
public function paid_to_date() public function paid_to_date()
{ {
$client = $this->entity; $client = $this->entity;

View File

@ -300,7 +300,7 @@
{!! HTML::mailto($contact->email, $contact->email) !!}<br> {!! HTML::mailto($contact->email, $contact->email) !!}<br>
@endif @endif
@if ($client->website) @if ($client->website)
{!! HTML::link($client->website, $client->website) !!}<br> {{ $client->present()->websiteLink }}<br>
@endif @endif
@if ($contact->phone) @if ($contact->phone)
{{ $contact->phone }}<br> {{ $contact->phone }}<br>