Skip to content

Commit c852b8e

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

File tree

13 files changed

+521
-141
lines changed

13 files changed

+521
-141
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div
1313
data-mage-init='{"toolbarEntry": {}}'
1414
class="notifications-wrapper"
15-
data-notification-count="<?php echo $block->escapeHtml($notificationCount); ?>">
15+
data-notification-count="<?php echo $notificationCount; ?>">
1616
<?php if ($notificationCount > 0) : ?>
1717
<a
1818
href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>"
@@ -21,11 +21,7 @@
2121
title="<?php echo __('Notifications'); ?>"
2222
data-toggle="dropdown">
2323
<span class="notifications-counter">
24-
<?php if ($block->escapeHtml($notificationCount) > 99) {
25-
echo '99+';
26-
} else {
27-
echo $block->escapeHtml($notificationCount);
28-
}?>
24+
<?php echo ($block->escapeHtml($notificationCount) > 99) ? '99+' : $block->escapeHtml($notificationCount); ?>
2925
</span>
3026
</a>
3127
<ul
@@ -36,21 +32,25 @@
3632
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
3733
data-notification-id="<?php echo $block->escapeHtml($notification->getId()); ?>"
3834
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
35+
<?php
36+
$notificationDescription = $block->escapeHtml($notification->getDescription());
37+
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
38+
?>
3939
<strong class="notifications-entry-title">
4040
<?php echo $block->escapeHtml($notification->getTitle()); ?>
4141
</strong>
42-
<?php if (strlen($block->escapeHtml($notification->getDescription())) > $block->escapeHtml($block->getNotificationDescriptionLength())) : ?>
42+
<?php if (strlen($notificationDescription) > $block->escapeHtml($notificationDescriptionLength)) : ?>
4343
<p class="notifications-entry-description _cutted">
4444
<span class="notifications-entry-description-start">
45-
<?php echo substr($block->escapeHtml($notification->getDescription()), 0, $block->escapeHtml($block->getNotificationDescriptionLength())); ?>
45+
<?php echo substr($notificationDescription, 0, $notificationDescriptionLength); ?>
4646
</span>
4747
<span class="notifications-entry-description-end">
48-
<?php echo substr($block->escapeHtml($notification->getDescription()), $block->escapeHtml($block->getNotificationDescriptionLength())); ?>
48+
<?php echo substr($notificationDescription, $notificationDescriptionLength); ?>
4949
</span>
5050
</p>
5151
<?php else : ?>
5252
<p class="notifications-entry-description">
53-
<?php echo $block->escapeHtml($notification->getDescription()); ?>
53+
<?php echo $notificationDescription; ?>
5454
</p>
5555
<?php endif; ?>
5656
<time class="notifications-entry-time">

