From 616df18b067a9d05492aeed54239eb585287fe76 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 7 Dec 2013 20:45:00 +0200 Subject: [PATCH] Cleaning up the templates --- app/config/packages/zizaco/confide/config.php | 4 +- app/controllers/AccountController.php | 33 +++--- app/controllers/ClientController.php | 26 ++--- app/controllers/CreditController.php | 2 +- app/controllers/HomeController.php | 2 +- app/controllers/InvoiceController.php | 105 ++++++++++++----- app/controllers/PaymentController.php | 2 +- app/controllers/UserController.php | 20 ++-- ...11_05_180133_confide_setup_users_table.php | 1 + app/models/Activity.php | 10 +- app/models/Client.php | 5 + app/models/Payment.php | 5 + app/models/User.php | 5 + app/routes.php | 39 ++++--- app/views/accounts/details.blade.php | 4 +- app/views/accounts/nav.blade.php | 2 +- app/views/clients/show.blade.php | 2 +- app/views/header.blade.php | 72 ++++-------- app/views/invoices/edit.blade.php | 75 ++++++++---- app/views/invoices/view.blade.php | 2 +- app/views/login.blade.php | 36 +----- app/views/master.blade.php | 105 ++--------------- app/views/payments/edit.blade.php | 1 - app/views/splash.blade.php | 95 +++++++++++++++ app/views/users/forgot_password.blade.php | 0 app/views/users/login.blade.php | 108 ++++++++++++++++++ ...e.min-6140190bf67c53b87b24ba70ca9fc9ee.css | 9 ++ ...p.min-6140190bf67c53b87b24ba70ca9fc9ee.css | 9 ++ ...ap.min-6140190bf67c53b87b24ba70ca9fc9ee.js | 9 ++ public/js/script.js | 38 ++++-- 30 files changed, 519 insertions(+), 307 deletions(-) create mode 100755 app/views/splash.blade.php create mode 100755 app/views/users/forgot_password.blade.php create mode 100755 app/views/users/login.blade.php create mode 100755 public/builds/bootstrapper/packages/patricktalmadge/bootstrapper/css/bootstrap-theme.min-6140190bf67c53b87b24ba70ca9fc9ee.css create mode 100755 public/builds/bootstrapper/packages/patricktalmadge/bootstrapper/css/bootstrap.min-6140190bf67c53b87b24ba70ca9fc9ee.css create mode 100755 public/builds/bootstrapper/packages/patricktalmadge/bootstrapper/js/bootstrap.min-6140190bf67c53b87b24ba70ca9fc9ee.js diff --git a/app/config/packages/zizaco/confide/config.php b/app/config/packages/zizaco/confide/config.php index 0011bb3b2daf..fc965a952af9 100755 --- a/app/config/packages/zizaco/confide/config.php +++ b/app/config/packages/zizaco/confide/config.php @@ -47,9 +47,9 @@ return array( | | */ - 'login_form' => 'login', + 'login_form' => 'users.login', 'signup_form' => 'confide::signup', - 'forgot_password_form' => 'confide::forgot_password', + 'forgot_password_form' => 'users.forgot_password', 'reset_password_form' => 'confide::reset_password', /* diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index dba88740e7b0..b5be1a7548da 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -31,6 +31,8 @@ class AccountController extends \BaseController { $user = new User; $user->password = $random; $account->users()->save($user); + + Session::forget(RECENTLY_VIEWED); } Auth::login($user, true); @@ -188,6 +190,7 @@ class AccountController extends \BaseController { foreach ($row as $index => $value) { $field = $map[$index]; + $value = trim($value); if ($field == Client::$fieldName) { @@ -387,7 +390,7 @@ class AccountController extends \BaseController { $config = new stdClass; foreach ($fields as $field => $details) { - $config->$field = Input::get($gateway->id.'_'.$field); + $config->$field = trim(Input::get($gateway->id.'_'.$field)); } $accountGateway->config = json_encode($config); @@ -417,21 +420,21 @@ class AccountController extends \BaseController { else { $account = Account::findOrFail(Auth::user()->account_id); - $account->name = Input::get('name'); - $account->address1 = Input::get('address1'); - $account->address2 = Input::get('address2'); - $account->city = Input::get('city'); - $account->state = Input::get('state'); - $account->postal_code = Input::get('postal_code'); + $account->name = trim(Input::get('name')); + $account->address1 = trim(Input::get('address1')); + $account->address2 = trim(Input::get('address2')); + $account->city = trim(Input::get('city')); + $account->state = trim(Input::get('state')); + $account->postal_code = trim(Input::get('postal_code')); $account->country_id = Input::get('country_id') ? Input::get('country_id') : null; $account->timezone_id = Input::get('timezone_id') ? Input::get('timezone_id') : null; $account->save(); $user = $account->users()->first(); - $user->first_name = Input::get('first_name'); - $user->last_name = Input::get('last_name'); - $user->email = Input::get('email'); - $user->phone = Input::get('phone'); + $user->first_name = trim(Input::get('first_name')); + $user->last_name = trim(Input::get('last_name')); + $user->email = trim(Input::get('email')); + $user->phone = trim(Input::get('phone')); $user->save(); if (Input::get('timezone_id')) { @@ -480,10 +483,10 @@ class AccountController extends \BaseController { } $user = Auth::user(); - $user->first_name = Input::get('first_name'); - $user->last_name = Input::get('last_name'); - $user->email = Input::get('email'); - $user->password = Input::get('password'); + $user->first_name = trim(Input::get('first_name')); + $user->last_name = trim(Input::get('last_name')); + $user->email = trim(Input::get('email')); + $user->password = trim(Input::get('password')); $user->registered = true; $user->save(); diff --git a/app/controllers/ClientController.php b/app/controllers/ClientController.php index 268308ccfadc..7cbab2cb45ff 100755 --- a/app/controllers/ClientController.php +++ b/app/controllers/ClientController.php @@ -92,7 +92,7 @@ class ClientController extends \BaseController { public function show($publicId) { $client = Client::scope($publicId)->with('contacts')->firstOrFail(); - trackViewed($client->name); + trackViewed($client->name, ENTITY_CLIENT); $data = array( 'client' => $client, @@ -149,14 +149,14 @@ class ClientController extends \BaseController { $client = Client::createNew(); } - $client->name = Input::get('name'); - $client->work_phone = Input::get('work_phone'); - $client->address1 = Input::get('address1'); - $client->address2 = Input::get('address2'); - $client->city = Input::get('city'); - $client->state = Input::get('state'); - $client->notes = Input::get('notes'); - $client->postal_code = Input::get('postal_code'); + $client->name = trim(Input::get('name')); + $client->work_phone = trim(Input::get('work_phone')); + $client->address1 = trim(Input::get('address1')); + $client->address2 = trim(Input::get('address2')); + $client->city = trim(Input::get('city')); + $client->state = trim(Input::get('state')); + $client->notes = trim(Input::get('notes')); + $client->postal_code = trim(Input::get('postal_code')); if (Input::get('country_id')) { $client->country_id = Input::get('country_id'); } @@ -177,10 +177,10 @@ class ClientController extends \BaseController { $record = Contact::createNew(); } - $record->email = $contact->email; - $record->first_name = $contact->first_name; - $record->last_name = $contact->last_name; - $record->phone = $contact->phone; + $record->email = trim($contact->email); + $record->first_name = trim($contact->first_name); + $record->last_name = trim($contact->last_name); + $record->phone = trim($contact->phone); $record->is_primary = $isPrimary; $isPrimary = false; diff --git a/app/controllers/CreditController.php b/app/controllers/CreditController.php index ad1f1b645eaa..d121b01b49a9 100755 --- a/app/controllers/CreditController.php +++ b/app/controllers/CreditController.php @@ -114,7 +114,7 @@ class CreditController extends \BaseController { $credit->client_id = Input::get('client'); $credit->credit_date = toSqlDate(Input::get('credit_date')); - $credit->amount = Input::get('amount'); + $credit->amount = floatval(Input::get('amount')); $credit->save(); $message = $publicId ? 'Successfully updated credit' : 'Successfully created credit'; diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 9c1898bf40c5..b77351d86b72 100755 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -6,6 +6,6 @@ class HomeController extends BaseController { public function showWelcome() { - return View::make('home.index'); + return View::make('splash'); } } \ No newline at end of file diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 537115f435c1..b98ed0eb8e8c 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -73,6 +73,11 @@ class InvoiceController extends \BaseController { $user = $invitation->user; $invoice = $invitation->invoice; + if ($invoice->invoice_status_id < INVOICE_STATUS_VIEWED) { + $invoice->invoice_status_id = INVOICE_STATUS_VIEWED; + $invoice->save(); + } + $now = Carbon::now()->toDateTimeString(); $invitation->viewed_date = $now; @@ -84,7 +89,12 @@ class InvoiceController extends \BaseController { Activity::viewInvoice($invitation); - return View::make('invoices.view')->with('invoice', $invoice); + $data = array( + 'invoice' => $invoice, + 'invitation' => $invitation + ); + + return View::make('invoices.view', $data); } private function createGateway($accountGateway) @@ -119,9 +129,9 @@ class InvoiceController extends \BaseController { ); $card = new CreditCard($data); - + return [ - 'amount' => $invoice->getTotal(), + 'amount' => $invoice->total, 'card' => $card, 'currency' => 'USD', 'returnUrl' => URL::to('complete'), @@ -131,13 +141,14 @@ class InvoiceController extends \BaseController { public function show_payment($invitationKey) { - $invoice = Invoice::with('invoice_items', 'client.account.account_gateways.gateway')->where('invitation_key', '=', $invitationKey)->firstOrFail(); + $invitation = Invitation::with('invoice.invoice_items', 'invoice.client.account.account_gateways.gateway')->where('invitation_key', '=', $invitationKey)->firstOrFail(); + $invoice = $invitation->invoice; $accountGateway = $invoice->client->account->account_gateways[0]; $gateway = InvoiceController::createGateway($accountGateway); try { - $details = InvoiceController::getPaymentDetails($invoice); + $details = InvoiceController::getPaymentDetails($invoice); $response = $gateway->purchase($details)->send(); $ref = $response->getTransactionReference(); @@ -147,13 +158,17 @@ class InvoiceController extends \BaseController { exit('Sorry, there was an error processing your payment. Please try again later.'); } - $payment = new Payment; + $payment = Payment::createNew(); + $payment->invitation_id = $invitation->id; $payment->invoice_id = $invoice->id; - $payment->account_id = $invoice->account_id; - $payment->contact_id = 0; // TODO_FIX + $payment->amount = $invoice->total; + $payment->client_id = $invoice->client_id; + //$payment->contact_id = 0; // TODO_FIX $payment->transaction_reference = $ref; $payment->save(); + $invoice->balance = floatval($invoice->total) - floatval($paymount->amount); + if ($response->isSuccessful()) { @@ -180,7 +195,7 @@ class InvoiceController extends \BaseController { $payerId = Request::query('PayerID'); $token = Request::query('token'); - $payment = Payment::with('invoice.invoice_items')->where('transaction_reference','=',$token)->firstOrFail(); + $payment = Payment::with('invitation', 'invoice.invoice_items')->where('transaction_reference','=',$token)->firstOrFail(); $invoice = Invoice::with('client.account.account_gateways.gateway')->where('id', '=', $payment->invoice_id)->firstOrFail(); $accountGateway = $invoice->client->account->account_gateways[0]; $gateway = InvoiceController::createGateway($accountGateway); @@ -195,11 +210,17 @@ class InvoiceController extends \BaseController { { $payment->payer_id = $payerId; $payment->transaction_reference = $ref; - $payment->amount = $payment->invoice->getTotal(); $payment->save(); + + if ($payment->amount >= $invoice->amount) { + $invoice->invoice_status_id = INVOICE_STATUS_PAID; + } else { + $invoice->invoice_status_id = INVOICE_STATUS_PARTIAL; + } + $invoice->save(); Session::flash('message', 'Successfully applied payment'); - return Redirect::to('view/' . $payment->invoice->key); + return Redirect::to('view/' . $payment->invitation->invitation_key); } else { @@ -216,7 +237,7 @@ class InvoiceController extends \BaseController { public function edit($publicId) { $invoice = Invoice::scope($publicId)->with('account.country', 'client', 'invoice_items')->firstOrFail(); - trackViewed($invoice->invoice_number . ' - ' . $invoice->client->name); + trackViewed($invoice->invoice_number . ' - ' . $invoice->client->name, ENTITY_INVOICE); $data = array( 'account' => $invoice->account, @@ -271,7 +292,7 @@ class InvoiceController extends \BaseController { private function save($publicId = null) { $action = Input::get('action'); - + if ($action == 'archive' || $action == 'delete') { return InvoiceController::bulk(); @@ -295,13 +316,13 @@ class InvoiceController extends \BaseController { if ($clientPublicId == "-1") { $client = Client::createNew(); - $client->name = Input::get('name'); - $client->work_phone = Input::get('work_phone'); - $client->address1 = Input::get('address1'); - $client->address2 = Input::get('address2'); - $client->city = Input::get('city'); - $client->state = Input::get('state'); - $client->postal_code = Input::get('postal_code'); + $client->name = trim(Input::get('name')); + $client->work_phone = trim(Input::get('work_phone')); + $client->address1 = trim(Input::get('address1')); + $client->address2 = trim(Input::get('address2')); + $client->city = trim(Input::get('city')); + $client->state = trim(Input::get('state')); + $client->postal_code = trim(Input::get('postal_code')); if (Input::get('country_id')) { $client->country_id = Input::get('country_id'); } @@ -310,10 +331,10 @@ class InvoiceController extends \BaseController { $contact = Contact::createNew(); $contact->is_primary = true; - $contact->first_name = Input::get('first_name'); - $contact->last_name = Input::get('last_name'); - $contact->phone = Input::get('phone'); - $contact->email = Input::get('email'); + $contact->first_name = trim(Input::get('first_name')); + $contact->last_name = trim(Input::get('last_name')); + $contact->phone = trim(Input::get('phone')); + $contact->email = trim(Input::get('email')); $client->contacts()->save($contact); } else @@ -329,14 +350,17 @@ class InvoiceController extends \BaseController { $invoice = Invoice::createNew(); } - $invoice->invoice_number = Input::get('invoice_number'); + $invoice->invoice_number = trim(Input::get('invoice_number')); $invoice->discount = 0; $invoice->invoice_date = toSqlDate(Input::get('invoice_date')); $invoice->due_date = toSqlDate(Input::get('due_date')); $invoice->notes = Input::get('notes'); + $client->invoices()->save($invoice); $items = json_decode(Input::get('items')); + $total = 0; + foreach ($items as $item) { if (!isset($item->cost)) { @@ -346,6 +370,22 @@ class InvoiceController extends \BaseController { $item->qty = 0; } + $total += intval($item->qty) * floatval($item->cost); + } + + if ($action == 'email' && $invoice->invoice_status_id == INVOICE_STATUS_DRAFT) + { + $invoice->invoice_status_id = INVOICE_STATUS_SENT; + + $client->balance = $invoice->client->balance + $invoice->total; + $client->save(); + } + + $invoice->total = $total; + $invoice->save(); + + foreach ($items as $item) + { if (!$item->cost && !$item->qty && !$item->product_key && !$item->notes) { continue; @@ -353,12 +393,12 @@ class InvoiceController extends \BaseController { if ($item->product_key) { - $product = Product::findProductByKey($item->product_key); + $product = Product::findProductByKey(trim($item->product_key)); if (!$product) { $product = Product::createNew(); - $product->product_key = $item->product_key; + $product->product_key = trim($item->product_key); } /* @@ -372,14 +412,17 @@ class InvoiceController extends \BaseController { $invoiceItem = InvoiceItem::createNew(); $invoiceItem->product_id = isset($product) ? $product->id : null; - $invoiceItem->product_key = $item->product_key; - $invoiceItem->notes = $item->notes; - $invoiceItem->cost = $item->cost; - $invoiceItem->qty = $item->qty; + $invoiceItem->product_key = trim($item->product_key); + $invoiceItem->notes = trim($item->notes); + $invoiceItem->cost = floatval($item->cost); + $invoiceItem->qty = intval($item->qty); $invoice->invoice_items()->save($invoiceItem); } + /* + */ + if ($action == 'email') { $data = array('link' => URL::to('view') . '/' . $invoice->invoice_key); diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index fd9b92345324..c4506870f068 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -123,7 +123,7 @@ class PaymentController extends \BaseController $payment->client_id = Input::get('client'); $payment->invoice_id = $invoiceId; $payment->payment_date = toSqlDate(Input::get('payment_date')); - $payment->amount = Input::get('amount'); + $payment->amount = floatval(Input::get('amount')); $payment->save(); $message = $publicId ? 'Successfully updated payment' : 'Successfully created payment'; diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index dd1d09ed1113..e26a8da9cc4f 100755 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -74,8 +74,6 @@ class UserController extends BaseController { { if( Confide::user() ) { - // If user is logged, redirect to internal - // page, change it to '/admin', '/dashboard' or something return Redirect::to('/'); } else @@ -94,7 +92,7 @@ class UserController extends BaseController { 'email' => Input::get( 'email' ), // May be the username too 'username' => Input::get( 'email' ), // so we have to pass both 'password' => Input::get( 'password' ), - 'remember' => Input::get( 'remember' ), + 'remember' => true, ); // If you wish to only allow login from confirmed users, call logAttempt @@ -102,12 +100,16 @@ class UserController extends BaseController { // logAttempt will check if the 'email' perhaps is the username. // Get the value from the config file instead of changing the controller if ( Confide::logAttempt( $input, Config::get('confide::signup_confirm') ) ) - { + { + $account = Account::findOrFail(Auth::user()->account_id); + $account->last_login = Carbon::now()->toDateTimeString(); + $account->save(); + // Redirect the user to the URL they were trying to access before // caught by the authentication filter IE Redirect::guest('user/login'). // Otherwise fallback to '/' // Fix pull #145 - return Redirect::intended('/'); // change it to '/admin', '/dashboard' or something + return Redirect::intended('/clients'); // change it to '/admin', '/dashboard' or something } else { @@ -118,18 +120,20 @@ class UserController extends BaseController { { $err_msg = Lang::get('confide::confide.alerts.too_many_attempts'); } + /* elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) ) { $err_msg = Lang::get('confide::confide.alerts.not_confirmed'); } + */ else { $err_msg = Lang::get('confide::confide.alerts.wrong_credentials'); } - return Redirect::action('UserController@login') - ->withInput(Input::except('password')) - ->with( 'error', $err_msg ); + return Redirect::action('UserController@login') + ->withInput(Input::except('password')) + ->with( 'error', $err_msg ); } } diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index 3b8d49804e4a..56e8ba9b6efc 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -293,6 +293,7 @@ class ConfideSetupUsersTable extends Migration { $t->unsignedInteger('account_id'); $t->unsignedInteger('client_id'); $t->unsignedInteger('contact_id')->nullable(); + $t->unsignedInteger('invitation_id')->nullable(); $t->unsignedInteger('user_id')->nullable(); $t->timestamps(); $t->softDeletes(); diff --git a/app/models/Activity.php b/app/models/Activity.php index 5eae7747a9fe..745583d86b93 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -40,7 +40,7 @@ class Activity extends Eloquent $activity = Activity::getBlank(); $activity->client_id = $client->id; $activity->activity_type_id = ACTIVITY_TYPE_CREATE_CLIENT; - $activity->message = Auth::user()->getFullName() . ' created client ' . link_to('clients/'.$client->id, $client->name); + $activity->message = Auth::user()->getFullName() . ' created client ' . link_to('clients/'.$client->public_id, $client->name); $activity->save(); } @@ -60,7 +60,7 @@ class Activity extends Eloquent $activity->invoice_id = $invoice->id; $activity->client_id = $invoice->client_id; $activity->activity_type_id = ACTIVITY_TYPE_CREATE_INVOICE; - $activity->message = Auth::user()->getFullName() . ' created invoice ' . link_to('invoices/'.$invoice->id, $invoice->invoice_number); + $activity->message = Auth::user()->getFullName() . ' created invoice ' . link_to('invoices/'.$invoice->public_id, $invoice->invoice_number); $activity->save(); } @@ -81,7 +81,7 @@ class Activity extends Eloquent $activity->invoice_id = $invitation->invoice_id; $activity->contact_id = $invitation->contact_id; $activity->activity_type_id = ACTIVITY_TYPE_EMAIL_INVOICE; - //$activity->message = Auth::user()->getFullName() . ' emailed invoice ' . $invitation->invoice->number . ' to ' . $contact->getFullName(); + $activity->message = Auth::user()->getFullName() . ' emailed invoice ' . link_to('invoices/'.$invitation->invoice->public_id, $invitation->invoice->invoice_number) . ' to ' . $invitation->contact->getFullName(); $activity->save(); } @@ -127,7 +127,7 @@ class Activity extends Eloquent $activity->invoice_id = $invoice->id; $activity->client_id = $invoice->client_id; $activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_PAYMENT; - $activity->message = Auth::user()->getFullName() . ' archived payment ' . $invoice->number; + $activity->message = Auth::user()->getFullName() . ' archived payment'; $activity->save(); } @@ -141,7 +141,7 @@ class Activity extends Eloquent $activity->contact_id = $invitation->contact_id; $activity->invoice_id = $invitation->invoice_id; $activity->activity_type_id = ACTIVITY_TYPE_VIEW_INVOICE; - //$activity->message = $contact->getFullName() . ' viewed invoice ' . $invoice->number; + $activity->message = $invitation->contact->getFullName() . ' viewed invoice ' . link_to('invoices/'.$invitation->invoice->public_id, $invitation->invoice->invoice_number); $activity->save(); } } \ No newline at end of file diff --git a/app/models/Client.php b/app/models/Client.php index 57a1e3dbf1ae..fc07d9b00928 100755 --- a/app/models/Client.php +++ b/app/models/Client.php @@ -24,6 +24,11 @@ class Client extends EntityModel return $this->hasMany('Invoice'); } + public function payments() + { + return $this->hasMany('Payment'); + } + public function contacts() { return $this->hasMany('Contact'); diff --git a/app/models/Payment.php b/app/models/Payment.php index 86c42d0fecaf..964bcd911ace 100755 --- a/app/models/Payment.php +++ b/app/models/Payment.php @@ -7,6 +7,11 @@ class Payment extends EntityModel return $this->belongsTo('Invoice'); } + public function invitation() + { + return $this->belongsTo('Invitation'); + } + public function client() { return $this->belongsTo('Client'); diff --git a/app/models/User.php b/app/models/User.php index 8c066497346f..0e88039d9ba9 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -84,4 +84,9 @@ class User extends ConfideUser implements UserInterface, RemindableInterface, iP return $fullName; } } + + public function showGreyBackground() + { + return !$this->theme_id || in_array($this->theme_id, [2, 3, 5, 6, 7, 8, 10, 11, 12]); + } } \ No newline at end of file diff --git a/app/routes.php b/app/routes.php index aedae406cea3..93dbf0103e2f 100755 --- a/app/routes.php +++ b/app/routes.php @@ -24,6 +24,17 @@ Route::get('complete', 'InvoiceController@do_payment'); Route::post('signup/validate', 'AccountController@checkEmail'); Route::post('signup/submit', 'AccountController@submitSignup'); +// Confide routes +Route::get('login', 'UserController@login'); +Route::post('login', 'UserController@do_login'); +//Route::get( 'user/confirm/{code}', 'UserController@confirm'); +Route::get('forgot_password', 'UserController@forgot_password'); +Route::post('forgot_password', 'UserController@do_forgot_password'); +//Route::get('user/reset_password/{token}', 'UserController@reset_password'); +//Route::post('user/reset_password', 'UserController@do_reset_password'); +Route::get('logout', 'UserController@logout'); + + Route::filter('auth', function() { if (!Auth::check()) @@ -62,18 +73,6 @@ Route::group(array('before' => 'auth'), function() Route::get('reports', function() { return View::make('header'); }); }); -// Confide routes -//Route::get( 'user/create', 'UserController@create'); -//Route::post('user', 'UserController@store'); -Route::get('login', 'UserController@login'); -Route::post('login', 'UserController@do_login'); -//Route::get( 'user/confirm/{code}', 'UserController@confirm'); -//Route::get( 'user/forgot_password', 'UserController@forgot_password'); -//Route::post('user/forgot_password', 'UserController@do_forgot_password'); -//Route::get( 'user/reset_password/{token}', 'UserController@reset_password'); -//Route::post('user/reset_password', 'UserController@do_reset_password'); -Route::get('logout', 'UserController@logout'); - @@ -132,7 +131,8 @@ function timestampToDateTimeString($timestamp) { if ($date->year < 1900) { return ''; } - return $date->toFormattedDateTimeString(); + + return $date->format('l M jS, Y g:ia'); } function timestampToDateString($timestamp) { @@ -206,7 +206,7 @@ function processedRequest($url) -function trackViewed($name) +function trackViewed($name, $type) { $url = Request::url(); $viewed = Session::get(RECENTLY_VIEWED); @@ -218,7 +218,7 @@ function trackViewed($name) $object = new stdClass; $object->url = $url; - $object->name = $name; + $object->name = ucwords($type) . ': ' . $name; for ($i=0; $i #logo { diff --git a/app/views/accounts/nav.blade.php b/app/views/accounts/nav.blade.php index 9da50254148d..65301f53d8f8 100755 --- a/app/views/accounts/nav.blade.php +++ b/app/views/accounts/nav.blade.php @@ -1,7 +1,7 @@ @extends('header') @section('content') - +