From 583f16b38db6f4f8b1dcd6a07e1d7ffca534c658 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley Date: Thu, 14 Jun 2018 15:46:21 +0100 Subject: [PATCH] Add guest label to admin customers index --- app/assets/stylesheets/admin/customers.css.scss | 11 +++++++++++ app/views/admin/customers/index.html.haml | 4 +++- config/locales/en.yml | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/admin/customers.css.scss b/app/assets/stylesheets/admin/customers.css.scss index e3c427649c..81e6f0140c 100644 --- a/app/assets/stylesheets/admin/customers.css.scss +++ b/app/assets/stylesheets/admin/customers.css.scss @@ -1,3 +1,14 @@ .tag-with-rules { color: black; } + +table#customers.index { + + tr.customer { + + .guest-label { + color: #999; + display: block; + } + } +} \ No newline at end of file diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index bb4c94a56c..9a269b5a99 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -75,7 +75,9 @@ %tr.customer{ 'ng-repeat' => "customer in filteredCustomers = ( customers | filter:quickSearch | orderBy:predicate:reverse ) | limitTo:customerLimit track by customer.id", 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "c_{{customer.id}}" } -# %td.bulk -# %input{ :type => "checkbox", :name => 'bulk', 'ng-model' => 'customer.checked' } - %td.email{ 'ng-show' => 'columns.email.visible', "ng-bind" => '::customer.email' } + %td.email{ 'ng-show' => 'columns.email.visible'} + %span{ 'ng-bind' => '::customer.email' } + %span.guest-label{ 'ng-show' => 'customer.user_id == null' }= t('.guest_label') %td.name{ 'ng-show' => 'columns.name.visible'} %input{ type: 'text', name: 'name', ng: { model: 'customer.name' }, 'obj-for-update' => 'customer', 'attr-for-update' => 'name'} %td.code{ 'ng-show' => 'columns.code.visible' } diff --git a/config/locales/en.yml b/config/locales/en.yml index 6481ef8316..3cf795c2e9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -376,6 +376,7 @@ en: update_address: 'Update Address' confirm_delete: 'Sure to delete?' search_by_email: "Search by email/code..." + guest_label: 'Guest checkout' destroy: has_associated_orders: 'Delete failed: customer has associated orders with his shop'