-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes and fixes structure to sylius 1.6
- Loading branch information
Showing
85 changed files
with
523 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018-2019 Odiseo Team | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
<h1 align="center"> | ||
<a href="https://odiseo.com.ar/" target="_blank" title="Odiseo"> | ||
<img src="https://github.com/odiseoteam/SyliusBlogPlugin/blob/master/logo_odiseo.png" alt="Odiseo" width="300px" /> | ||
<img src="https://github.com/odiseoteam/SyliusBlogPlugin/blob/master/sylius-blog-plugin.png" alt="Sylius Blog Plugin" /> | ||
</a> | ||
<br /> | ||
Odiseo Sylius Blog Plugin | ||
<br /> | ||
<a href="https://packagist.org/packages/odiseoteam/sylius-blog-plugin" title="License" target="_blank"> | ||
<img src="https://img.shields.io/packagist/l/odiseoteam/sylius-blog-plugin.svg" /> | ||
</a> | ||
|
@@ -25,18 +23,19 @@ | |
|
||
## Description | ||
|
||
This plugin add blog features to the Sylius ecommerce framework. It uses the [OdiseoBlogBundle](https://github.com/odiseoteam/OdiseoBlogBundle) Symfony bundle. | ||
|
||
Now supporting Sylius 1.4+ with Symfony 4 + Flex structure. | ||
This is a Sylius Plugin that add blog features to your store. It uses the [OdiseoBlogBundle](https://github.com/odiseoteam/OdiseoBlogBundle) Symfony bundle. | ||
|
||
Features: | ||
|
||
* Articles and article categories, both translatables. | ||
|
||
* Multi images for articles. | ||
|
||
* This plugin comes with fixtures. | ||
* [NEW] Comments and comment replies. Comments can be made as ShopUser or as guest. | ||
|
||
Screenshots: | ||
* Comments and comment replies. Comments can be made as ShopUser or as guest. | ||
|
||
Support Sylius version 1.3+. | ||
|
||
<img src="https://github.com/odiseoteam/SyliusBlogPlugin/blob/master/screenshot_1.png" alt="Blog admin" width="80%"> | ||
<img src="https://github.com/odiseoteam/SyliusBlogPlugin/blob/master/screenshot_2.png" alt="Blog admin" width="80%"> | ||
|
@@ -45,15 +44,15 @@ Screenshots: | |
|
||
You can see this plugin in action in our Sylius Demo application. | ||
|
||
- Frontend: [sylius-demo.odiseo.com.ar](https://sylius-demo.odiseo.com.ar). | ||
- Frontend: [sylius-demo.odiseo.com.ar](https://sylius-demo.odiseo.com.ar). | ||
- Administration: [sylius-demo.odiseo.com.ar/admin](https://sylius-demo.odiseo.com.ar/admin) with `odiseo: odiseo` credentials. | ||
|
||
## Installation | ||
|
||
1. Run `composer require odiseoteam/sylius-blog-plugin` | ||
|
||
2. Enable the plugin in bundles.php. This plugin need the FOSCKEditorBundle and EWZRecaptchaBundle so make sure to include | ||
them too: | ||
them too | ||
|
||
```php | ||
<?php | ||
|
@@ -64,26 +63,25 @@ return [ | |
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], | ||
EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle::class => ['all' => true], | ||
Odiseo\SyliusBlogPlugin\OdiseoSyliusBlogPlugin::class => ['all' => true], | ||
// ... | ||
]; | ||
``` | ||
|
||
3. Import the plugin configurations | ||
|
||
```yml | ||
imports: | ||
- { resource: "@OdiseoSyliusBlogPlugin/Resources/config/config.yml" } | ||
- { resource: "@OdiseoSyliusBlogPlugin/Resources/config/config.yaml" } | ||
``` | ||
4. Add the shop and admin routes | ||
```yml | ||
odiseo_sylius_blog_admin: | ||
resource: "@OdiseoSyliusBlogPlugin/Resources/config/routing/admin.yml" | ||
odiseo_sylius_blog_plugin_admin: | ||
resource: "@OdiseoSyliusBlogPlugin/Resources/config/routing/admin.yaml" | ||
prefix: /admin | ||
|
||
odiseo_sylius_blog_shop: | ||
resource: "@OdiseoSyliusBlogPlugin/Resources/config/routing/shop.yml" | ||
odiseo_sylius_blog_plugin_shop: | ||
resource: "@OdiseoSyliusBlogPlugin/Resources/config/routing/shop.yaml" | ||
prefix: /{_locale}/blog | ||
requirements: | ||
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$ | ||
|
@@ -97,7 +95,7 @@ php bin/console assets:install public | |
``` | ||
|
||
6. Finish the installation updating the database schema and installing assets | ||
|
||
``` | ||
php bin/console doctrine:schema:update --force | ||
php bin/console sylius:theme:assets:install | ||
|
@@ -115,7 +113,7 @@ To render a list of latest articles you can do something like this: | |
```twig | ||
{{ render(url('odiseo_sylius_blog_shop_partial_article_index_latest', {'count': 4, 'template': '@OdiseoSyliusBlogPlugin/Shop/Article/_latest.html.twig'})) }} | ||
``` | ||
|
||
And to render a list of categories: | ||
|
||
```twig | ||
|
@@ -133,12 +131,13 @@ Simply add this configuration on your fixture suite: | |
```yml | ||
blog: | ||
options: | ||
articles_per_channel: 10 | ||
articles_per_channel: 12 | ||
``` | ||
## Test the plugin | ||
You can follow the instructions to test this plugins in the proper documentation page: [Test the plugin](doc/tests.md). | ||
## Credits | ||
This plugin is maintained by <a href="https://odiseo.com.ar">Odiseo</a>. Want us to help you with this plugin or any Sylius project? Contact us on <a href="mailto:[email protected]">[email protected]</a>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
<?php | ||
|
||
namespace spec\Odiseo\SyliusBlogPlugin\Model; | ||
declare(strict_types=1); | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use Odiseo\SyliusBlogPlugin\Model\Article; | ||
use Odiseo\SyliusBlogPlugin\Model\ArticleInterface; | ||
namespace spec\Odiseo\SyliusBlogPlugin\Entity; | ||
|
||
use Odiseo\SyliusBlogPlugin\Entity\Article; | ||
use Odiseo\SyliusBlogPlugin\Entity\ArticleInterface; | ||
use PhpSpec\ObjectBehavior; | ||
use Sylius\Component\Core\Model\Channel; | ||
use Sylius\Component\Resource\Model\CodeAwareInterface; | ||
use Sylius\Component\Resource\Model\ResourceInterface; | ||
use Sylius\Component\Resource\Model\TimestampableInterface; | ||
|
||
/** | ||
* @author Diego D'amico <[email protected]> | ||
*/ | ||
class ArticleSpec extends ObjectBehavior | ||
|
||
final class ArticleSpec extends ObjectBehavior | ||
{ | ||
function it_is_initializable() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,30 +8,20 @@ | |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
/** | ||
* This class contains the configuration information for the bundle. | ||
* | ||
* This information is solely responsible for how the different configuration | ||
* sections are normalized, and merged. | ||
* | ||
* @author Diego D'amico <[email protected]> | ||
*/ | ||
final class Configuration implements ConfigurationInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getConfigTreeBuilder(): TreeBuilder | ||
{ | ||
$treeBuilder = new TreeBuilder(); | ||
$rootNode = $treeBuilder->root('odiseo_sylius_blog'); | ||
|
||
$rootNode | ||
->addDefaultsIfNotSet() | ||
->children() | ||
->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end() | ||
->end() | ||
; | ||
$treeBuilder = new TreeBuilder('odiseo_sylius_blog_plugin'); | ||
if (\method_exists($treeBuilder, 'getRootNode')) { | ||
$rootNode = $treeBuilder->getRootNode(); | ||
} else { | ||
// BC layer for symfony/config 4.1 and older | ||
$rootNode = $treeBuilder->root('odiseo_sylius_blog_plugin'); | ||
} | ||
|
||
return $treeBuilder; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,6 @@ | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; | ||
|
||
/** | ||
* @author Diego D'amico <[email protected]> | ||
*/ | ||
final class OdiseoSyliusBlogExtension extends AbstractResourceExtension | ||
{ | ||
/** | ||
|
@@ -20,16 +17,9 @@ final class OdiseoSyliusBlogExtension extends AbstractResourceExtension | |
public function load(array $config, ContainerBuilder $container): void | ||
{ | ||
$config = $this->processConfiguration($this->getConfiguration([], $container), $config); | ||
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
|
||
$this->registerResources('odiseo_sylius_blog', $config['driver'], [], $container); | ||
|
||
$configFiles = [ | ||
'services.yml', | ||
]; | ||
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
|
||
foreach ($configFiles as $configFile) { | ||
$loader->load($configFile); | ||
} | ||
$loader->load('services.yaml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.