From 30631b2bc49dcdf022848991c7fbd347835c33dd Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 29 Nov 2015 18:00:50 +0200 Subject: [PATCH] Optimized client view page --- app/Ninja/Repositories/CreditRepository.php | 1 + app/Services/DatatableService.php | 12 ++++++---- public/favicon-v2.png | Bin 0 -> 3064 bytes resources/views/clients/show.blade.php | 24 ++++++++++++++++++-- resources/views/datatable.blade.php | 17 ++++++++++---- resources/views/invoices/knockout.blade.php | 2 +- resources/views/master.blade.php | 2 +- 7 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 public/favicon-v2.png diff --git a/app/Ninja/Repositories/CreditRepository.php b/app/Ninja/Repositories/CreditRepository.php index 1ac543c5b2..4fdace91ed 100644 --- a/app/Ninja/Repositories/CreditRepository.php +++ b/app/Ninja/Repositories/CreditRepository.php @@ -19,6 +19,7 @@ class CreditRepository extends BaseRepository ->join('contacts', 'contacts.client_id', '=', 'clients.id') ->where('clients.account_id', '=', \Auth::user()->account_id) ->where('clients.deleted_at', '=', null) + ->where('contacts.deleted_at', '=', null) ->where('contacts.is_primary', '=', true) ->select('credits.public_id', 'clients.name as client_name', 'clients.public_id as client_public_id', 'credits.amount', 'credits.balance', 'credits.credit_date', 'clients.currency_id', 'contacts.first_name', 'contacts.last_name', 'contacts.email', 'credits.private_notes', 'credits.deleted_at', 'credits.is_deleted'); diff --git a/app/Services/DatatableService.php b/app/Services/DatatableService.php index 32d5909800..67636ebc96 100644 --- a/app/Services/DatatableService.php +++ b/app/Services/DatatableService.php @@ -12,7 +12,8 @@ class DatatableService if ($actions && $showCheckbox) { $table->addColumn('checkbox', function ($model) { - return ''; + return ''; }); } @@ -81,14 +82,17 @@ class DatatableService } if ($entityType != ENTITY_USER || $model->public_id) { - $str .= "
  • public_id})\">" . trans("texts.archive_{$entityType}") . "
  • "; + $str .= "
  • public_id})\">" + . trans("texts.archive_{$entityType}") . "
  • "; } } else { - $str .= "
  • public_id})\">" . trans("texts.restore_{$entityType}") . "
  • "; + $str .= "
  • public_id})\">" + . trans("texts.restore_{$entityType}") . "
  • "; } if (property_exists($model, 'is_deleted') && !$model->is_deleted) { - $str .= "
  • public_id})\">" . trans("texts.delete_{$entityType}") . "
  • "; + $str .= "
  • public_id})\">" + . trans("texts.delete_{$entityType}") . "
  • "; } return $str.''; diff --git a/public/favicon-v2.png b/public/favicon-v2.png new file mode 100644 index 0000000000000000000000000000000000000000..9fdfcb9aae66f41359c8e22d524914dfef9cf094 GIT binary patch literal 3064 zcmVg0{P)}>cDisj5 zs6Y`B684=$tVv)}Gz17qUfz52$8(gi6arf2{+E;A@_E1I-ut~jkR(Z9ibfCw004bz zwM-^!X>OLwF9+7}e~V;W$o`q(C58l$5k|*)nHmX9j~oHG7qCTCKLL ztLt2T{>|&xO&ErvC=A0E&Vl1NhG8HGE=o#TmzE|F2w1kZuLjO&G`6<1oIQK?YGEM= zf+&hw{^>86$z&o3V)2qC>(kTy{QVgW#!JB|mC7Fr3s2?d4h;>_t*n6QVvRi;CX>mA z#af@9o|2Nn;c}-5C#|c?J$dq0Ss99=(>Tr(Z!}4g(J?Vww`~g%i>C~Cy|nb$(WCO7 z9vY1X`~gOiB!*#g=g$4hhab*QOq>GTkA;OtzxblBug~&RKkZZK=H`}>nVBS!{PtgH z+%=mSG5`Qj6jiBIe?NGzvZ7*gIB8wov7<+4hKw>Aji%9P_I>(kcX#(ha4MxT_vA@= zPtS~zQHCH$pIW^qD@#8zGCrKqXuNXe%B`}pKj;Qb%GXd|pPijO_6|J15HhKB)5eWP zqw&>xjVT$1Vc%c66c7;bKPxw=)t<}G9~v5>$jBKt3Im4Wza2R6d^stU&d$!l!a_Qo zjvxqw!C*3(2!fCRK$0Xd^|Zy}tmCO+7&fZc>-Bo-MwXS8&7VL2DV)JzIGdjjK@bRn zc6N5*;o*_d(L5f{p3Szivt!PhMG^!-k|aUA8YBpUAP58iyAjoVs8x016BspBJNF)jl2@wi~91h3D#buVY z^(%oJ9v<%R>r*O~tt~C}GFd}?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6s-rmpJ$mR0VYuBnOEC2EN=Z=n! zk|j%Ci-`#g3bJRjE$3si*$9uv`?<2xlGcNRgFjbPl$V#^`spVVhP@se8yg$@dTi`( z^8g-?w`J?r#?yhv9Xc!=DE4MPdXP2!yXsVIU2QD@088I^BQ8EZL@c(qx1XRFm&;w9nwpT9xMJnX+qZ8QU%gsd zS{fb^5g8RVKQYnA$7f7A_2rh**`JeCyV&%LN6M6&2S?N_GX_raj&{srBsT7 zf({)%92phGVzE#ZeaRe{$z<~Rd{0kL$>PQLs;kfBEPf%<@FH}5t}w|4hjxtGMRsbSR@EyRIjh8sX3XG z)703AqNumG_rEooA)O9_pxjfZ!XqL;k|gzd{YSfYQK>J2Adyi~o40Hci9|CdVDHz| zF>UK z_wL=%(a{;M;*1ShFbwa`${MGT;~x-^mYzPgI56{tk~OKRq2b}1# zTU$FaJWNS{DwPP)< literal 0 HcmV?d00001 diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index d8918f9d63..b83bbb51f7 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -186,6 +186,7 @@ trans('texts.balance'), trans('texts.adjustment')) ->setUrl(url('api/activities/'. $client->public_id)) + ->setCustomValues('entityType', 'activity') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) @@ -203,6 +204,7 @@ trans('texts.description'), trans('texts.status')) ->setUrl(url('api/tasks/'. $client->public_id)) + ->setCustomValues('entityType', 'tasks') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) @@ -223,6 +225,7 @@ trans('texts.valid_until'), trans('texts.status')) ->setUrl(url('api/quotes/'. $client->public_id)) + ->setCustomValues('entityType', 'quotes') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) @@ -241,6 +244,7 @@ trans('texts.end_date'), trans('texts.invoice_total')) ->setUrl(url('api/recurring_invoices/' . $client->public_id)) + ->setCustomValues('entityType', 'recurring_invoices') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'asc']]) @@ -256,6 +260,7 @@ trans('texts.due_date'), trans('texts.status')) ->setUrl(url('api/invoices/' . $client->public_id)) + ->setCustomValues('entityType', 'invoices') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) @@ -272,6 +277,7 @@ trans('texts.payment_amount'), trans('texts.payment_date')) ->setUrl(url('api/payments/' . $client->public_id)) + ->setCustomValues('entityType', 'payments') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) @@ -287,6 +293,7 @@ trans('texts.credit_date'), trans('texts.private_notes')) ->setUrl(url('api/credits/' . $client->public_id)) + ->setCustomValues('entityType', 'credits') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'asc']]) @@ -297,6 +304,8 @@ \ No newline at end of file diff --git a/resources/views/invoices/knockout.blade.php b/resources/views/invoices/knockout.blade.php index a66c2fcfe1..8308230634 100644 --- a/resources/views/invoices/knockout.blade.php +++ b/resources/views/invoices/knockout.blade.php @@ -354,7 +354,7 @@ function InvoiceModel(data) { self.totals.subtotal = ko.computed(function() { var total = self.totals.rawSubtotal(); - return total > 0 ? formatMoney(total, self.client().currency_id()) : ''; + return formatMoney(total, self.client().currency_id()); }); self.totals.rawDiscounted = ko.computed(function() { diff --git a/resources/views/master.blade.php b/resources/views/master.blade.php index a5238a437f..ad13a7759d 100644 --- a/resources/views/master.blade.php +++ b/resources/views/master.blade.php @@ -6,7 +6,7 @@ @else {{ isset($title) ? ($title . ' | Invoice Ninja') : ('Invoice Ninja | ' . trans('texts.app_title')) }} - + @endif