Skip to content

Commit

Permalink
PoC of new ShopBundle with SemanticUI
Browse files Browse the repository at this point in the history
  • Loading branch information
pjedrzejewski authored and tuka217 committed May 23, 2016
1 parent 2c8981c commit cf68520
Showing 21 changed files with 771 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@

/web/bundles
/web/assets/admin
/web/assets/shop
/web/assets/css
/web/assets/js
/web/assets/fonts
68 changes: 66 additions & 2 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ var env = process.env.GULP_ENV;
var rootPath = 'web/assets/';

var adminRootPath = rootPath + 'admin/';
var shopRootPath = rootPath + 'shop/';

var paths = {
admin: {
@@ -34,6 +35,22 @@ var paths = {
img: [
'src/Sylius/Bundle/UiBundle/Resources/private/img/**',
]
},
shop: {
js: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/semantic-ui-css/semantic.min.js',
'src/Sylius/Bundle/UiBundle/Resources/private/js/**',
],
sass: [
'src/Sylius/Bundle/UiBundle/Resources/private/sass/**',
],
css: [
'node_modules/semantic-ui-css/semantic.min.css',
],
img: [
'src/Sylius/Bundle/UiBundle/Resources/private/img/**',
]
}
};

@@ -84,5 +101,52 @@ gulp.task('admin-watch', function() {
gulp.watch(paths.admin.img, ['admin-img']);
});

gulp.task('default', ['admin-js', 'admin-css', 'admin-img']);
gulp.task('watch', ['admin-watch', 'admin-js', 'admin-css', 'admin-img']);
gulp.task('shop-js', function () {
return gulp.src(paths.shop.js)
.pipe(concat('app.js'))
.pipe(gulpif(env === 'prod', uglify))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(shopRootPath + 'js/'))
;
});

gulp.task('shop-css', function() {
gulp.src(['node_modules/semantic-ui-css/themes/**/*']).pipe(gulp.dest(shopRootPath + 'css/themes/'));

var cssStream = gulp.src(paths.shop.css)
.pipe(concat('css-files.css'))
;

var sassStream = gulp.src(paths.shop.sass)
.pipe(sass())
.pipe(concat('sass-files.scss'))
;

return merge(cssStream, sassStream)
.pipe(order(['css-files.css', 'sass-files.scss']))
.pipe(concat('style.css'))
.pipe(gulpif(env === 'prod', uglifycss))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(shopRootPath + 'css/'))
.pipe(livereload())
;
});

gulp.task('shop-img', function() {
return gulp.src(paths.shop.img)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(shopRootPath + 'img/'))
;
});

gulp.task('shop-watch', function() {
livereload.listen();

gulp.watch(paths.shop.js, ['shop-js']);
gulp.watch(paths.shop.sass, ['shop-css']);
gulp.watch(paths.shop.css, ['shop-css']);
gulp.watch(paths.shop.img, ['shop-img']);
});

gulp.task('default', ['admin-js', 'admin-css', 'admin-img', 'shop-js', 'shop-css', 'shop-img']);
gulp.task('watch', ['admin-watch', 'admin-js', 'admin-css', 'admin-img', 'shop-watch', 'shop-js', 'shop-css', 'shop-img']);
6 changes: 5 additions & 1 deletion app/config/routing.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,10 @@ sylius_api:
sylius_admin:
resource: "@SyliusAdminBundle/Resources/config/routing.yml"
prefix: /admin


sylius_shop:
resource: "@SyliusShopBundle/Resources/config/routing.yml"
prefix: /shop

sylius_web:
resource: "@SyliusWebBundle/Resources/config/routing/main.yml"
1 change: 1 addition & 0 deletions src/Sylius/Bundle/CoreBundle/Kernel/Kernel.php
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ public function registerBundles()
new \Sylius\Bundle\UserBundle\SyliusUserBundle(),
new \Sylius\Bundle\UiBundle\SyliusUiBundle(),
new \Sylius\Bundle\AdminBundle\SyliusAdminBundle(),
new \Sylius\Bundle\ShopBundle\SyliusShopBundle(),
new \Sylius\Bundle\MetadataBundle\SyliusMetadataBundle(),
new \Sylius\Bundle\AssociationBundle\SyliusAssociationBundle(),
new \Sylius\Bundle\ReviewBundle\SyliusReviewBundle(),
5 changes: 5 additions & 0 deletions src/Sylius/Bundle/ShopBundle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vendor/
bin/

composer.phar
composer.lock
18 changes: 18 additions & 0 deletions src/Sylius/Bundle/ShopBundle/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: php

sudo: false

php:
- 7.0
- 5.6
- 5.5

