Skip to content

Commit 6c56801

Browse files
author
Bogdan Plieshka
committed
MAGETWO-32250: Header
- CR changes
1 parent c852b8e commit 6c56801

File tree

9 files changed

+64
-32
lines changed

9 files changed

+64
-32
lines changed

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ class ToolbarEntry extends \Magento\Backend\Block\Template
2020
*/
2121
const NOTIFICATIONS_NUMBER = 3;
2222

23+
/**
24+
* Number of notifications showed on icon
25+
*/
26+
const NOTIFICATIONS_COUNTER_MAX = 99;
27+
2328
/**
2429
* Length of notification description showed by default
2530
*/
@@ -56,6 +61,16 @@ public function getNotificationDescriptionLength()
5661
return self::NOTIFICATION_DESCRIPTION_LENGTH;
5762
}
5863

64+
/**
65+
* Retrieve notification counter max value
66+
*
67+
* @return int
68+
*/
69+
public function getNotificationCounterMax()
70+
{
71+
return self::NOTIFICATIONS_COUNTER_MAX;
72+
}
73+
5974
/**
6075
* Retrieve number of unread notifications
6176
*

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
?>
1010
<?php /** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ ?>
11-
<?php $notificationCount = $block->getUnreadNotificationCount(); ?>
11+
<?php
12+
$notificationCount = $block->getUnreadNotificationCount();
13+
$notificationCounterMax = $block->getNotificationCounterMax();
14+
?>
1215
<div
1316
data-mage-init='{"toolbarEntry": {}}'
1417
class="notifications-wrapper"
@@ -21,7 +24,7 @@
2124
title="<?php echo __('Notifications'); ?>"
2225
data-toggle="dropdown">
2326
<span class="notifications-counter">
24-
<?php echo ($block->escapeHtml($notificationCount) > 99) ? '99+' : $block->escapeHtml($notificationCount); ?>
27+
<?php echo ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount; ?>
2528
</span>
2629
</a>
2730
<ul
@@ -30,7 +33,7 @@
3033
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
3134
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?>
3235
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
33-
data-notification-id="<?php echo $block->escapeHtml($notification->getId()); ?>"
36+
data-notification-id="<?php echo $notification->getId(); ?>"
3437
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
3538
<?php
3639
$notificationDescription = $block->escapeHtml($notification->getDescription());
@@ -39,7 +42,7 @@
3942
<strong class="notifications-entry-title">
4043
<?php echo $block->escapeHtml($notification->getTitle()); ?>
4144
</strong>
42-
<?php if (strlen($notificationDescription) > $block->escapeHtml($notificationDescriptionLength)) : ?>
45+
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
4346
<p class="notifications-entry-description _cutted">
4447
<span class="notifications-entry-description-start">
4548
<?php echo substr($notificationDescription, 0, $notificationDescriptionLength); ?>
@@ -54,7 +57,7 @@
5457
</p>
5558
<?php endif; ?>
5659
<time class="notifications-entry-time">
57-
<?php echo $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())); ?>
60+
<?php echo $block->formatNotificationDate($notification->getDateAdded()); ?>
5861
</time>
5962
<button
6063
type="button"

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_footer.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,19 @@
6363
}
6464
&:before {
6565
&:extend(.abs-icon all);
66+
.transition(color);
6667
color: @primary__color;
6768
content: @icon-logo__content;
69+
display: block;
6870
font-size: 2.5rem;
6971
position: relative;
7072
top: -.2rem;
7173
}
74+
&:active {
75+
&:before {
76+
.scale();
77+
}
78+
}
7279
}
7380
}
7481

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/headings-group/_breadcrumbs.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// Page header -> Headings group -> Breadcrumbs
88
// _____________________________________________
99

10-
//
11-
1210
.page-title-breadcrumbs {
1311
font-size: @page-title-breadcrumb__font-size;
1412
min-height: @page-title-breadcrumbs__min-height;

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_actions-bar.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
//
66
// Main elements -> Actions bar
77
// _____________________________________________
8+
89
// ToDo UI: Consist old styles, should be changed with new design
10+
911
//
1012
// Components
1113
// ---------------------------------------------
14+
1215
@import 'actions_bar/_store-switcher';
1316

1417
//
@@ -23,10 +26,10 @@
2326

2427
.page-main-actions,
2528
.page-actions.fixed {
29+
.extend__clearfix();
2630
background: @page-main-actions__background-color;
2731
border-bottom: 1px solid @page-main-actions__border-color;
2832
border-top: 1px solid @page-main-actions__border-color;
29-
.extend__clearfix();
3033
padding: @page-main-actions__padding-side;
3134
}
3235

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/actions_bar/_store-switcher.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
// Main elements -> Actions bar -> Store Switcher
88
// _____________________________________________
9+
910
// ToDo UI: Consist old styles, should be changed with new design
1011

1112
.store-switcher {

app/design/adminhtml/Magento/backend/web/css/override.less

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,8 @@ option:empty {
945945
}
946946
.actions-split.active .dropdown-menu,
947947
.actions-split._active .dropdown-menu {
948-
visibility: visible;
949948
opacity: 1;
949+
visibility: visible;
950950
}
951951
.actions-split .action-toggle,
952952
.actions-split .action-default {
@@ -967,12 +967,12 @@ option:empty {
967967
}
968968
.actions-split .action-toggle {
969969
padding-right: 4rem;
970+
border-left-color: rgba(0, 0, 0, 0.2);
970971
bottom: 0;
971972
padding-left: 0;
972973
position: absolute;
973974
right: 0;
974975
top: 0;
975-
border-left-color: rgba(0, 0, 0, 0.2);
976976
}
977977
.actions-split .action-toggle._active:after,
978978
.actions-split .action-toggle.active:after {
@@ -1015,25 +1015,25 @@ option:empty {
10151015
width: 1px;
10161016
}
10171017
.actions-split .dropdown-menu {
1018+
background-color: #ffffff;
1019+
border: 1px solid #007bdb;
1020+
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
10181021
display: block;
1019-
visibility: hidden;
1020-
position: absolute;
1022+
left: 0;
10211023
list-style: none;
1022-
min-width: 0;
10231024
margin: 2px 0 0;
1025+
min-width: 0;
1026+
opacity: 0;
10241027
padding: 0;
1028+
position: absolute;
10251029
right: 0;
1026-
left: 0;
10271030
top: 100%;
1028-
border: 1px solid #007bdb;
1029-
background-color: #ffffff;
1030-
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
1031-
opacity: 0;
10321031
transition: opacity 0.15s ease;
1032+
visibility: hidden;
10331033
}
10341034
.actions-split .dropdown-menu > li {
1035-
padding: .6875em;
10361035
border: none;
1036+
padding: .6875em;
10371037
}
10381038
.actions-split .dropdown-menu > li:hover {
10391039
background-color: #e0f6fe;
@@ -2945,12 +2945,17 @@ fieldset[disabled] .admin__control-text + .ui-datepicker-trigger {
29452945
color: #fd6e23;
29462946
}
29472947
.copyright .link-copyright:before {
2948+
transition: color 0.1s linear;
29482949
color: #eb5202;
29492950
content: '\e606';
2951+
display: block;
29502952
font-size: 2.5rem;
29512953
position: relative;
29522954
top: -0.2rem;
29532955
}
2956+
.copyright .link-copyright:active:before {
2957+
transform: scale(0.9);
2958+
}
29542959
.footer-legal {
29552960
padding-top: 1rem;
29562961
text-align: right;

app/design/adminhtml/Magento/backend/web/css/source/_tooltip-temp.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
// Main elements -> Tooltip
88
// _____________________________________________
9+
910
// ToDo UI: Consist old styles, should be changed with new design
1011

1112
.tooltip {
@@ -20,7 +21,6 @@
2021
display: inline-block;
2122
vertical-align: middle;
2223
cursor: pointer;
23-
2424
&:before {
2525
content: "?";
2626
font-weight: 500;
@@ -42,7 +42,7 @@
4242
.visually-hidden();
4343
}
4444
}
45-
//TODO Tooltips
45+
// TODO Tooltips
4646
.tooltip-content {
4747
display: none;
4848
position: absolute;

app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-split.less

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
&.active,
2424
&._active {
2525
.dropdown-menu {
26-
visibility: visible;
2726
opacity: 1;
27+
visibility: visible;
2828
}
2929
}
3030
.action-toggle,
@@ -47,12 +47,12 @@
4747
@_triangle__height: .9rem;
4848
@_triangle__width: 1.2rem;
4949
);
50+
border-left-color: rgba(0, 0, 0, .2);
5051
bottom: 0;
5152
padding-left: 0;
5253
position: absolute;
5354
right: 0;
5455
top: 0;
55-
border-left-color: rgba(0,0,0,.2);
5656
&.action-secondary,
5757
&.secondary,
5858
&.action-primary,
@@ -66,24 +66,24 @@
6666
}
6767
}
6868
.dropdown-menu {
69+
background-color: @page-wrapper__background-color;
70+
border: 1px solid @button__hover__border-color;
71+
box-shadow: @component__box-shadow__base;
6972
display: block; // ToDo UI: Should be deleted with old styles
70-
visibility: hidden;
71-
position: absolute;
73+
left: 0;
7274
list-style: none;
73-
min-width: 0; // ToDo UI: Should be deleted with old styles
7475
margin: 2px 0 0; // Action box-shadow + 1px indent
76+
min-width: 0; // ToDo UI: Should be deleted with old styles
77+
opacity: 0;
7578
padding: 0;
79+
position: absolute;
7680
right: 0;
77-
left: 0;
7881
top: 100%;
79-
border: 1px solid @button__hover__border-color;
80-
background-color: @page-wrapper__background-color;
81-
box-shadow: @component__box-shadow__base;
82-
opacity: 0;
8382
transition: opacity @appering__transition-duration @apperaing__transition-timing-function;
83+
visibility: hidden;
8484
> li {
85+
border: none; // ToDo UI: Should be deleted with old styles
8586
padding: .6875em;
86-
border: none; // ToDo UI: Should be deleted with old styles
8787
&:hover {
8888
background-color: @dropdown-menu__hover__background-color;
8989
}

0 commit comments

Comments
 (0)