Skip to content

Commit

Permalink
Restyling and redefining fixtures for homepage, category, product and…
Browse files Browse the repository at this point in the history
… Q&A pages
  • Loading branch information
senghe committed Sep 3, 2024
1 parent 30a6f53 commit fc43ee3
Show file tree
Hide file tree
Showing 16 changed files with 345 additions and 87 deletions.
12 changes: 6 additions & 6 deletions src/Resources/assets/shop/scss/_carousel.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
.carousel-wrapper {
position: relative;

.carousel {
.products-carousel {
margin: 0 -1em;
}

.carousel-nav {
.carousel-left {
.products-carousel-nav {
.products-carousel-left {
left: 30px;
}

.carousel-right {
.products-carousel-right {
right: 30px;
}

.carousel-left, .carousel-right {
.products-carousel-left, .products-carousel-right {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}

.carousel-item {
.products-carousel-item {
padding: 5px 1em;
}
}
Binary file modified tests/Application/Resources/fixtures/homepage_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/Application/assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import 'sylius/bundle/ShopBundle/Resources/private/entry';
import './styles.scss';
23 changes: 23 additions & 0 deletions tests/Application/assets/shop/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.homepage-logo {
border-radius: 6px;
overflow: hidden;
}

.homepage-sale {
img {
width: 60% !important;
margin: auto !important;
border-radius: 20px;
}
}

.cms_content_element__taxons-list {
.ui.column {
text-align: center;

a {
font-size: 14pt;
font-weight: bold;
}
}
}
334 changes: 265 additions & 69 deletions tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% set tag = random(0, 1000) %}
<div class="{{ content_element_base_class }}__products-carousel">
<div class="carousel-wrapper">
<div class="products-carousel products-carousel-{{ tag }}">
{% for product in products %}
<div class="products-carousel-item">
{% include '@SyliusShop/Product/_box.html.twig' %}
</div>
{% endfor %}
</div>

<div class="products-carousel-nav">
<button class="products-carousel-left products-carousel-left-{{ tag }} ui huge black icon button">
<i class="left arrow icon"></i>
</button>
<button class="products-carousel-right products-carousel-right-{{ tag }} ui huge black icon button">
<i class="right arrow icon"></i>
</button>
</div>
</div>
</div>
<script type="text/javascript">
window.addEventListener('load', function () {
$('.products-carousel-{{ tag }}').slick({
infinite: true,
slidesToShow: 4,
slidesToScroll: 1,
prevArrow: $('.products-carousel-left-{{ tag }}'),
nextArrow: $('.products-carousel-right-{{ tag }}'),
appendArrows: false,
});
})
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="{{ content_element_base_class }}__products-grid">
<div class="ui four doubling cards">
{% for product in products %}
{% include '@SyliusShop/Product/_box.html.twig' %}
{% endfor %}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="{{ content_element_base_class }}__single-media">
<div style="border-radius: 4px; overflow: hidden">
{{ media.renderedContent }}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,18 @@

{% block content %}
<div class="top one">
<div class="ui center aligned segment stackable grid cms-logo">
<div class="homepage-logo">
{{ bitbag_cms_render_media('homepage_logo') }}
</div>
{{ bitbag_cms_render_block('homepage_textarea') }}
{{ bitbag_cms_render_block('homepage_products_carousel') }}
<div class="homepage-sale">
{{ bitbag_cms_render_block('homepage_sale_banner') }}
</div>
{{ bitbag_cms_render_block('homepage_products_grid') }}
{{ bitbag_cms_render_block('homepage_taxons_list') }}
{{ bitbag_cms_render_block('homepage_sale_banner2') }}
{{ bitbag_cms_render_block('homepage_products_carousel_by_taxon') }}
{{ bitbag_cms_render_block('homepage_products_grid_by_taxon') }}
</div>
<div class="ui stackable one column grid">
<div class="column intro promo">
<div class="ui info message">
Like it? We do a lot of Sylius projects & plugins. <br/>
Perhaps there is something we can do for you. Visit <a href="https://bitbag.shop/">our website</a> for
more information.
</div>
</div>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,5 @@

{{ sonata_block_render_event('sylius.shop.product.show.before_associations', {'product': product}) }}

{% include '@SyliusShop/Product/Show/_associations.html.twig' %}

{{ bitbag_cms_render_block('specified_products_in_taxons', null, product) }}
{% endblock %}

0 comments on commit fc43ee3

Please sign in to comment.