Hide purge/delete buttons on Ninja accounts

This commit is contained in:
Hillel Coren 2017-07-02 20:44:56 +03:00
parent 9a21f754d5
commit 23a19be9e9
2 changed files with 77 additions and 67 deletions

View File

@ -967,6 +967,14 @@ class Account extends Eloquent
return strpos($this->account_key, 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx7') === 0; return strpos($this->account_key, 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx7') === 0;
} }
/**
* @return bool
*/
public function isNinjaOrLicenseAccount()
{
return $this->isNinjaAccount() || $this->account_key == NINJA_LICENSE_ACCOUNT_KEY;
}
/** /**
* @param $plan * @param $plan
*/ */

View File

@ -226,6 +226,7 @@
{!! Former::close() !!} {!! Former::close() !!}
@if (! Auth::user()->account->isNinjaOrLicenseAccount())
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{!! trans('texts.delete_data') !!}</h3> <h3 class="panel-title">{!! trans('texts.delete_data') !!}</h3>
@ -304,6 +305,7 @@
{!! Former::close() !!} {!! Former::close() !!}
</div> </div>
</div> </div>
@endif
</div> </div>
</div> </div>