From 3319f38e6ca2acb0e81bb0ec77b8048f25464da8 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 14 Dec 2023 10:14:04 +1100 Subject: [PATCH] Rename class to signal intent Because the HTML is changed, I had to also update the old stylesheet too. --- app/views/spree/admin/overview/_enterprises.html.haml | 4 ++-- .../spree/admin/overview/_enterprises_header.html.haml | 2 +- app/views/spree/admin/overview/_order_cycles.html.haml | 6 +++--- app/views/spree/admin/overview/_products.html.haml | 6 +++--- app/webpacker/css/admin/dashboard_item.scss | 10 +++++----- .../css/admin_v3/dashboard/dashboard_item.scss | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/views/spree/admin/overview/_enterprises.html.haml b/app/views/spree/admin/overview/_enterprises.html.haml index ed3d93e663..bef20ba29c 100644 --- a/app/views/spree/admin/overview/_enterprises.html.haml +++ b/app/views/spree/admin/overview/_enterprises.html.haml @@ -2,12 +2,12 @@ = render 'enterprises_header' - if @enterprises.empty? - %div.sixteen.columns.alpha.list-item.red + %div.sixteen.columns.alpha.list-item.warning %span.text.fifteen.columns.alpha = t "spree_admin_enterprises_none_text" %span.one.columns.omega %span.icon-remove-sign - %a.sixteen.columns.alpha.button.bottom.red{ href: "#{main_app.new_admin_enterprise_path}" } + %a.sixteen.columns.alpha.button.bottom.warning{ href: "#{main_app.new_admin_enterprise_path}" } = t "spree_admin_enterprises_none_create_a_new_enterprise" %span.icon-arrow-right diff --git a/app/views/spree/admin/overview/_enterprises_header.html.haml b/app/views/spree/admin/overview/_enterprises_header.html.haml index 26b501556f..760043dcfa 100644 --- a/app/views/spree/admin/overview/_enterprises_header.html.haml +++ b/app/views/spree/admin/overview/_enterprises_header.html.haml @@ -1,4 +1,4 @@ -%div.header.sixteen.columns.alpha{ :class => "#{@enterprises.count > 0 ? "" : "red"}"} +%div.header.sixteen.columns.alpha{ :class => "#{@enterprises.count > 0 ? "" : "warning"}"} %h3.thirteen.columns.alpha = t "spree_admin_overview_enterprises_header" - if @enterprises.any? diff --git a/app/views/spree/admin/overview/_order_cycles.html.haml b/app/views/spree/admin/overview/_order_cycles.html.haml index e47e8332f5..f18ac33299 100644 --- a/app/views/spree/admin/overview/_order_cycles.html.haml +++ b/app/views/spree/admin/overview/_order_cycles.html.haml @@ -1,10 +1,10 @@ -- color_class = "red" unless @order_cycle_count > 0 -- icon_class = @order_cycle_count > 0 ? "icon-ok-sign" : "icon-warning-sign" +- color_class = "warning" unless @order_cycle_count.positive? +- icon_class = @order_cycle_count.positive? ? "icon-ok-sign" : "icon-warning-sign" %div.dashboard_item.seven.columns.omega#order_cycles %div.header.sixteen.columns.alpha{class: color_class} %h3.ten.columns.alpha = t ".order_cycles" - - if @order_cycle_count > 0 + - if @order_cycle_count.positive? %a.six.columns.omega.icon-plus.button{ href: main_app.new_admin_order_cycle_path } = t "spree_admin_enterprises_create_new" - else diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index f797e2b2fd..861f7cec2c 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -1,5 +1,5 @@ %div.dashboard_item.seven.columns.alpha#products - %div.header.sixteen.columns.alpha{ :class => "#{@product_count > 0 ? "" : "red"}"} + %div.header.sixteen.columns.alpha{ :class => "#{@product_count > 0 ? "" : "warning"}"} %h3.ten.columns.alpha = t "products" - if @product_count > 0 @@ -19,11 +19,11 @@ = t "spree_admin_enterprises_producers_manage_products" %span.icon-arrow-right - else - %div.sixteen.columns.alpha.list-item.red + %div.sixteen.columns.alpha.list-item.warning %span.thirteen.columns.alpha = t(".active_products", count: @product_count ) %span.three.columns.omega %span.icon-remove-sign - %a.sixteen.columns.alpha.button.bottom.red{ href: "#{new_admin_product_path}" } + %a.sixteen.columns.alpha.button.bottom.warning{ href: "#{new_admin_product_path}" } = t "spree_admin_enterprises_create_new_product" %span.icon-arrow-right diff --git a/app/webpacker/css/admin/dashboard_item.scss b/app/webpacker/css/admin/dashboard_item.scss index 67498fa352..567d1f63e5 100644 --- a/app/webpacker/css/admin/dashboard_item.scss +++ b/app/webpacker/css/admin/dashboard_item.scss @@ -18,7 +18,7 @@ div.dashboard_item { background-color: $spree-green; } - &.red { + &.warning { background-color: $color-warning; } @@ -39,7 +39,7 @@ div.dashboard_item { bottom: 5px; } - &.red { + &.warning { border-color: $color-warning; border-width: 3px; @@ -160,13 +160,13 @@ div.dashboard_item { border: solid $color-warning; } - &.red { + &.warning { color: $color-warning; border: solid $color-warning; } &.orange, - &.red { + &.warning { border-width: 0px 3px 0px 3px; } @@ -224,7 +224,7 @@ div.dashboard_item { background-color: $spree-blue; } - &.red { + &.warning { background-color: $color-warning; } diff --git a/app/webpacker/css/admin_v3/dashboard/dashboard_item.scss b/app/webpacker/css/admin_v3/dashboard/dashboard_item.scss index 5dd144cc05..4e7fe00024 100644 --- a/app/webpacker/css/admin_v3/dashboard/dashboard_item.scss +++ b/app/webpacker/css/admin_v3/dashboard/dashboard_item.scss @@ -14,7 +14,7 @@ div.dashboard_item { padding: 0px 6px; border-radius: 10px; - &.red { + &.warning { background-color: $color-warning; } } @@ -31,7 +31,7 @@ div.dashboard_item { bottom: 5px; } - &.red { + &.warning { border-color: $color-warning; border-width: 3px; @@ -139,7 +139,7 @@ div.dashboard_item { font-size: 30px; } - &.red { + &.warning { color: $color-warning; border: solid $color-warning; border-width: 0px 3px 0px 3px; @@ -184,7 +184,7 @@ div.dashboard_item { font-weight: bold; text-align: center; - &.red { + &.warning { background-color: $color-warning; }