Commit 53284d1c by liumengfei

Merge branch 'developer' into production

parents 5ee6e614 bf3425b6
......@@ -3,68 +3,85 @@
$collection = $block->getCollection();
?>
<div class="banner1" style="background-color: #f0f0f0;"></div>
<?php
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); //instance of\Magento\Framework\App\ObjectManager
$storeManager = $_objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStore = $storeManager->getStore();
$mediaUrl = $currentStore -> getBaseUrl ( \Magento\Framework\UrlInterface :: URL_TYPE_MEDIA ) ;
?>
<?php foreach ($collection->getItems() as $item):?>
<?php echo $item->getData('name');?>
<?php endforeach;?>
$mobileDetect = $_objectManager->get(\Joshine\Common\Lib\MobileDetect\MobileDetect::class);
$isMobile = $mobileDetect->isMobile();
?>
<style>
.banner-one{
min-height: 500px;
}
.banner-one,.banner-place,.banner-place li{
width: 100%;
}
.cms-index-index .owl-carousel.owl-theme {
margin: 0 auto;
padding: 0;
}
.cms-index-index .owl-carousel.owl-theme .owl-nav .owl-prev,.cms-index-index .owl-carousel.owl-theme .owl-nav .owl-next{
background-color:#FFFFFF;
border-radius: 22px;
opacity: 0.7;
top:40%;
}
@media (max-width: 768px) {
.cms-index-index .owl-carousel.owl-theme .owl-nav .owl-prev,.cms-index-index .owl-carousel.owl-theme .owl-nav .owl-next{
border-radius: 0px;
padding: 10px 0px 10px 5px;
}
}
</style>
<div class="banner-one" style="background-color: #f0f0f0;width:100%;">
<ul class="banner-place owl-carousel owl-theme">
<link rel="stylesheet" type="text/css" href="<?php echo $block->getViewFileUrl('Joshine_Banner::css/banner.css'); ?>">
<script type="text/javascript">
require(['jquery','banner'],function ($){
var img_arr =
[
<?php foreach ($collection->getItems() as $item):?>
[
<?php echo "'".$mediaUrl . $item->getData('img_patch') . "',";?>
<?php echo "'".$mediaUrl . $item->getData('phone_img_patch') . "',";?>
],
<?php endforeach;?>
];
<li>
<a href="<?$item->getData('url')?>">
var href = [
<?php foreach ($collection->getItems() as $item):?>
<?php echo "'" . $item->getData('url') . "',";?>
<?php if ($isMobile) :?>
<img class="mobile" src="<?= $mediaUrl . $item->getData('phone_img_patch')?>" alt="" />
<?php else:?>
<img class="pc" src="<?= $mediaUrl . $item->getData('img_patch')?>" alt="" />
<?php endif; ?>
</a>
</li>
<?php endforeach;?>
];
jQuery('.banner1').banner({
img: img_arr,
href:href,
btn: true,
list: true,
autoPlay: true,
delayTime: 5000,
moveTime: 500,
index: 0
</ul>
</div>
<script>
// <![CDATA[
require(['jquery', 'jquery.owlCarousel'], function ($) {
var isMobile = window.matchMedia("(pointer:coarse)").matches;
var el = $('.banner-place');
var owl = el.owlCarousel({
nav: true,
navText: [],
autoplay:true,
autoplayTimeout:3000,
loop: true,
dots: true,
dotsEach:1,
dotsSpeed:2,
items: 1,
center: false,
slideBy: 1
});
window.onload = function (){
var h_max = 0;
$('.top_banner').each(function (i,v){
var h = $(this).height();
h_max = h > h_max ? h : h_max;
});
if (h_max > 0){
$('.banner1').height(h_max);
$('.banner1').css('line-height',h_max+'px');
var buttonTop = h_max/2;
$('#left').css({'top':buttonTop,'line-height': 0});
$('#right').css({'top':buttonTop,'line-height': 0});
}
if (img_arr.length <= 1){
$('.banner1 .list').hide();
$('#left').hide();
$('#right').hide();
if(isMobile)
{
$('.owl-nav .owl-prev').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path stroke-width="1.5" d="M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"></path></svg>')
$('.owl-nav .owl-next').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path stroke-width="1.5" d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"></path></svg>')
}
else
{
$('.owl-nav .owl-prev').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path stroke-width="1.5" d="M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"></path></svg>')
$('.owl-nav .owl-next').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path stroke-width="1.5" d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"></path></svg>')
}
});
});
// ]]>
</script>
\ No newline at end of file
......@@ -21,7 +21,7 @@ class AddRow extends \Magento\Backend\Block\Widget\Form\Container
$this->_blockGroup = 'Magepow_Sizechart';
$this->_controller = 'adminhtml_sizechart';
parent::_construct();
if ($this->_isAllowedAction('Magepow_Sizechart::add_row')) {
/*if ($this->_isAllowedAction('Magepow_Sizechart::add_row')) {
$this->buttonList->update('save', 'label', __('Save'));
$this->buttonList->add(
'saveandcontinue',
......@@ -40,7 +40,23 @@ class AddRow extends \Magento\Backend\Block\Widget\Form\Container
);
} else {
$this->buttonList->remove('save');
}
}*/
$this->buttonList->update('save', 'label', __('Save'));
$this->buttonList->add(
'saveandcontinue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => [
'event' => 'saveAndContinueEdit',
'target' => '#edit_form'
]
]
]
]
);
// $this->buttonList->remove('reset');
}
......
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magepow_Sizechart::magepow" title="Size Chart" sortOrder="10">
<resource id="Magepow_Sizechart::sizechart" title="Size Chart Management" sortOrder="50" />
</resource>
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Magepow_Sizechart::config" title="Size Chart"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment