Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav Onischenko committed Nov 30, 2015
2 parents fcd0783 + 044de2d commit 21cd1b4
Show file tree
Hide file tree
Showing 27 changed files with 1,170 additions and 783 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<?php
/* @var $block \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element */
$element = $block->getElement();
$note = $element->getNote() ? '<div class="note" id="' . $element->getId() . '-note">' . $element->getNote() . '</div>' : '';
$note = $element->getNote() ? '<div class="note admin__field-note" id="' . $element->getId() . '-note">' . $element->getNote() . '</div>' : '';
$elementBeforeLabel = $element->getExtType() == 'checkbox admin__control-checkbox' || $element->getExtType() == 'radio admin__control-radio';
$addOn = ($element->getBeforeElementHtml() || $element->getAfterElementHtml()) && !$element->getNoWrapAsAddon();
$fieldId = ($element->getHtmlContainerId()) ? ' id="' . $element->getHtmlContainerId() . '"' : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
<div class="mass-select-wrap">
<select
id="<?php echo $block->getHtmlId() ?>-mass-select"
class="action-select-multiselect"
class="action-select-multiselect _disabled"
disabled="disabled"
data-menu="grid-mass-select">
<optgroup label="<?php /* @escapeNotVerified */ echo __('Mass Actions')?>">
<option disabled selected></option>
Expand All @@ -68,10 +69,14 @@
</div>

<script>
require(['jquery'], function($){
require(['jquery', 'domReady!'], function($){
'use strict';
$('#<?php echo $block->getHtmlId() ?>-mass-select').change(function () {
$('#<?php echo $block->getHtmlId() ?>-mass-select')
.removeClass('_disabled')
.prop('disabled', false)
.change(function () {
var massAction = $('option:selected', this).val();
this.blur();
switch (massAction) {
<?php if ($block->getUseSelectAll()):?>
case 'selectAll':
Expand All @@ -88,7 +93,6 @@
return <?php /* @escapeNotVerified */ echo $block->getJsObjectName() ?>.unselectVisible();
break;
}
this.blur();
});
});
<?php if (!$block->getParentBlock()->canDisplayContainer()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
); ?>
</p>
<h3 class="page-sub-sub-title"><?php /* @escapeNotVerified */ echo __('Featured Platinum Partners'); ?></h3>
<div data-role="partners-block">
<div data-role="partners-block" class="partners-block">
<div data-role="spinner" class="admin__data-grid-loading-mask" data-bind="visible: loading">
<div class="spinner">
<span></span><span></span><span></span><span></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,26 @@
$partners = $block->getPartners();
?>
<?php if ($partners) : ?>
<div class="row row-gutter">
<?php foreach ($block->getPartners() as $partner) : ?>
<div class="col-m-4">
<img
class="partner-image"
src="<?php echo $block->escapeHtml($partner['img']);?>"
alt="<?php echo $block->escapeHtml($partner['title']);?>"/>
<h3 class="partner-title"><?php echo $block->escapeHtml($partner['title']);?></h3>
<p class="partner-description">
<?php echo $block->escapeHtml($partner['description']);?>
<br />
<a href="<?php echo $block->escapeHtml($partner['url_page']);?>" target="_blank">
<?php /* @escapeNotVerified */ echo __('Read More'); ?>
</a>
<br />
<a href="<?php echo $block->escapeHtml($partner['url_partner_page']);?>" target="_blank">
<?php /* @escapeNotVerified */ echo __('Partner Page'); ?>
</a>
</p>
</div>
<?php endforeach; ?>
</div>
<?php foreach ($block->getPartners() as $partner) : ?>
<div class="partner">
<img
class="partner-image"
src="<?php echo $block->escapeHtml($partner['img']);?>"
alt="<?php echo $block->escapeHtml($partner['title']);?>"/>
<h3 class="partner-title"><?php echo $block->escapeHtml($partner['title']);?></h3>
<p class="partner-description">
<?php echo $block->escapeHtml($partner['description']);?>
<br />
<a href="<?php echo $block->escapeHtml($partner['url_page']);?>" target="_blank">
<?php /* @escapeNotVerified */ echo __('Read More'); ?>
</a>
<br />
<a href="<?php echo $block->escapeHtml($partner['url_partner_page']);?>" target="_blank">
<?php /* @escapeNotVerified */ echo __('Partner Page'); ?>
</a>
</p>
</div>
<?php endforeach; ?>
<?php else : ?>
<p>
<?php /* @escapeNotVerified */ echo __('No partners were found'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ protected function _prepareForm()
$fieldset->addField(
'order_statuses',
'multiselect',
['name' => 'order_statuses', 'values' => $values, 'display' => 'none'],
[
'name' => 'order_statuses',
'label' => '',
'values' => $values,
'display' => 'none'
],
'show_order_statuses'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ protected function _prepareForm()
$fieldset->addField(
'rules_list',
'multiselect',
['name' => 'rules_list', 'values' => $rulesListOptions, 'display' => 'none'],
[
'name' => 'rules_list',
'label' => '',
'values' => $rulesListOptions,
'display' => 'none'
],
'price_rule_type'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,25 @@ class Text extends AbstractSwatch
* @var string
*/
protected $_template = 'Magento_Swatches::catalog/product/attribute/text.phtml';

/**
* Return json config for text option JS initialization
*
* @return array
*/
public function getJsonConfig()
{
$values = [];
foreach ($this->getOptionValues() as $value) {
$values[] = $value->getData();
}

$data = [
'attributesData' => $values,
'isSortable' => (int)(!$this->getReadOnly() && !$this->canManageOptionDefaultOnly()),
'isReadOnly' => (int)$this->getReadOnly()
];

return json_encode($data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ protected function createStoreValues($storeId, $optionId)
return $value;
}

/**
* Return json config for visual option JS initialization
*
* @return array
*/
public function getJsonConfig()
{
$values = [];
foreach ($this->getOptionValues() as $value) {
$values[] = $value->getData();
}

$data = [
'attributesData' => $values,
'uploadActionUrl' => $this->getUrl('swatches/iframe/show'),
'isSortable' => (int)(!$this->getReadOnly() && !$this->canManageOptionDefaultOnly()),
'isReadOnly' => (int)$this->getReadOnly()
];

return json_encode($data);
}

/**
* Parse swatch labels for template
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<css src="Magento_Swatches::css/swatches.css"/>
<css src="jquery/colorpicker/css/colorpicker.css"/>
<link src="jquery/colorpicker/js/colorpicker.js"/>
<link src="Magento_Swatches::js/TypeChanger.js"/>
</head>
<body>
<referenceContainer name="main">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<css src="Magento_Swatches::css/swatches.css"/>
<css src="jquery/colorpicker/css/colorpicker.css"/>
<link src="jquery/colorpicker/js/colorpicker.js"/>
<link src="Magento_Swatches::js/TypeChanger.js"/>
</head>
<body>
<referenceContainer name="form">
Expand Down
13 changes: 13 additions & 0 deletions app/code/Magento/Swatches/view/adminhtml/requirejs-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

var config = {
map: {
'*': {
swatchesProductAttributes: 'Magento_Swatches/js/product-attributes',
swatchesTypeChange: 'Magento_Swatches/js/type-change'
}
}
};
Loading

0 comments on commit 21cd1b4

Please sign in to comment.