diff --git a/app/helpers/spree/admin/navigation_helper.rb b/app/helpers/spree/admin/navigation_helper.rb index 56fc759660..330cf721ae 100644 --- a/app/helpers/spree/admin/navigation_helper.rb +++ b/app/helpers/spree/admin/navigation_helper.rb @@ -26,11 +26,11 @@ module Spree destination_url = options[:url] || spree.public_send("#{options[:route]}_path") titleized_label = Spree.t(options[:label], default: options[:label], - scope: [:admin, :tab]).titleize + scope: [:admin, :tab]).capitalize css_classes = [] - if options[:icon] + if options[:icon] && !feature?(:admin_style_v3, spree_current_user) link = link_to_with_icon(options[:icon], titleized_label, destination_url) css_classes << 'tab-with-icon' else diff --git a/app/webpacker/css/admin_v3/all.scss b/app/webpacker/css/admin_v3/all.scss index 72c5c4260c..4756a4d133 100644 --- a/app/webpacker/css/admin_v3/all.scss +++ b/app/webpacker/css/admin_v3/all.scss @@ -32,7 +32,7 @@ @import "../admin/shared/tables"; @import "../admin/shared/icons"; @import "../admin/shared/forms"; -@import "../admin/shared/layout"; +@import "shared/layout"; // admin_v3 @import "../admin/shared/scroll_bar"; @import "../admin/plugins/flatpickr-customization"; @@ -56,7 +56,7 @@ @import "../admin/components/input"; @import "../admin/components/jquery_dialog"; @import "../admin/components/messages"; -@import "../admin/components/navigation"; +@import "components/navigation"; // admin_v3 @import "../admin/components/ng-cloak"; @import "../admin/components/page_actions"; @import "../admin/components/pagination"; diff --git a/app/webpacker/css/admin_v3/components/navigation.scss b/app/webpacker/css/admin_v3/components/navigation.scss new file mode 100644 index 0000000000..3291225c01 --- /dev/null +++ b/app/webpacker/css/admin_v3/components/navigation.scss @@ -0,0 +1,153 @@ +// Navigation +//--------------------------------------------------- +.inline-menu { + margin: 0; + -webkit-margin-before: 0; + -webkit-padding-start: 0; +} + +nav.menu { + ul { + list-style: none; + + li { + a { + padding: 10px 0; + display: block; + position: relative; + text-align: left; + border: 1px solid transparent; + text-transform: uppercase; + font-weight: 600; + font-size: 16px; + } + + &.active a { + color: $color-2; + border-left-width: 0; + border-bottom-color: $color-2; + } + + &:hover a { + color: $color-2; + } + } + } +} + +.admin-login-navigation-bar { + ul { + text-align: right; + + li { + padding: 5px 0 5px 10px; + text-align: right; + font-size: 90%; + color: $color-link; + margin-top: 8px; + + &.user-logged-in-as { + width: 50%; + color: $color-body-text; + } + + &:hover { + i { + color: $color-2; + } + } + } + } +} + +#admin-menu { + box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.05), 0px 2px 2px rgba(0, 0, 0, 0.07); + + ul { + display: flex; + } + + li { + min-width: 90px; + flex-grow: 1; + padding-left: 2px; + padding-right: 2px; + + a { + display: block; + padding: 25px 5px; + color: $color-9 !important; + position: relative; + text-align: center; + font-weight: 600; + font-size: 16px; + + i { + display: inline; + } + + &:hover { + color: $color-5 !important; + border-bottom: 2px solid $color-5; + } + + span.text { + font-weight: 600; + } + } + + a::before { + font-weight: normal; + padding-top: 0; + } + + .dropdown { + width: 300px; + background-color: $color-3; + width: 200px; + z-index: 100000; + + > li { + width: 200px !important; + + a:after { + display: none; + } + } + } + + &.selected a { + @extend a, :hover; + } + } +} + +#sub-menu { + padding-bottom: 0; + box-shadow: 0px 1px 0px $color-7; + + li { + a { + display: block; + padding: 12px 20px; + color: $color-9; + text-align: center; + position: relative; + font-size: 14px; + } + + &.selected a, + a:hover { + color: $color-5; + border-bottom: 2px solid $color-5; + } + } +} + +#header figure { + margin: 0.25em 0; +} + +#login-nav { + line-height: 1.75em; +} diff --git a/app/webpacker/css/admin_v3/globals/palette.scss b/app/webpacker/css/admin_v3/globals/palette.scss index a22e4a985b..859424e573 100644 --- a/app/webpacker/css/admin_v3/globals/palette.scss +++ b/app/webpacker/css/admin_v3/globals/palette.scss @@ -1,7 +1,10 @@ // Basic color palette for admin styles v3 -$color-1: #FFFFFF !default; // White -$color-2: #9FC820 !default; // Green -$color-3: #008397 !default; // Teal (Allports) -$color-4: #6788A2 !default; // Dark Blue -$color-5: #C85136 !default; // Red/Orange (Mojo) -$color-6: #FF9300 !default; // Yellow +$color-1: #ffffff !default; // White +$color-2: #9fc820 !default; // Green +$color-3: #008397 !default; // Teal (Allports) +$color-4: #6788a2 !default; // Dark Blue +$color-5: #c85136 !default; // Red/Orange (Mojo) +$color-6: #ff9300 !default; // Yellow +$color-7: #eff1f2 !default; // Light grey +$color-8: #191c1d !default; // Near-black +$color-9: #2e3132 !default; // Dark Grey diff --git a/app/webpacker/css/admin_v3/shared/layout.scss b/app/webpacker/css/admin_v3/shared/layout.scss new file mode 100644 index 0000000000..c5cd8c71e2 --- /dev/null +++ b/app/webpacker/css/admin_v3/shared/layout.scss @@ -0,0 +1,137 @@ +// Basics +//--------------------------------------------------- +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.admin { + &__section-header { + padding: 15px 0; + margin-top: 25px; + + h1 { + color: $color-8; + } + + .ofn-drop-down { + border: 0; + background-color: $spree-blue; + color: $color-1; + float: none; + margin-left: 3px; + &:hover, + &.expanded { + border: 0; + color: $color-1; + } + } + + &__content { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + @media all and (min-width: $tablet_breakpoint) { + flex-wrap: nowrap; + } + } + + &__title { + width: 100%; + margin-bottom: 10px; + @media all and (min-width: $tablet_breakpoint) { + margin-bottom: 0; + } + } + + &__actions { + display: flex; + flex: 1 0 auto; + align-items: center; + list-style: none; + @media all and (min-width: $tablet_breakpoint) { + justify-content: flex-end; + } + > li { + display: flex; + margin-right: 10px; + &:empty { + display: none; + } + &:last-child { + margin-right: 0; + } + } + } + } +} + +.hidden { + display: none; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +.mr-0 { + margin-right: 0 !important; +} + +.ml-0 { + margin-left: 0 !important; +} + +@media print { + .print-hidden { + display: none !important; + } +} + +// Header +//--------------------------------------------------- +#header { + background-color: $color-1; + padding: 5px 0; +} + +#logo { + height: 40px; +} + +.page-title { + i { + color: $color-2; + } +} + +// Content +//--------------------------------------------------- +#content { + background-color: $color-1; + position: relative; + z-index: 0; + padding: 0; + margin-top: 15px; +} + +// Footer +//--------------------------------------------------- +#footer { + margin-top: 15px; + border-top: 1px solid $color-border; + padding: 10px 0; +} + +@media print { + header, + nav { + display: none; + } +} diff --git a/spec/system/admin/bulk_order_management_spec.rb b/spec/system/admin/bulk_order_management_spec.rb index a82d1540b7..269e06ccb0 100644 --- a/spec/system/admin/bulk_order_management_spec.rb +++ b/spec/system/admin/bulk_order_management_spec.rb @@ -1195,8 +1195,8 @@ describe ' it "displays a Bulk Management Tab under the Orders item" do visit '/admin/orders' - expect(page).to have_link "Bulk Order Management" - click_link "Bulk Order Management" + expect(page).to have_link "Bulk order management" + click_link "Bulk order management" expect(page).to have_selector "h1.page-title", text: "Bulk Order Management" end diff --git a/spec/system/admin/order_cycles/simple_spec.rb b/spec/system/admin/order_cycles/simple_spec.rb index c2d71b9561..c05501d633 100644 --- a/spec/system/admin/order_cycles/simple_spec.rb +++ b/spec/system/admin/order_cycles/simple_spec.rb @@ -203,7 +203,7 @@ describe ' name: 'Order Cycle 2' ) visit spree.admin_dashboard_path - click_link "Order Cycles" + click_link "Order cycles" # I should see only the order cycle I am coordinating expect(page).to have_selector "tr.order-cycle-#{oc_user_coordinating.id}" diff --git a/spec/system/admin/schedules_spec.rb b/spec/system/admin/schedules_spec.rb index 07dfaf413b..8913d9af18 100644 --- a/spec/system/admin/schedules_spec.rb +++ b/spec/system/admin/schedules_spec.rb @@ -30,7 +30,7 @@ describe 'Schedules' do describe "Adding a new Schedule" do it "immediately shows the schedule in the order cycle list once created" do visit spree.admin_dashboard_path - click_link 'Order Cycles' + click_link 'Order cycles' expect(page).to have_selector ".order-cycle-#{oc1.id}" find('a', text: 'NEW SCHEDULE').click