1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/resources/views/accounts/management.blade.php

236 lines
9.1 KiB
PHP
Raw Normal View History

@extends('header')
2016-06-05 20:05:11 +02:00
@section('content')
@parent
@include('accounts.nav', ['selected' => ACCOUNT_MANAGEMENT])
<div class="row">
<div class="col-md-12">
2016-04-17 00:34:39 +02:00
{!! Former::open('settings/change_plan')->addClass('change-plan') !!}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{!! trans('texts.plan_status') !!}</h3>
</div>
<div class="panel-body">
2016-04-17 00:34:39 +02:00
<div class="form-group">
<label class="col-sm-4 control-label">{{ trans('texts.plan') }}</label>
<div class="col-sm-8">
<p class="form-control-static">
@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
@elseif(Utils::isNinjaProd())
2016-04-17 00:34:39 +02:00
{{ trans('texts.plan_free') }}
@else
{{ trans('texts.plan_free_self_hosted') }}
2016-04-17 00:34:39 +02:00
@endif
</p>
</div>
</div>
@if ($planDetails && $planDetails['active'])
<div class="form-group">
<label class="col-sm-4 control-label">
@if((!$account->company->pending_plan || $account->company->pending_plan == $planDetails['plan']) && $planDetails['expires'] && !$planDetails['trial'])
2016-04-17 04:28:11 +02:00
{{ trans('texts.renews') }}
2016-04-17 00:34:39 +02:00
@else
2016-04-17 04:28:11 +02:00
{{ trans('texts.expires') }}
2016-04-17 00:34:39 +02:00
@endif
</label>
<div class="col-sm-8">
<p class="form-control-static">
@if ($planDetails['expires'] === false)
{{ trans('texts.never') }}
@else
{{ Utils::dateToString($planDetails['expires']) }}
@endif
</p>
</div>
</div>
@if ($account->company->pending_plan)
<div class="form-group">
2016-04-17 00:34:39 +02:00
<label class="col-sm-4 control-label">{{ trans('texts.pending_change_to') }}</label>
<div class="col-sm-8">
<p class="form-control-static">
@if ($account->company->pending_plan == PLAN_FREE)
2016-04-17 04:28:11 +02:00
{{ trans('texts.plan_changes_to', [
'plan'=>trans('texts.plan_free'),
'date'=>Utils::dateToString($planDetails['expires'])
]) }}
2016-04-17 00:34:39 +02:00
@else
2016-04-17 04:28:11 +02:00
{{ trans('texts.plan_term_changes_to', [
'plan'=>trans('texts.plan_'.$account->company->pending_plan),
'term'=>trans('texts.plan_term_'.$account->company->pending_term.'ly'),
'date'=>Utils::dateToString($planDetails['expires'])
]) }}
@endif<br>
<a href="#" onclick="cancelPendingChange()">{{ trans('texts.cancel_plan_change') }}</a>
2016-04-17 00:34:39 +02:00
</p>
</div>
</div>
2016-04-17 00:34:39 +02:00
@endif
@if (Utils::isNinjaProd())
{!! Former::actions( Button::info(trans('texts.plan_change'))->large()->withAttributes(['onclick' => 'showChangePlan()'])->appendIcon(Icon::create('edit'))) !!}
@endif
2016-04-17 00:34:39 +02:00
@else
2016-04-17 04:28:11 +02:00
@if ($planDetails)
<div class="form-group">
<label class="col-sm-4 control-label">
@if ($planDetails['trial'])
{{ trans('texts.trial_expired', ['plan'=>trans('texts.plan_'.$planDetails['plan'])]) }}
@else
{{ trans('texts.plan_expired', ['plan'=>trans('texts.plan_'.$planDetails['plan'])]) }}
@endif
</label>
<div class="col-sm-8">
<p class="form-control-static">
{{ Utils::dateToString($planDetails['expires']) }}
</p>
</div>
</div>
@endif
@if (Utils::isNinjaProd())
2016-05-05 08:52:59 +02:00
{!! 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
2016-04-17 00:34:39 +02:00
@endif
</div>
2016-04-17 00:34:39 +02:00
</div>
@if (Utils::isNinjaProd())
2016-04-17 00:34:39 +02:00
<div class="modal fade" id="changePlanModel" tabindex="-1" role="dialog" aria-labelledby="changePlanModelLabel" aria-hidden="true">
<div class="modal-dialog" style="min-width:150px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="changePlanModelLabel">
@if ($planDetails && $planDetails['active'])
{!! trans('texts.plan_change') !!}
@else
{!! trans('texts.plan_upgrade') !!}
@endif
</h4>
</div>
<div class="modal-body">
@if ($planDetails && $planDetails['active'])
{!! Former::select('plan')
->addOption(trans('texts.plan_enterprise'), PLAN_ENTERPRISE)
->addOption(trans('texts.plan_pro'), PLAN_PRO)
->addOption(trans('texts.plan_free'), PLAN_FREE)!!}
@else
{!! Former::select('plan')
->addOption(trans('texts.plan_enterprise'), PLAN_ENTERPRISE)
->addOption(trans('texts.plan_pro'), PLAN_PRO)!!}
@endif
{!! Former::select('plan_term')
->addOption(trans('texts.plan_term_yearly'), PLAN_TERM_YEARLY)
2016-05-10 20:17:46 +02:00
->addOption(trans('texts.plan_term_monthly'), PLAN_TERM_MONTHLY)
2016-06-05 21:55:23 +02:00
->inlineHelp(trans('texts.enterprise_plan_features', ['link' => link_to(NINJA_WEB_URL . '/plans-pricing', trans('texts.click_here'), ['target' => '_blank'])])) !!}
2016-04-17 00:34:39 +02:00
</div>
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.go_back') }}</button>
@if ($planDetails && $planDetails['active'])
2016-06-28 20:22:16 +02:00
<button type="button" class="btn btn-primary" id="changePlanButton" onclick="confirmChangePlan()">{{ trans('texts.plan_change') }}</button>
2016-04-17 00:34:39 +02:00
@else
2016-06-28 20:22:16 +02:00
<button type="button" class="btn btn-success" id="changePlanButton" onclick="confirmChangePlan()">{{ trans('texts.plan_upgrade') }}</button>
2016-06-05 20:05:11 +02:00
@endif
2016-04-17 00:34:39 +02:00
</div>
</div>
</div>
</div>
@endif
{!! Former::close() !!}
{!! Former::open('settings/cancel_account')->addClass('cancel-account') !!}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{!! trans('texts.cancel_account') !!}</h3>
</div>
<div class="panel-body">
{!! Former::actions( Button::danger(trans('texts.cancel_account'))->large()->withAttributes(['onclick' => 'showConfirm()'])->appendIcon(Icon::create('trash'))) !!}
</div>
</div>
<div class="modal fade" id="confirmCancelModal" tabindex="-1" role="dialog" aria-labelledby="confirmCancelModalLabel" aria-hidden="true">
<div class="modal-dialog" style="min-width:150px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="confirmCancelModalLabel">{!! trans('texts.cancel_account') !!}</h4>
</div>
<div style="background-color: #fff; padding-left: 16px; padding-right: 16px">
&nbsp;<p>{{ trans('texts.cancel_account_message') }}</p>&nbsp;
2016-06-05 20:05:11 +02:00
&nbsp;<p>{!! Former::textarea('reason')->placeholder(trans('texts.reason_for_canceling'))->raw() !!}</p>&nbsp;
</div>
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.go_back') }}</button>
2016-06-05 20:05:11 +02:00
<button type="button" class="btn btn-danger" onclick="confirmCancel()">{{ trans('texts.cancel_account') }}</button>
</div>
</div>
</div>
</div>
2016-04-17 00:34:39 +02:00
{!! Former::close() !!}
</div>
</div>
<script type="text/javascript">
2016-04-17 00:34:39 +02:00
function showChangePlan() {
2016-06-05 20:05:11 +02:00
$('#changePlanModel').modal('show');
2016-04-17 00:34:39 +02:00
}
function confirmChangePlan() {
$('form.change-plan').submit();
}
function showConfirm() {
2016-06-05 20:05:11 +02:00
$('#confirmCancelModal').modal('show');
2016-04-17 00:34:39 +02:00
}
2016-04-17 00:34:39 +02:00
function confirmCancel() {
$('form.cancel-account').submit();
2016-06-05 20:05:11 +02:00
}
2016-04-17 00:34:39 +02:00
@if ($account->company->pending_plan)
function cancelPendingChange(){
$('#plan').val('{{ $planDetails['plan'] }}')
$('#plan_term').val('{{ $planDetails['term'] }}')
confirmChangePlan();
return false;
}
@endif
2016-06-05 20:05:11 +02:00
2016-04-17 00:34:39 +02:00
jQuery(document).ready(function($){
function updatePlanModal() {
var plan = $('#plan').val();
$('#plan_term').closest('.form-group').toggle(plan!='free');
2016-06-05 20:05:11 +02:00
2016-04-17 00:34:39 +02:00
if(plan=='{{PLAN_PRO}}'){
$('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_PRO_MONTHLY])) !!});
$('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_PRO_YEARLY])) !!});
} else if(plan=='{{PLAN_ENTERPRISE}}') {
$('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY])) !!});
$('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_ENTERPRISE_YEARLY])) !!});
}
}
$('#plan_term, #plan').change(updatePlanModal);
updatePlanModal();
2016-06-05 20:05:11 +02:00
if(window.location.hash) {
var hash = window.location.hash;
$(hash).modal('toggle');
}
2016-06-05 20:05:11 +02:00
@if (Request::input('upgrade'))
showChangePlan();
@endif
});
</script>
2016-06-05 20:05:11 +02:00
@stop