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

Minor fixes

This commit is contained in:
Hillel Coren 2016-06-05 21:05:11 +03:00
parent 5c7a15ff83
commit 706c26b4d5
5 changed files with 34 additions and 19 deletions

View File

@ -230,7 +230,7 @@ class AccountController extends BaseController
Session::flash('message', trans('texts.updated_plan'));
}
if (!empty($new_plan)) {
if (!empty($new_plan) && $new_plan['plan'] != PLAN_FREE) {
$invitation = $this->accountRepo->enablePlan($new_plan['plan'], $new_plan['term'], $credit, !empty($pending_monthly));
return Redirect::to('view/'.$invitation->invitation_key);
}
@ -1333,12 +1333,14 @@ class AccountController extends BaseController
}
$account = Auth::user()->account;
$invitation = $invoice->invitations->first();
// replace the variables with sample data
$data = [
'account' => $account,
'invoice' => $invoice,
'invitation' => $invoice->invitations->first(),
'invitation' => $invitation,
'link' => $invitation->getLink(),
'client' => $invoice->client,
'amount' => $invoice->amount
];

View File

@ -40,6 +40,13 @@ class AccountGatewayController extends BaseController
return $this->accountGatewayService->getDatatable(Auth::user()->account_id);
}
public function show($publicId)
{
Session::reflash();
return Redirect::to("gateways/$publicId/edit");
}
public function edit($publicId)
{
$accountGateway = AccountGateway::scope($publicId)->firstOrFail();

View File

@ -328,7 +328,9 @@ Route::get('/forgot', function() {
Route::get('/feed', function() {
return Redirect::to(NINJA_WEB_URL.'/feed', 301);
});
Route::get('/comments/feed', function() {
return Redirect::to(NINJA_WEB_URL.'/comments/feed', 301);
});
if (!defined('CONTACT_EMAIL')) {
define('CONTACT_EMAIL', Config::get('mail.from.address'));

View File

@ -1,6 +1,6 @@
@extends('header')
@section('content')
@section('content')
@parent
@include('accounts.nav', ['selected' => ACCOUNT_MANAGEMENT])
@ -134,10 +134,10 @@
<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'])
<button type="button" class="btn btn-primary" onclick="confirmChangePlan()">{{ trans('texts.plan_change') }}</button>
<button type="button" class="btn btn-primary" onclick="confirmChangePlan()">{{ trans('texts.plan_change') }}</button>
@else
<button type="button" class="btn btn-success" onclick="confirmChangePlan()">{{ trans('texts.plan_upgrade') }}</button>
@endif
<button type="button" class="btn btn-success" onclick="confirmChangePlan()">{{ trans('texts.plan_upgrade') }}</button>
@endif
</div>
</div>
</div>
@ -165,12 +165,12 @@
<div style="background-color: #fff; padding-left: 16px; padding-right: 16px">
&nbsp;<p>{{ trans('texts.cancel_account_message') }}</p>&nbsp;
&nbsp;<p>{!! Former::textarea('reason')->placeholder(trans('texts.reason_for_canceling'))->raw() !!}</p>&nbsp;
&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>
<button type="button" class="btn btn-danger" onclick="confirmCancel()">{{ trans('texts.cancel_account') }}</button>
<button type="button" class="btn btn-danger" onclick="confirmCancel()">{{ trans('texts.cancel_account') }}</button>
</div>
</div>
@ -182,7 +182,7 @@
<script type="text/javascript">
function showChangePlan() {
$('#changePlanModel').modal('show');
$('#changePlanModel').modal('show');
}
function confirmChangePlan() {
@ -190,13 +190,13 @@
}
function showConfirm() {
$('#confirmCancelModal').modal('show');
$('#confirmCancelModal').modal('show');
}
function confirmCancel() {
$('form.cancel-account').submit();
}
}
@if ($account->company->pending_plan)
function cancelPendingChange(){
$('#plan').val('{{ $planDetails['plan'] }}')
@ -205,12 +205,12 @@
return false;
}
@endif
jQuery(document).ready(function($){
function updatePlanModal() {
var plan = $('#plan').val();
$('#plan_term').closest('.form-group').toggle(plan!='free');
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])) !!});
@ -221,11 +221,15 @@
}
$('#plan_term, #plan').change(updatePlanModal);
updatePlanModal();
if(window.location.hash) {
var hash = window.location.hash;
$(hash).modal('toggle');
}
});
@if (Request::input('upgrade'))
showChangePlan();
@endif
});
</script>
@stop
@stop

View File

@ -423,7 +423,7 @@
@if (!Auth::user()->registered)
{!! Button::success(trans('texts.sign_up'))->withAttributes(array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal', 'style' => 'max-width:100px;;overflow:hidden'))->small() !!} &nbsp;
@elseif (Utils::isNinjaProd() && (!Auth::user()->isPro() || Auth::user()->isTrial()))
{!! Button::success(trans('texts.go_pro'))->withAttributes(array('id' => 'proPlanButton', 'onclick' => 'showProPlan("")', 'style' => 'max-width:100px;overflow:hidden'))->small() !!} &nbsp;
{!! Button::success(trans('texts.plan_upgrade'))->asLinkTo(url('/settings/account_management?upgrade=true'))->withAttributes(array('style' => 'max-width:100px;overflow:hidden'))->small() !!} &nbsp;
@endif
@endif