diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 028ed5b6323e..59ac0f23f28c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2291,6 +2291,7 @@ $LANG = array( 'iphone_app_message' => 'Consider downloading our :link', 'iphone_app' => 'iPhone app', 'logged_in' => 'Logged In', + 'switch_to_primary' => 'Switch to your primary company (:name) to manage your plan.' ); diff --git a/resources/views/accounts/management.blade.php b/resources/views/accounts/management.blade.php index 11735abf39ac..ff1a21ed0643 100644 --- a/resources/views/accounts/management.blade.php +++ b/resources/views/accounts/management.blade.php @@ -13,73 +13,79 @@

{!! trans('texts.plan_status') !!}

-
- -
-

- @if ($planDetails && $planDetails['active']) - {{ trans('texts.plan_'.$planDetails['plan']) }} - @if ($planDetails['trial']) - ({{ trans('texts.plan_trial') }}) - @elseif ($planDetails['expires']) - ({{ trans('texts.plan_term_'.$planDetails['term'].'ly') }}) - @endif - @if ($planDetails['plan'] == PLAN_ENTERPRISE) - {{ trans('texts.min_to_max_users', ['min' => Utils::getMinNumUsers($planDetails['num_users']), 'max' => $planDetails['num_users']])}} - @endif - @elseif(Utils::isNinjaProd()) - {{ trans('texts.plan_free') }} - @else - {{ trans('texts.plan_free_self_hosted') }} - @endif -

-
-
- @if ($planDetails && $planDetails['active']) + @if (Auth::user()->primaryAccount()->id != Auth::user()->account->id) +
+ {{ trans('texts.switch_to_primary', ['name' => Auth::user()->primaryAccount()->getDisplayName()]) }} +
+ @else
- +

- @if ($planDetails['expires'] === false) - {{ trans('texts.never') }} + @if ($planDetails && $planDetails['active']) + {{ trans('texts.plan_'.$planDetails['plan']) }} + @if ($planDetails['trial']) + ({{ trans('texts.plan_trial') }}) + @elseif ($planDetails['expires']) + ({{ trans('texts.plan_term_'.$planDetails['term'].'ly') }}) + @endif + @if ($planDetails['plan'] == PLAN_ENTERPRISE) + {{ trans('texts.min_to_max_users', ['min' => Utils::getMinNumUsers($planDetails['num_users']), 'max' => $planDetails['num_users']])}} + @endif + @elseif(Utils::isNinjaProd()) + {{ trans('texts.plan_free') }} @else - {{ Utils::dateToString($planDetails['expires']) }} + {{ trans('texts.plan_free_self_hosted') }} @endif

- - @if ($account->company->hasActiveDiscount()) - {!! Former::plaintext('discount') - ->value($account->company->present()->discountMessage) !!} - @endif - - @if (Utils::isNinjaProd()) - {!! Former::actions( Button::info(trans('texts.plan_change'))->large()->withAttributes(['onclick' => 'showChangePlan()'])->appendIcon(Icon::create('edit'))) !!} - @endif - @else - @if ($planDetails) + @if ($planDetails && $planDetails['active'])

- {{ Utils::dateToString($planDetails['expires']) }} + @if ($planDetails['expires'] === false) + {{ trans('texts.never') }} + @else + {{ Utils::dateToString($planDetails['expires']) }} + @endif

- @endif - @if (Utils::isNinjaProd()) - {!! Former::actions( Button::success(trans('texts.plan_upgrade'))->large()->withAttributes(['onclick' => 'showChangePlan()'])->appendIcon(Icon::create('plus-sign'))) !!} - @elseif (!$account->hasFeature(FEATURE_WHITE_LABEL)) - {!! Former::actions( Button::success(trans('texts.white_label_button'))->large()->withAttributes(['onclick' => 'loadImages("#whiteLabelModal");$("#whiteLabelModal").modal("show");'])->appendIcon(Icon::create('plus-sign'))) !!} + + @if ($account->company->hasActiveDiscount()) + {!! Former::plaintext('discount') + ->value($account->company->present()->discountMessage) !!} + @endif + + @if (Utils::isNinjaProd()) + {!! Former::actions( Button::info(trans('texts.plan_change'))->large()->withAttributes(['onclick' => 'showChangePlan()'])->appendIcon(Icon::create('edit'))) !!} + @endif + @else + @if ($planDetails) +
+ +
+

+ {{ Utils::dateToString($planDetails['expires']) }} +

+
+
+ @endif + @if (Utils::isNinjaProd()) + {!! Former::actions( Button::success(trans('texts.plan_upgrade'))->large()->withAttributes(['onclick' => 'showChangePlan()'])->appendIcon(Icon::create('plus-sign'))) !!} + @elseif (!$account->hasFeature(FEATURE_WHITE_LABEL)) + {!! Former::actions( Button::success(trans('texts.white_label_button'))->large()->withAttributes(['onclick' => 'loadImages("#whiteLabelModal");$("#whiteLabelModal").modal("show");'])->appendIcon(Icon::create('plus-sign'))) !!} + @endif @endif @endif