before_install:
- echo "memory_limit=2048M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini || true

install:
- composer install --no-interaction --prefer-source --ignore-platform-reqs

script:
- bin/phpspec run -fpretty --verbose
6 changes: 6 additions & 0 deletions src/Sylius/Bundle/ShopBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CHANGELOG
=========

### v0.18.0

* First development release.
44 changes: 44 additions & 0 deletions src/Sylius/Bundle/ShopBundle/Controller/HomepageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sylius\Bundle\ShopBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Component\HttpFoundation\Request;

/**
* @author Paweł Jędrzejewski <pawel@sylius.org>
*/
class HomepageController
{
/**
* @var EngineInterface
*/
private $templatingEngine;

/**
* @param EngineInterface $templatingEngine
*/
public function __construct(EngineInterface $templatingEngine)
{
$this->templatingEngine = $templatingEngine;
}

/**
* @param Request $request
*
* @return Response
*/
public function indexAction(Request $request)
{
return $this->templatingEngine->renderResponse('SyliusShopBundle:Homepage:index.html.twig');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sylius\Bundle\ShopBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
* @author Paweł Jędrzejewski <pawel@sylius.org>
*/
class SyliusShopExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

$loader->load('controller.xml');
}
}
19 changes: 19 additions & 0 deletions src/Sylius/Bundle/ShopBundle/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2011-2016 Paweł Jędrzejewski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
46 changes: 46 additions & 0 deletions src/Sylius/Bundle/ShopBundle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
SyliusShopBundle [![Build status...](https://secure.travis-ci.org/Sylius/SyliusShopBundle.png?branch=master)](http://travis-ci.org/Sylius/SyliusShopBundle)
================

This bundle contains Sylius eCommerce storefront.

Sylius
------

![Sylius](https://dl.dropboxusercontent.com/u/46579820/sylius-logo.jpg)

Sylius is an Open Source eCommerce solution built from decoupled components with powerful API and the highest quality code. [Read more on sylius.org](http://sylius.org).

Installation & Documentation
----------------------------

For installation and usage examples please refer to the documentation available on [**docs.sylius.org**](http://docs.sylius.org).

Contributing
------------

Extensive Contributing Guide can be found in [the official documentation](http://docs.sylius.org/en/latest/contributing/index.html).

Follow Sylius' Development
--------------------------

If you want to keep up with the updates and latest features, follow us on the following channels:

* [Official Blog](https://sylius.org/blog)
* [Sylius on Twitter](https://twitter.com/Sylius)
* [Sylius on Facebook](https://facebook.com/SyliusEcommerce)

Reporting Bugs
--------------

If you have found a bug, please create an issue on [the main repository](https://github.com/Sylius/Sylius/issues).

MIT License
-----------

License can be found [here](https://github.com/Sylius/SyliusShopBundle/blob/master/LICENSE).

Authors
-------

The bundle was originally created by [Paweł Jędrzejewski](http://pjedrzejewski.com).
See the list of [contributors](https://github.com/Sylius/SyliusShopBundle/contributors).
29 changes: 29 additions & 0 deletions src/Sylius/Bundle/ShopBundle/Resources/config/controller.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="sylius.controller.shop.homepage.class">Sylius\Bundle\ShopBundle\Controller\HomepageController</parameter>
</parameters>

<services>
<service id="sylius.controller.shop.homepage" class="%sylius.controller.shop.homepage.class%">
<argument type="service" id="templating" />
</service>
</services>

</container>
4 changes: 4 additions & 0 deletions src/Sylius/Bundle/ShopBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sylius_shop_homepage:
path: /
defaults:
_controller: sylius.controller.shop.homepage:indexAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<div class="ui inverted vertical footer segment">
<div class="ui container">
<div class="ui stackable inverted divided equal height stackable grid">
<div class="three wide column">
<h4 class="ui inverted header">Your Store</h4>
<div class="ui inverted link list">
<a href="#" class="item">About</a>
<a href="#" class="item">Terms and Conditions</a>
<a href="#" class="item">Privacy Policy</a>
</div>
</div>
<div class="three wide column">
<h4 class="ui inverted header">Customer Care</h4>
<div class="ui inverted link list">
<a href="#" class="item">Contact us</a>
<a href="#" class="item">FAQs</a>
<a href="#" class="item">Delivery & Shipping</a>
<a href="#" class="item">Returns Polciy</a>
</div>
</div>
<div class="eight wide column">
<h4 class="ui inverted header">&copy; Your Store</h4>
<p>Powered by <a href="#">Sylius</a>.</p>
</div>
</div>
</div>
</div>
Loading

0 comments on commit cf68520

Please sign in to comment.