Skip to content

Commit b7cc65a

Browse files
committed
Merge pull request #89 from magento-webdev/develop
[UI] Sprint 31
2 parents b32bd91 + d8f1163 commit b7cc65a

File tree

149 files changed

+6395
-7845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+6395
-7845
lines changed

Gruntfile.js

+21-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ module.exports = function (grunt) {
99

1010
// Required plugins
1111
// _____________________________________________
12-
var specRunner = require('./dev/tests/js/framework/spec_runner')(grunt);
12+
13+
var specRunner = require('./dev/tests/js/framework/spec_runner')(grunt),
14+
svgo = require('imagemin-svgo');
1315

1416
require('./dev/tools/grunt/tasks/mage-minify')(grunt);
1517

@@ -21,8 +23,6 @@ module.exports = function (grunt) {
2123
pattern: ['grunt-*', '!grunt-template-jasmine-requirejs']
2224
});
2325

24-
var svgo = require('imagemin-svgo');
25-
2626
// Configuration
2727
// _____________________________________________
2828

@@ -318,7 +318,8 @@ module.exports = function (grunt) {
318318

319319
cssmin: {
320320
options: {
321-
report: 'gzip'
321+
report: 'gzip',
322+
keepSpecialComments: 0
322323
},
323324
setup: {
324325
files: {
@@ -342,6 +343,20 @@ module.exports = function (grunt) {
342343
}
343344
},
344345

346+
// Concatenation
347+
// ---------------------------------------------
348+
349+
concat: {
350+
options: {
351+
stripBanners: true,
352+
banner: '/**\n * Copyright © <%= grunt.template.today("yyyy") %> Magento. All rights reserved.\n * See COPYING.txt for license details.\n */\n'
353+
},
354+
setup: {
355+
src: '<%= path.css.setup %>/setup.css',
356+
dest: '<%= path.css.setup %>/setup.css'
357+
}
358+
},
359+
345360

346361
// Watches files for changes and runs tasks based on the changed files
347362
// ---------------------------------------------
@@ -545,7 +560,8 @@ module.exports = function (grunt) {
545560
grunt.task.run([
546561
'less:' + component,
547562
'autoprefixer:' + component,
548-
'cssmin:' + component
563+
'cssmin:' + component,
564+
'concat:' + component
549565
]);
550566
}
551567
if (component == undefined) {

app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ protected function _prepareColumns()
110110
'items',
111111
[
112112
'header' => __('Items'),
113-
'align' => 'right',
114113
'type' => 'number',
115114
'sortable' => false,
116115
'index' => 'items_count'
@@ -122,8 +121,7 @@ protected function _prepareColumns()
122121
$this->addColumn(
123122
'total',
124123
[
125-
'header' => __('Grand Total'),
126-
'align' => 'right',
124+
'header' => __('Total'),
127125
'sortable' => false,
128126
'type' => 'currency',
129127
'currency_code' => $baseCurrencyCode,

app/code/Magento/Backend/Block/Dashboard/Sales.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ protected function _prepareLayout()
7171
$sales = $collection->getFirstItem();
7272

7373
$this->addTotal(__('Lifetime Sales'), $sales->getLifetime());
74-
$this->addTotal(__('Average Orders'), $sales->getAverage());
74+
$this->addTotal(__('Average Order'), $sales->getAverage());
7575
}
7676
}

app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,25 @@ protected function _prepareColumns()
9191
'orders_avg_amount',
9292
[
9393
'header' => __('Average'),
94-
'align' => 'right',
9594
'sortable' => false,
9695
'type' => 'currency',
9796
'currency_code' => $baseCurrencyCode,
98-
'index' => 'orders_avg_amount'
97+
'index' => 'orders_avg_amount',
98+
'header_css_class' => 'col-avg',
99+
'column_css_class' => 'col-avg'
99100
]
100101
);
101102

102103
$this->addColumn(
103104
'orders_sum_amount',
104105
[
105106
'header' => __('Total'),
106-
'align' => 'right',
107107
'sortable' => false,
108108
'type' => 'currency',
109109
'currency_code' => $baseCurrencyCode,
110-
'index' => 'orders_sum_amount'
110+
'index' => 'orders_sum_amount',
111+
'header_css_class' => 'col-total',
112+
'column_css_class' => 'col-total'
111113
]
112114
);
113115

app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,27 @@ protected function _prepareColumns()
8989
'orders_avg_amount',
9090
[
9191
'header' => __('Average'),
92-
'align' => 'right',
9392
'sortable' => false,
9493
'type' => 'currency',
9594
'currency_code' => $baseCurrencyCode,
9695
'index' => 'orders_avg_amount',
97-
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency'
96+
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency',
97+
'header_css_class' => 'col-avg',
98+
'column_css_class' => 'col-avg'
9899
]
99100
);
100101

101102
$this->addColumn(
102103
'orders_sum_amount',
103104
[
104105
'header' => __('Total'),
105-
'align' => 'right',
106106
'sortable' => false,
107107
'type' => 'currency',
108108
'currency_code' => $baseCurrencyCode,
109109
'index' => 'orders_sum_amount',
110-
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency'
110+
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency',
111+
'header_css_class' => 'col-total',
112+
'column_css_class' => 'col-total'
111113
]
112114
);
113115

app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php

+13-6
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,20 @@ protected function _prepareCollection()
8585
*/
8686
protected function _prepareColumns()
8787
{
88-
$this->addColumn('name', ['header' => __('Product'), 'sortable' => false, 'index' => 'product_name']);
88+
$this->addColumn(
89+
'name', [
90+
'header' => __('Product'),
91+
'sortable' => false,
92+
'index' => 'product_name',
93+
'header_css_class' => 'col-product',
94+
'column_css_class' => 'col-product'
95+
]
96+
);
8997

9098
$this->addColumn(
9199
'price',
92100
[
93101
'header' => __('Price'),
94-
'width' => '120px',
95102
'type' => 'currency',
96103
'currency_code' => (string)$this->_storeManager->getStore(
97104
(int)$this->getParam('store')
@@ -104,12 +111,12 @@ protected function _prepareColumns()
104111
$this->addColumn(
105112
'ordered_qty',
106113
[
107-
'header' => __('Order Quantity'),
108-
'width' => '120px',
109-
'align' => 'right',
114+
'header' => __('Quantity'),
110115
'sortable' => false,
111116
'index' => 'qty_ordered',
112-
'type' => 'number'
117+
'type' => 'number',
118+
'header_css_class' => 'col-qty',
119+
'column_css_class' => 'col-qty'
113120
]
114121
);
115122

app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ protected function _prepareColumns()
8181
'price',
8282
[
8383
'header' => __('Price'),
84-
'width' => '120px',
8584
'type' => 'currency',
8685
'currency_code' => (string)$this->_storeManager->getStore(
8786
(int)$this->getParam('store')
@@ -95,10 +94,10 @@ protected function _prepareColumns()
9594
'views',
9695
[
9796
'header' => __('Views'),
98-
'width' => '120px',
99-
'align' => 'right',
10097
'sortable' => false,
101-
'index' => 'views'
98+
'index' => 'views',
99+
'header_css_class' => 'col-views',
100+
'column_css_class' => 'col-views'
102101
]
103102
);
104103

app/code/Magento/Backend/view/adminhtml/templates/dashboard/graph.phtml

+15-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@
99
?>
1010
<div class="dashboard-diagram">
1111
<div class="dashboard-diagram-switcher">
12-
<label for="order_<?php echo $block->getHtmlId() ?>_period"><?php echo __('Select Range:') ?></label>
13-
<select name="period" id="order_<?php echo $block->getHtmlId() ?>_period" onchange="changeDiagramsPeriod(this);">
14-
<?php foreach ($this->helper('Magento\Backend\Helper\Dashboard\Data')->getDatePeriods() as $value => $label): ?>
15-
<?php if (in_array($value, ['custom'])) {
16-
continue;
17-
} ?>
18-
<option value="<?php echo $value ?>" <?php if ($block->getRequest()->getParam('period') == $value): ?> selected="selected"<?php endif; ?>><?php echo $label ?></option>
19-
<?php endforeach; ?>
20-
</select>
12+
<label for="order_<?php echo $block->getHtmlId() ?>_period" class="label"><?php echo __('Select Range:') ?></label>
13+
<div class="form-select-label">
14+
<select name="period" id="order_<?php echo $block->getHtmlId() ?>_period"
15+
onchange="changeDiagramsPeriod(this);" class="form-el-select">
16+
<?php foreach ($this->helper('Magento\Backend\Helper\Dashboard\Data')->getDatePeriods() as $value => $label): ?>
17+
<?php if (in_array($value, ['custom'])) {
18+
continue;
19+
} ?>
20+
<option
21+
value="<?php echo $value ?>"
22+
<?php if ($block->getRequest()->getParam('period') == $value): ?> selected="selected"<?php endif; ?>
23+
><?php echo $label ?></option>
24+
<?php endforeach; ?>
25+
</select>
26+
</div>
2127
</div>
2228
<?php if ($block->getCount()): ?>
2329
<div class="dashboard-diagram-image">

app/code/Magento/Backend/view/adminhtml/templates/dashboard/graph/disabled.phtml

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<div class="box" style="margin:20px;">
8-
<p class="a-center">
9-
<?php echo __('Chart is disabled. To enable the chart, click <a href="%1">here</a>.', $block->getConfigUrl())?>
10-
</p>
7+
<div class="dashboard-diagram-disabled">
8+
<?php echo __('Chart is disabled. To enable the chart, click <a href="%1">here</a>.', $block->getConfigUrl())?>
119
</div>

app/code/Magento/Backend/view/adminhtml/templates/dashboard/grid.phtml

+31-31
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,40 @@
1212
$numColumns = sizeof($block->getColumns());
1313
?>
1414
<?php if ($block->getCollection()): ?>
15-
<div class="dashboard-data-wrapper">
16-
<table class="dashboard-data" id="<?php echo $block->getId() ?>_table">
17-
<?php
18-
/* This part is commented to remove all <col> tags from the code. */
19-
/* foreach ($block->getColumns() as $_column): ?>
20-
<col <?php echo $_column->getHtmlProperty() ?> />
21-
<?php endforeach; */ ?>
22-
<?php if ($block->getHeadersVisibility() || $block->getFilterVisibility()): ?>
23-
<thead>
15+
<div class="dashboard-item-content">
16+
<?php if ($block->getCollection()->getSize()>0): ?>
17+
<table class="dashboard-data" id="<?php echo $block->getId() ?>_table">
18+
<?php
19+
/* This part is commented to remove all <col> tags from the code. */
20+
/* foreach ($block->getColumns() as $_column): ?>
21+
<col <?php echo $_column->getHtmlProperty() ?> />
22+
<?php endforeach; */ ?>
23+
<?php if ($block->getHeadersVisibility() || $block->getFilterVisibility()): ?>
24+
<thead>
2425
<?php if ($block->getHeadersVisibility()): ?>
25-
<tr class="headings">
26-
<?php foreach ($block->getColumns() as $_column): ?>
27-
<th <?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getHeaderHtml() ?></th>
28-
<?php endforeach; ?>
26+
<tr>
27+
<?php foreach ($block->getColumns() as $_column): ?>
28+
<th <?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getHeaderHtml() ?></th>
29+
<?php endforeach; ?>
2930
</tr>
3031
<?php endif; ?>
31-
</thead>
32-
<?php endif; ?>
33-
<tbody>
34-
<?php if (($block->getCollection()->getSize()>0) && (!$block->getIsCollapsed())): ?>
35-
<?php foreach ($block->getCollection() as $_index => $_item): ?>
36-
<tr title="<?php echo $block->getRowUrl($_item) ?>">
37-
<?php $i = 0; foreach ($block->getColumns() as $_column): ?>
38-
<td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"><?php echo(($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?></td>
39-
<?php endforeach; ?>
40-
</tr>
41-
<?php endforeach; ?>
42-
<?php elseif ($block->getEmptyText()): ?>
43-
<tr>
44-
<td class="<?php echo $block->getEmptyTextClass() ?>" colspan="100"><?php echo $block->getEmptyText() ?></td>
45-
</tr>
46-
<?php endif; ?>
47-
</tbody>
48-
</table>
32+
</thead>
33+
<?php endif; ?>
34+
<?php if (!$block->getIsCollapsed()): ?>
35+
<tbody>
36+
<?php foreach ($block->getCollection() as $_index => $_item): ?>
37+
<tr title="<?php echo $block->getRowUrl($_item) ?>">
38+
<?php $i = 0; foreach ($block->getColumns() as $_column): ?>
39+
<td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"><?php echo(($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?></td>
40+
<?php endforeach; ?>
41+
</tr>
42+
<?php endforeach; ?>
43+
</tbody>
44+
<?php endif; ?>
45+
</table>
46+
<?php else: ?>
47+
<div class="<?php echo $block->getEmptyTextClass() ?>"><?php echo $block->getEmptyText() ?></div>
48+
<?php endif; ?>
4949
</div>
5050
<?php if ($block->canDisplayContainer()): ?>
5151
<script>

app/code/Magento/Backend/view/adminhtml/templates/dashboard/index.phtml

+31-39
Original file line numberDiff line numberDiff line change
@@ -68,42 +68,34 @@ window.changeDiagramsPeriod = function(periodObj) {
6868
});
6969
</script>
7070
<?php endif; ?>
71-
<div class="dashboard-container">
72-
<div class="dashboard-inner">
73-
<div class="dashboard-main">
74-
<div class="dashboard-diagram-container">
75-
<?php echo $block->getChildHtml('diagrams') ?>
76-
<?php if (is_array($block->getChildBlock('diagrams')->getTabsIds())) : ?>
77-
<div id="diagram_tab_content" class="dashboard-diagram-tab-content"></div>
78-
<?php endif; ?>
79-
</div>
80-
<?php echo $block->getChildHtml('totals') ?>
81-
<div class="dashboard-store-stats">
82-
<?php echo $block->getChildHtml('grids') ?>
83-
<div id="grid_tab_content" class="dashboard-store-stats-content"></div>
84-
<?php echo $block->getChildHtml('refresh_statistics') ?>
85-
</div>
86-
</div>
87-
<div class="dashboard-secondary">
88-
<?php echo $block->getChildHtml('sales') ?>
89-
<div class="dashboard-item">
90-
<header class="dashboard-item-header">
91-
<h3 class="title"><?php echo __('Last 5 Orders') ?></h3>
92-
</header>
93-
<?php echo $block->getChildHtml('lastOrders'); ?>
94-
</div>
95-
<div class="dashboard-item">
96-
<header class="dashboard-item-header">
97-
<h3 class="title"><?php echo __('Last 5 Search Terms') ?></h3>
98-
</header>
99-
<?php echo $block->getChildHtml('lastSearches'); ?>
100-
</div>
101-
<div class="dashboard-item">
102-
<header class="dashboard-item-header">
103-
<h3 class="title"><?php echo __('Top 5 Search Terms') ?></h3>
104-
</header>
105-
<?php echo $block->getChildHtml('topSearches'); ?>
106-
</div>
107-
</div>
108-
</div>
109-
</div>
71+
<div class="dashboard-container row">
72+
<div class="dashboard-main col-m-8 col-m-push-4">
73+
<div class="dashboard-diagram-container">
74+
<?php echo $block->getChildHtml('diagrams') ?>
75+
<?php if (is_array($block->getChildBlock('diagrams')->getTabsIds())) : ?>
76+
<div id="diagram_tab_content" class="dashboard-diagram-tab-content"></div>
77+
<?php endif; ?>
78+
</div>
79+
<?php echo $block->getChildHtml('totals') ?>
80+
<div class="dashboard-store-stats">
81+
<?php echo $block->getChildHtml('grids') ?>
82+
<div id="grid_tab_content" class="dashboard-store-stats-content"></div>
83+
<?php echo $block->getChildHtml('refresh_statistics') ?>
84+
</div>
85+
</div>
86+
<div class="dashboard-secondary col-m-4 col-m-pull-8">
87+
<?php echo $block->getChildHtml('sales') ?>
88+
<div class="dashboard-item">
89+
<div class="dashboard-item-title"><?php echo __('Last Orders') ?></div>
90+
<?php echo $block->getChildHtml('lastOrders'); ?>
91+
</div>
92+
<div class="dashboard-item">
93+
<div class="dashboard-item-title"><?php echo __('Last Search Terms') ?></div>
94+
<?php echo $block->getChildHtml('lastSearches'); ?>
95+
</div>
96+
<div class="dashboard-item">
97+
<div class="dashboard-item-title"><?php echo __('Top Search Terms') ?></div>
98+
<?php echo $block->getChildHtml('topSearches'); ?>
99+
</div>
100+
</div>
101+
</div>

0 commit comments

Comments
 (0)