From 51cd82cba8e01a03d0a4af7674f1654b96c9b3b1 Mon Sep 17 00:00:00 2001 From: Joshua Dwire Date: Sat, 16 Apr 2016 10:58:53 -0400 Subject: [PATCH] Move cancel account to new account management page --- app/Http/Controllers/AccountController.php | 12 ++++ app/Http/routes.php | 1 + app/Models/Account.php | 1 + resources/lang/en/texts.php | 11 ++- .../views/accounts/import_export.blade.php | 44 ------------ resources/views/accounts/management.blade.php | 70 +++++++++++++++++++ 6 files changed, 93 insertions(+), 46 deletions(-) create mode 100644 resources/views/accounts/management.blade.php diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 3b9efbf8aeb1..b22de1887169 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -148,6 +148,8 @@ class AccountController extends BaseController return self::showInvoiceSettings(); } elseif ($section == ACCOUNT_IMPORT_EXPORT) { return View::make('accounts.import_export', ['title' => trans('texts.import_export')]); + } elseif ($section == ACCOUNT_MANAGEMENT) { + return self::showAccountManagement(); } elseif ($section == ACCOUNT_INVOICE_DESIGN || $section == ACCOUNT_CUSTOMIZE_DESIGN) { return self::showInvoiceDesign($section); } elseif ($section == ACCOUNT_CLIENT_PORTAL) { @@ -231,6 +233,16 @@ class AccountController extends BaseController return View::make('accounts.details', $data); } + private function showAccountManagement() + { + $data = [ + 'account' => Auth::user()->account, + 'title' => trans('texts.acount_management'), + ]; + + return View::make('accounts.management', $data); + } + public function showUserDetails() { $oauthLoginUrls = []; diff --git a/app/Http/routes.php b/app/Http/routes.php index a0260e4b6b4e..7c3f9c8739f9 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -354,6 +354,7 @@ if (!defined('CONTACT_EMAIL')) { define('ACCOUNT_LOCALIZATION', 'localization'); define('ACCOUNT_NOTIFICATIONS', 'notifications'); define('ACCOUNT_IMPORT_EXPORT', 'import_export'); + define('ACCOUNT_MANAGEMENT', 'account_management'); define('ACCOUNT_PAYMENTS', 'online_payments'); define('ACCOUNT_BANKS', 'bank_accounts'); define('ACCOUNT_IMPORT_EXPENSES', 'import_expenses'); diff --git a/app/Models/Account.php b/app/Models/Account.php index 5fe2cccf7d7f..92813865f2e1 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -57,6 +57,7 @@ class Account extends Eloquent ACCOUNT_PRODUCTS, ACCOUNT_NOTIFICATIONS, ACCOUNT_IMPORT_EXPORT, + ACCOUNT_MANAGEMENT, ]; public static $advancedSettings = [ diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 799cf6cbaab2..20c1ef7dae0a 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -81,7 +81,7 @@ $LANG = array( 'company_details' => 'Company Details', 'online_payments' => 'Online Payments', 'notifications' => 'Email Notifications', - 'import_export' => 'Import | Export | Cancel', + 'import_export' => 'Import | Export', 'done' => 'Done', 'save' => 'Save', 'create' => 'Create', @@ -368,7 +368,7 @@ $LANG = array( 'confirm_email_invoice' => 'Are you sure you want to email this invoice?', 'confirm_email_quote' => 'Are you sure you want to email this quote?', 'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?', - 'cancel_account' => 'Cancel Account', + 'cancel_account' => 'Delete Account', 'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.', 'go_back' => 'Go Back', 'data_visualizations' => 'Data Visualizations', @@ -1126,6 +1126,13 @@ $LANG = array( 'enable_client_portal_help' => 'Show/hide the client portal.', 'enable_client_portal_dashboard' => 'Dashboard', 'enable_client_portal_dashboard_help' => 'Show/hide the dashboard page in the client portal.', + + 'account_management' => 'Account Management', + 'plan_status' => 'Plan Status', + + 'plan_free' => 'Free', + 'plan_pro' => 'Pro', + 'plan_enterprise' => 'Enterprise' ); diff --git a/resources/views/accounts/import_export.blade.php b/resources/views/accounts/import_export.blade.php index c6f4d451e317..d2f482e0515b 100644 --- a/resources/views/accounts/import_export.blade.php +++ b/resources/views/accounts/import_export.blade.php @@ -73,51 +73,7 @@ {!! Former::close() !!} -{!! Former::open('settings/cancel_account')->addClass('cancel-account') !!} -
-
-

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

-
-
- {!! Former::actions( Button::danger(trans('texts.cancel_account'))->large()->withAttributes(['onclick' => 'showConfirm()'])->appendIcon(Icon::create('trash'))) !!} -
-
- - - -{!! Former::close() !!} - - +@stop \ No newline at end of file