1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Working on white label renewal

This commit is contained in:
Hillel Coren 2016-12-27 13:44:15 +02:00
parent e9f05c7006
commit 4bcdc155c0
4 changed files with 21 additions and 1 deletions

View File

@ -74,6 +74,20 @@ class Company extends Eloquent
return $price - ($price * $this->discount);
}
public function daysUntilPlanExpires()
{
if ( ! $this->hasActivePlan()) {
return 0;
}
return Carbon::parse($this->plan_expires)->diffInDays(Carbon::today());
}
public function hasActivePlan()
{
return Carbon::parse($this->plan_expires) >= Carbon::today();
}
public function hasEarnedPromo()
{
if ( ! Utils::isNinjaProd() || Utils::isPro()) {

View File

@ -2284,6 +2284,7 @@ $LANG = array(
'debug' => 'Debug',
'https' => 'HTTPS',
'require' => 'Require',
'license_expiring' => 'Note: Your license will expire in :count days, :link to renew it.'
);

View File

@ -589,7 +589,7 @@
]) !!}
@endif
@else
@include('partials.white_label')
@include('partials.white_label', ['company' => Auth::user()->account->company])
@endif
</div>
</div>

View File

@ -1,9 +1,14 @@
{{ trans('texts.powered_by') }}
{{-- Per our license, please do not remove or modify this section. --}}
{!! link_to('https://www.invoiceninja.com/?utm_source=powered_by', 'InvoiceNinja.com', ['target' => '_blank', 'title' => trans('texts.created_by', ['name' => 'Hillel Coren'])]) !!} -
{!! link_to(RELEASES_URL, 'v' . NINJA_VERSION, ['target' => '_blank', 'title' => trans('texts.trello_roadmap')]) !!} |
@if (Auth::user()->account->hasFeature(FEATURE_WHITE_LABEL))
{{ trans('texts.white_labeled') }}
@if ($company->hasActivePlan() && $company->daysUntilPlanExpires() <= 10)
- <b>{{ trans('texts.license_expiring', ['count' => $company->daysUntilPlanExpires(), 'link' => 'link']) }}</b>
@endif
@else
<a href="#" onclick="showWhiteLabelModal()">{{ trans('texts.white_label_link') }}</a>