app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
<?php case 'user': ?>
1919
<div class="admin-user">
2020
<a href="<?php echo $block->getUrl('adminhtml/system_account/index') ?>" class="admin-user-account" title="<?php echo __('My Account') ?>" data-mage-init='{"dropdown":{}}' data-toggle="dropdown">
21-
<span class="admin-user-account-text"><?php echo $block->escapeHtml($block->getUser()->getUsername()); ?></span>
21+
<span class="admin-user-account-text-wrapper">
22+
<span class="admin-user-account-text"><?php echo $block->escapeHtml($block->getUser()->getUsername()); ?></span>
23+
</span>
2224
</a>
2325
<ul class="admin-user-menu">
2426
<?php if ($block->getAuthorization()->isAllowed('Magento_Backend::myaccount')): ?>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
.notifications-wrapper {
3535
float: right;
3636
line-height: 1;
37-
margin-left: @component__shadow-size__base;
3837
position: relative;
39-
z-index: @notifications-action-menu__z-index;
4038
&.active {
39+
z-index: @notifications-action-menu__z-index; // Should be over global search when active
4140
.notifications-action {
4241
border-color: @page-header-action__active__border-color;
4342
box-shadow: @component__box-shadow__base;

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
.search-global {
3434
float: right;
35+
margin-right: -.3rem; // px perfect
3536
position: relative;
3637
z-index: @search-global__z-index;
3738
}
@@ -40,6 +41,7 @@
4041
min-width: @search-global-field__width;
4142
&._active {
4243
.search-global-input {
44+
background-color: @page-header-action__background-color;
4345
border-color: @page-header-action__active__border-color;
4446
box-shadow: @component__box-shadow__base;
4547
padding-right: @search-global-input__active__padding-right;
@@ -51,8 +53,8 @@
5153
height: @search-global-input__height;
5254
position: absolute;
5355
right: 0;
54-
top: 0;
5556
text-indent: -100%;
57+
top: 0;
5658
width: @search-global-icon__width + @search-global-input__padding-side * 2;
5759
z-index: 3;
5860
}
@@ -127,7 +129,7 @@
127129
}
128130

129131
.search-global-input {
130-
background-color: @page-header-action__background-color;
132+
background-color: transparent;
131133
border: 1px solid transparent;
132134
font-size: @search-global-input__font-size;
133135
height: @search-global-input__height;
@@ -137,7 +139,7 @@
137139
top: 0;
138140
transition: all .1s linear, width .3s linear;
139141
width: @search-global-input__width;
140-
z-index: 1
142+
z-index: 1;
141143
}
142144

143145
.search-global-action {

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,26 @@
1212
// ---------------------------------------------
1313

1414
@user__font-size: round(@font-size__base - .1rem, 1);
15-
@user-account__indent-right: 2.8rem;
1615
@user-account__padding-bottom: (@page-header-action__height - @user__font-size) / 2 - .05rem;
16+
@user-account__padding-left: 4rem;
1717
@user-account__padding-top: (@page-header-action__height - @user__font-size) / 2 + .05rem;
18+
@user-account__padding-right: 2.8rem;
19+
@user-menu__min-width: 20rem;
1820

1921
//
2022

2123
.admin-user {
2224
float: right;
2325
line-height: 1;
24-
margin-left: @component__shadow-size__base;
26+
margin-left: .3rem;
2527
position: relative;
2628
z-index: @user-account-menu__z-index;
2729
&.active {
2830
.admin-user-account {
2931
border-color: @page-header-action__active__border-color;
3032
box-shadow: @component__box-shadow__base;
3133
}
32-
.admin-user-account-text {
34+
.admin-user-account-text-wrapper {
3335
&:after {
3436
background-color: @page-header-action__background-color;
3537
content: '';
@@ -50,20 +52,20 @@
5052
.admin-user-account {
5153
&:extend(.abs-page-header-action all);
5254
.dropdown-triangle(
53-
@_dropdown__padding-right: @user-account__indent-right;
54-
@_triangle__color: @page-header-action__color;
55-
@_triangle__hover__color: @page-header-action__hover__color;
56-
@_triangle__right: 1.3rem;
55+
@_dropdown__padding-right: @user-account__padding-right;
56+
@_triangle__color: @page-header-action__color;
57+
@_triangle__hover__color: @page-header-action__hover__color;
58+
@_triangle__right: 1.3rem;
5759
);
5860
font-size: @user__font-size;
5961
letter-spacing: .05em;
6062
padding-bottom: @user-account__padding-bottom;
61-
padding-left: 4rem;
63+
padding-left: @user-account__padding-left;
6264
padding-top: @user-account__padding-top;
6365
z-index: 2;
6466
&:before {
6567
@_icon-user__size: 2rem;
66-
68+
6769
&:extend(.abs-icon all);
6870
content: @icon-account__content;
6971
font-size: @_icon-user__size;
@@ -74,11 +76,19 @@
7476
}
7577
}
7678

79+
.admin-user-account-text {
80+
display: inline-block;
81+
max-width: @user-menu__min-width - @user-account__padding-left - @user-account__padding-right - 2rem;
82+
overflow: hidden;
83+
text-overflow: ellipsis;
84+
}
85+
7786
.admin-user-menu {
7887
@_user-menu__inden-side: 1rem;
79-
88+
8089
&:extend(.abs-page-header-action-menu all);
8190
line-height: @line-height__base;
91+
min-width: @user-menu__min-width;
8292
padding: .5em @_user-menu__inden-side;
8393
z-index: 1;
8494
&:before {
@@ -88,7 +98,7 @@
8898
> a {
8999
color: @page-header-action__color;
90100
display: block;
91-
padding: .6rem (@user-account__indent-right - @_user-menu__inden-side) .6rem .5em;
101+
padding: .6rem (@user-account__padding-right - @_user-menu__inden-side) .6rem .5em;
92102
text-decoration: none;
93103
transition: background-color .1s linear;
94104
white-space: nowrap;

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
.page-main-actions,
2525
.page-actions.fixed {
26-
.extend__clearfix();
2726
background: @page-main-actions__background-color;
2827
border-bottom: 1px solid @page-main-actions__border-color;
2928
border-top: 1px solid @page-main-actions__border-color;
29+
.extend__clearfix();
3030
padding: @page-main-actions__padding-side;
3131
}
3232

@@ -40,22 +40,21 @@
4040

4141
.page-actions {
4242
@_page-action__indent: 1.3rem;
43-
4443
float: right;
4544
&.fixed {
46-
position: fixed;
47-
top: 0;
4845
left: @page-wrapper__indent-left;
46+
position: fixed;
4947
right: 0;
48+
top: 0;
5049
z-index: @page-actions__fixed__z-index;
5150
.page-actions-inner {
5251
&:before {
52+
color: @page-title__color;
5353
content: attr(data-title);
5454
float: left;
5555
font-size: @page-title__font-size;
56-
max-width: 50%;
5756
margin-top: .3rem;
58-
color: @page-title__color;
57+
max-width: 50%;
5958
overflow: hidden;
6059
text-overflow: ellipsis;
6160
white-space: nowrap;
@@ -103,8 +102,8 @@
103102
}
104103
}
105104
.actions-split {
106-
margin-left: @_page-action__indent;
107105
float: right;
106+
margin-left: @_page-action__indent;
108107
.vendor-prefix-order(2);
109108
.dropdown-menu {
110109
.item {
@@ -115,9 +114,9 @@
115114
}
116115

117116
.page-actions-buttons {
118-
.vendor-prefix-display(flex);
119-
justify-content: flex-end;
120117
float: right;
118+
justify-content: flex-end;
119+
.vendor-prefix-display(flex);
121120
.customer-index-edit & {
122121
background-color: transparent;
123122
}

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
}
1919
.dropdown {
2020
.dropdown(
21-
@_options-selector : ~".dropdown-menu",
22-
@_dropdown-list-border: 1px #ada89e solid,
23-
@_dropdown-list-pointer: false,
24-
@_icon-font-line-height: 2,
25-
@_icon-font-color: @text__color,
26-
@_icon-font-color-hover: @text__color,
27-
@_icon-font-color-active: @text__color,
28-
@_dropdown-list-item-hover: transparent,
29-
@_dropdown-list-item-padding: 0,
30-
@_dropdown-list-min-width: 19.5rem,
31-
@_dropdown-list-shadow: @component__box-shadow__base
21+
@_options-selector: ~".dropdown-menu",
22+
@_dropdown-list-border: 1px #ada89e solid,
23+
@_dropdown-list-pointer: false,
24+
@_icon-font-line-height: 2,
25+
@_icon-font-color: @text__color,
26+
@_icon-font-color-hover: @text__color,
27+
@_icon-font-color-active: @text__color,
28+
@_dropdown-list-item-hover: transparent,
29+
@_dropdown-list-item-padding: 0,
30+
@_dropdown-list-min-width: 19.5rem,
31+
@_dropdown-list-shadow: @component__box-shadow__base
3232
);
3333
}
3434
.dropdown-menu {
@@ -225,8 +225,8 @@
225225
}
226226
}
227227
.tooltip-content {
228-
background: #000;
229228
background: rgba(49, 48, 43, .8);
229+
background: #000;
230230
border-radius: 3px;
231231
color: #fff;
232232
display: none;

0 commit comments

Comments
 (0)