Skip to content

Commit

Permalink
Merge pull request #89 from magento-webdev/develop
Browse files Browse the repository at this point in the history
[UI] Sprint 31
  • Loading branch information
vpelipenko committed Feb 12, 2015
2 parents b32bd91 + d8f1163 commit b7cc65a
Show file tree
Hide file tree
Showing 149 changed files with 6,395 additions and 7,845 deletions.
26 changes: 21 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ module.exports = function (grunt) {

// Required plugins
// _____________________________________________
var specRunner = require('./dev/tests/js/framework/spec_runner')(grunt);

var specRunner = require('./dev/tests/js/framework/spec_runner')(grunt),
svgo = require('imagemin-svgo');

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

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

var svgo = require('imagemin-svgo');

// Configuration
// _____________________________________________

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

cssmin: {
options: {
report: 'gzip'
report: 'gzip',
keepSpecialComments: 0
},
setup: {
files: {
Expand All @@ -342,6 +343,20 @@ module.exports = function (grunt) {
}
},

// Concatenation
// ---------------------------------------------

concat: {
options: {
stripBanners: true,
banner: '/**\n * Copyright © <%= grunt.template.today("yyyy") %> Magento. All rights reserved.\n * See COPYING.txt for license details.\n */\n'
},
setup: {
src: '<%= path.css.setup %>/setup.css',
dest: '<%= path.css.setup %>/setup.css'
}
},


// Watches files for changes and runs tasks based on the changed files
// ---------------------------------------------
Expand Down Expand Up @@ -545,7 +560,8 @@ module.exports = function (grunt) {
grunt.task.run([
'less:' + component,
'autoprefixer:' + component,
'cssmin:' + component
'cssmin:' + component,
'concat:' + component
]);
}
if (component == undefined) {
Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ protected function _prepareColumns()
'items',
[
'header' => __('Items'),
'align' => 'right',
'type' => 'number',
'sortable' => false,
'index' => 'items_count'
Expand All @@ -122,8 +121,7 @@ protected function _prepareColumns()
$this->addColumn(
'total',
[
'header' => __('Grand Total'),
'align' => 'right',
'header' => __('Total'),
'sortable' => false,
'type' => 'currency',
'currency_code' => $baseCurrencyCode,
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Block/Dashboard/Sales.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ protected function _prepareLayout()
$sales = $collection->getFirstItem();

$this->addTotal(__('Lifetime Sales'), $sales->getLifetime());
$this->addTotal(__('Average Orders'), $sales->getAverage());
$this->addTotal(__('Average Order'), $sales->getAverage());
}
}
10 changes: 6 additions & 4 deletions app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,25 @@ protected function _prepareColumns()
'orders_avg_amount',
[
'header' => __('Average'),
'align' => 'right',
'sortable' => false,
'type' => 'currency',
'currency_code' => $baseCurrencyCode,
'index' => 'orders_avg_amount'
'index' => 'orders_avg_amount',
'header_css_class' => 'col-avg',
'column_css_class' => 'col-avg'
]
);

$this->addColumn(
'orders_sum_amount',
[
'header' => __('Total'),
'align' => 'right',
'sortable' => false,
'type' => 'currency',
'currency_code' => $baseCurrencyCode,
'index' => 'orders_sum_amount'
'index' => 'orders_sum_amount',
'header_css_class' => 'col-total',
'column_css_class' => 'col-total'
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,27 @@ protected function _prepareColumns()
'orders_avg_amount',
[
'header' => __('Average'),
'align' => 'right',
'sortable' => false,
'type' => 'currency',
'currency_code' => $baseCurrencyCode,
'index' => 'orders_avg_amount',
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency'
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency',
'header_css_class' => 'col-avg',
'column_css_class' => 'col-avg'
]
);

$this->addColumn(
'orders_sum_amount',
[
'header' => __('Total'),
'align' => 'right',
'sortable' => false,
'type' => 'currency',
'currency_code' => $baseCurrencyCode,
'index' => 'orders_sum_amount',
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency'
'renderer' => 'Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency',
'header_css_class' => 'col-total',
'column_css_class' => 'col-total'
]
);

Expand Down
19 changes: 13 additions & 6 deletions app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,20 @@ protected function _prepareCollection()
*/
protected function _prepareColumns()
{
$this->addColumn('name', ['header' => __('Product'), 'sortable' => false, 'index' => 'product_name']);
$this->addColumn(
'name', [
'header' => __('Product'),
'sortable' => false,
'index' => 'product_name',
'header_css_class' => 'col-product',
'column_css_class' => 'col-product'
]
);

$this->addColumn(
'price',
[
'header' => __('Price'),
'width' => '120px',
'type' => 'currency',
'currency_code' => (string)$this->_storeManager->getStore(
(int)$this->getParam('store')
Expand All @@ -104,12 +111,12 @@ protected function _prepareColumns()
$this->addColumn(
'ordered_qty',
[
'header' => __('Order Quantity'),
'width' => '120px',
'align' => 'right',
'header' => __('Quantity'),
'sortable' => false,
'index' => 'qty_ordered',
'type' => 'number'
'type' => 'number',
'header_css_class' => 'col-qty',
'column_css_class' => 'col-qty'
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ protected function _prepareColumns()
'price',
[
'header' => __('Price'),
'width' => '120px',
'type' => 'currency',
'currency_code' => (string)$this->_storeManager->getStore(
(int)$this->getParam('store')
Expand All @@ -95,10 +94,10 @@ protected function _prepareColumns()
'views',
[
'header' => __('Views'),
'width' => '120px',
'align' => 'right',
'sortable' => false,
'index' => 'views'
'index' => 'views',
'header_css_class' => 'col-views',
'column_css_class' => 'col-views'
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
?>
<div class="dashboard-diagram">
<div class="dashboard-diagram-switcher">
<label for="order_<?php echo $block->getHtmlId() ?>_period"><?php echo __('Select Range:') ?></label>
<select name="period" id="order_<?php echo $block->getHtmlId() ?>_period" onchange="changeDiagramsPeriod(this);">
<?php foreach ($this->helper('Magento\Backend\Helper\Dashboard\Data')->getDatePeriods() as $value => $label): ?>
<?php if (in_array($value, ['custom'])) {
continue;
} ?>
<option value="<?php echo $value ?>" <?php if ($block->getRequest()->getParam('period') == $value): ?> selected="selected"<?php endif; ?>><?php echo $label ?></option>
<?php endforeach; ?>
</select>
<label for="order_<?php echo $block->getHtmlId() ?>_period" class="label"><?php echo __('Select Range:') ?></label>
<div class="form-select-label">
<select name="period" id="order_<?php echo $block->getHtmlId() ?>_period"
onchange="changeDiagramsPeriod(this);" class="form-el-select">
<?php foreach ($this->helper('Magento\Backend\Helper\Dashboard\Data')->getDatePeriods() as $value => $label): ?>
<?php if (in_array($value, ['custom'])) {
continue;
} ?>
<option
value="<?php echo $value ?>"
<?php if ($block->getRequest()->getParam('period') == $value): ?> selected="selected"<?php endif; ?>
><?php echo $label ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<?php if ($block->getCount()): ?>
<div class="dashboard-diagram-image">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/
?>
<div class="box" style="margin:20px;">
<p class="a-center">
<?php echo __('Chart is disabled. To enable the chart, click <a href="%1">here</a>.', $block->getConfigUrl())?>
</p>
<div class="dashboard-diagram-disabled">
<?php echo __('Chart is disabled. To enable the chart, click <a href="%1">here</a>.', $block->getConfigUrl())?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@
$numColumns = sizeof($block->getColumns());
?>
<?php if ($block->getCollection()): ?>
<div class="dashboard-data-wrapper">
<table class="dashboard-data" id="<?php echo $block->getId() ?>_table">
<?php
/* This part is commented to remove all <col> tags from the code. */
/* foreach ($block->getColumns() as $_column): ?>
<col <?php echo $_column->getHtmlProperty() ?> />
<?php endforeach; */ ?>
<?php if ($block->getHeadersVisibility() || $block->getFilterVisibility()): ?>
<thead>
<div class="dashboard-item-content">
<?php if ($block->getCollection()->getSize()>0): ?>
<table class="dashboard-data" id="<?php echo $block->getId() ?>_table">
<?php
/* This part is commented to remove all <col> tags from the code. */
/* foreach ($block->getColumns() as $_column): ?>
<col <?php echo $_column->getHtmlProperty() ?> />
<?php endforeach; */ ?>
<?php if ($block->getHeadersVisibility() || $block->getFilterVisibility()): ?>
<thead>
<?php if ($block->getHeadersVisibility()): ?>
<tr class="headings">
<?php foreach ($block->getColumns() as $_column): ?>
<th <?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getHeaderHtml() ?></th>
<?php endforeach; ?>
<tr>
<?php foreach ($block->getColumns() as $_column): ?>
<th <?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getHeaderHtml() ?></th>
<?php endforeach; ?>
</tr>
<?php endif; ?>
</thead>
<?php endif; ?>
<tbody>
<?php if (($block->getCollection()->getSize()>0) && (!$block->getIsCollapsed())): ?>
<?php foreach ($block->getCollection() as $_index => $_item): ?>
<tr title="<?php echo $block->getRowUrl($_item) ?>">
<?php $i = 0; foreach ($block->getColumns() as $_column): ?>
<td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"><?php echo(($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif ($block->getEmptyText()): ?>
<tr>
<td class="<?php echo $block->getEmptyTextClass() ?>" colspan="100"><?php echo $block->getEmptyText() ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</thead>
<?php endif; ?>
<?php if (!$block->getIsCollapsed()): ?>
<tbody>
<?php foreach ($block->getCollection() as $_index => $_item): ?>
<tr title="<?php echo $block->getRowUrl($_item) ?>">
<?php $i = 0; foreach ($block->getColumns() as $_column): ?>
<td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"><?php echo(($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<?php else: ?>
<div class="<?php echo $block->getEmptyTextClass() ?>"><?php echo $block->getEmptyText() ?></div>
<?php endif; ?>
</div>
<?php if ($block->canDisplayContainer()): ?>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,34 @@ window.changeDiagramsPeriod = function(periodObj) {
});
</script>
<?php endif; ?>
<div class="dashboard-container">
<div class="dashboard-inner">
<div class="dashboard-main">
<div class="dashboard-diagram-container">
<?php echo $block->getChildHtml('diagrams') ?>
<?php if (is_array($block->getChildBlock('diagrams')->getTabsIds())) : ?>
<div id="diagram_tab_content" class="dashboard-diagram-tab-content"></div>
<?php endif; ?>
</div>
<?php echo $block->getChildHtml('totals') ?>
<div class="dashboard-store-stats">
<?php echo $block->getChildHtml('grids') ?>
<div id="grid_tab_content" class="dashboard-store-stats-content"></div>
<?php echo $block->getChildHtml('refresh_statistics') ?>
</div>
</div>
<div class="dashboard-secondary">
<?php echo $block->getChildHtml('sales') ?>
<div class="dashboard-item">
<header class="dashboard-item-header">
<h3 class="title"><?php echo __('Last 5 Orders') ?></h3>
</header>
<?php echo $block->getChildHtml('lastOrders'); ?>
</div>
<div class="dashboard-item">
<header class="dashboard-item-header">
<h3 class="title"><?php echo __('Last 5 Search Terms') ?></h3>
</header>
<?php echo $block->getChildHtml('lastSearches'); ?>
</div>
<div class="dashboard-item">
<header class="dashboard-item-header">
<h3 class="title"><?php echo __('Top 5 Search Terms') ?></h3>
</header>
<?php echo $block->getChildHtml('topSearches'); ?>
</div>
</div>
</div>
</div>
<div class="dashboard-container row">
<div class="dashboard-main col-m-8 col-m-push-4">
<div class="dashboard-diagram-container">
<?php echo $block->getChildHtml('diagrams') ?>
<?php if (is_array($block->getChildBlock('diagrams')->getTabsIds())) : ?>
<div id="diagram_tab_content" class="dashboard-diagram-tab-content"></div>
<?php endif; ?>
</div>
<?php echo $block->getChildHtml('totals') ?>
<div class="dashboard-store-stats">
<?php echo $block->getChildHtml('grids') ?>
<div id="grid_tab_content" class="dashboard-store-stats-content"></div>
<?php echo $block->getChildHtml('refresh_statistics') ?>
</div>
</div>
<div class="dashboard-secondary col-m-4 col-m-pull-8">
<?php echo $block->getChildHtml('sales') ?>
<div class="dashboard-item">
<div class="dashboard-item-title"><?php echo __('Last Orders') ?></div>
<?php echo $block->getChildHtml('lastOrders'); ?>
</div>
<div class="dashboard-item">
<div class="dashboard-item-title"><?php echo __('Last Search Terms') ?></div>
<?php echo $block->getChildHtml('lastSearches'); ?>
</div>
<div class="dashboard-item">
<div class="dashboard-item-title"><?php echo __('Top Search Terms') ?></div>
<?php echo $block->getChildHtml('topSearches'); ?>
</div>
</div>
</div>
Loading

0 comments on commit b7cc65a

Please sign in to comment.