Skip to content

Commit

Permalink
Working on sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Aug 23, 2016
1 parent f021ee1 commit d55cdd7
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 147 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ public function getSearchData()
*/
public function showSection($section = false)
{
if ( ! Auth::user()->is_admin) {
return Redirect::to('/settings/user_details');
}

if (!$section) {
return Redirect::to('/settings/'.ACCOUNT_COMPANY_DETAILS, 301);
}
Expand Down
12 changes: 12 additions & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,16 @@ public function manageCompanies()
return View::make('users.account_management');
}

public function saveSidebarState()
{
if (Input::has('show_left')) {
Session::put(SESSION_LEFT_SIDEBAR, boolval(Input::get('show_left')));
}

if (Input::has('show_right')) {
Session::put(SESSION_RIGHT_SIDEBAR, boolval(Input::get('show_right')));
}

return Session::get(SESSION_LEFT_SIDEBAR) ? 'true' : 'false';
}
}
9 changes: 8 additions & 1 deletion app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
Route::get('force_inline_pdf', 'UserController@forcePDFJS');
Route::get('account/get_search_data', ['as' => 'get_search_data', 'uses' => 'AccountController@getSearchData']);
Route::get('check_invoice_number/{invoice_number}', 'InvoiceController@checkInvoiceNumber');
Route::get('save_sidebar_state', 'UserController@saveSidebarState');

Route::get('settings/user_details', 'AccountController@showUserDetails');
Route::post('settings/user_details', 'AccountController@saveUserDetails');
Expand All @@ -153,6 +154,7 @@
Route::get('invoices/create/{client_id?}', 'InvoiceController@create');
Route::get('recurring_invoices/create/{client_id?}', 'InvoiceController@createRecurring');
Route::get('recurring_invoices', 'RecurringInvoiceController@index');
Route::get('recurring_invoices/{invoices}/edit', 'InvoiceController@edit');
Route::get('invoices/{invoices}/clone', 'InvoiceController@cloneInvoice');
Route::post('invoices/bulk', 'InvoiceController@bulk');
Route::post('recurring_invoices/bulk', 'InvoiceController@bulk');
Expand Down Expand Up @@ -242,7 +244,6 @@
Route::post('settings/change_plan', 'AccountController@changePlan');
Route::post('settings/cancel_account', 'AccountController@cancelAccount');
Route::post('settings/company_details', 'AccountController@updateDetails');
Route::get('settings/{section?}', 'AccountController@showSection');
Route::post('settings/{section?}', 'AccountController@doSection');

Route::post('user/setTheme', 'UserController@setTheme');
Expand Down Expand Up @@ -270,6 +271,10 @@
Route::get('self-update/download', 'SelfUpdateController@download');
});

Route::group(['middleware' => 'auth:user'], function() {
Route::get('settings/{section?}', 'AccountController@showSection');
});

// Route groups for API
Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
{
Expand Down Expand Up @@ -548,6 +553,8 @@
define('SESSION_LOCALE', 'sessionLocale');
define('SESSION_USER_ACCOUNTS', 'userAccounts');
define('SESSION_REFERRAL_CODE', 'referralCode');
define('SESSION_LEFT_SIDEBAR', 'showLeftSidebar');
define('SESSION_RIGHT_SIDEBAR', 'showRightSidebar');

define('SESSION_LAST_REQUEST_PAGE', 'SESSION_LAST_REQUEST_PAGE');
define('SESSION_LAST_REQUEST_TIME', 'SESSION_LAST_REQUEST_TIME');
Expand Down
7 changes: 6 additions & 1 deletion app/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ public static function getImportMap()
*/
public function getRoute()
{
$entityType = $this->getEntityType();
if ($this->is_recurring) {
$entityType = 'recurring_invoice';
} else {
$entityType = $this->getEntityType();
}

return "/{$entityType}s/{$this->public_id}/edit";
}

Expand Down
2 changes: 1 addition & 1 deletion public/css/built.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/built.css.map

Large diffs are not rendered by default.

28 changes: 5 additions & 23 deletions resources/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
.form-padding-right {
padding-right: 40px;
}

.hide-non-phone {
display: none;
}
Expand All @@ -817,29 +818,6 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
}
}

/* Style to fix navigation by show icon instead of name */
@media only screen and (min-width : 1200px) {
.nav-account-icon {
display: none;
}
}
@media only screen and (max-width : 992px) {
.nav-account-icon {
display: none;
}
}
@media only screen and (max-width : 1200px) and (min-width: 992px) {
.nav-account-name {
display: none;
}
}

@media (max-width: 992px) {
.hide-phone {
display: none !important;
}
}

@media (max-width: 767px) {
.test-class{color:black;}

Expand All @@ -857,6 +835,10 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
.plans-table .cell div:first-child {margin-bottom: 5px;}
.plans-table .cell .cta {margin-bottom: 0 !important;}
.plans-table .pro {margin-top: 40px;}

.hide-phone {
display: none;
}
}

label[for=recommendedGateway_id2].radio{
Expand Down

0 comments on commit d55cdd7

Please sign in to comment.