From dcf857cafbb1adb266c259218fb648e7ec7181cb Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 17 May 2023 12:27:22 +1000 Subject: [PATCH] Move warning colour definition to CSS This also changes the orange to red, but that's part of the plan. --- app/views/admin/enterprises/_actions.html.haml | 6 +++--- app/views/admin/enterprises/_admin_index.html.haml | 2 +- app/webpacker/css/admin/enterprises.scss | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/views/admin/enterprises/_actions.html.haml b/app/views/admin/enterprises/_actions.html.haml index 250f508bf7..696fd1a780 100644 --- a/app/views/admin/enterprises/_actions.html.haml +++ b/app/views/admin/enterprises/_actions.html.haml @@ -17,18 +17,18 @@ = link_to_with_icon 'icon-chevron-right', t('.payment_methods'), spree.admin_payment_methods_path(enterprise_id: enterprise.id) (#{enterprise.payment_methods.count}) - if enterprise.payment_methods.count == 0 - %span.icon-exclamation-sign{"ofn-with-tip" => t('.payment_methods_tip'), style: "font-size: 16px;color: #DA5354"} + %span.warning-icon.icon-exclamation-sign{"ofn-with-tip" => t('.payment_methods_tip')} %br/ - if can?(:admin, Spree::ShippingMethod) && can?(:manage_shipping_methods, enterprise) = link_to_with_icon 'icon-plane', t('.shipping_methods'), spree.admin_shipping_methods_path(enterprise_id: enterprise.id) (#{enterprise.shipping_methods.count}) - if enterprise.shipping_methods.count == 0 - %span.icon-exclamation-sign{"ofn-with-tip" => t('.shipping_methods_tip'), style: "font-size: 16px;color: #DA5354"} + %span.warning-icon.icon-exclamation-sign{"ofn-with-tip" => t('.shipping_methods_tip')} %br/ - if can?(:admin, EnterpriseFee) && can?(:manage_enterprise_fees, enterprise) = link_to_with_icon 'icon-money', t('.enterprise_fees'), main_app.admin_enterprise_fees_path(enterprise_id: enterprise.id) (#{enterprise.enterprise_fees.count}) - if enterprise.enterprise_fees.count == 0 - %span.icon-warning-sign{"ofn-with-tip" => t('.enterprise_fees_tip'), style: "font-size: 16px;color: orange"} + %span.warning-icon.icon-warning-sign{"ofn-with-tip" => t('.enterprise_fees_tip')} diff --git a/app/views/admin/enterprises/_admin_index.html.haml b/app/views/admin/enterprises/_admin_index.html.haml index ed8df10b7f..2592d9970c 100644 --- a/app/views/admin/enterprises/_admin_index.html.haml +++ b/app/views/admin/enterprises/_admin_index.html.haml @@ -32,7 +32,7 @@ %td= enterprise_form.check_box :visible, {}, 'public', 'hidden' - if spree_current_user.admin? %td= enterprise_form.select :owner_id, enterprise.users.map{ |e| [ e.email, e.id ] }, {}, class: "select2 fullwidth" - %td + %td.enterprise-actions = render 'actions', enterprise: enterprise - if @enterprises.empty? %tr diff --git a/app/webpacker/css/admin/enterprises.scss b/app/webpacker/css/admin/enterprises.scss index 55fd17b3ac..d0f2969088 100644 --- a/app/webpacker/css/admin/enterprises.scss +++ b/app/webpacker/css/admin/enterprises.scss @@ -35,3 +35,10 @@ form[name="enterprise_form"] { margin-bottom: 1em; margin-top: 1em; } + +table .enterprise-actions { + .warning-icon { + color: $warning-red; + font-size: 16px; + } +}