mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Render all taxons, split behat into 3 profiles
This commit is contained in:
parent
e69ace5c80
commit
5eb4ec1f6f
3 changed files with 31 additions and 18 deletions
|
|
@ -31,7 +31,9 @@ before_script:
|
|||
- sleep 5
|
||||
|
||||
script:
|
||||
- bin/behat --no-snippets --no-paths --verbose
|
||||
- bin/behat --no-snippets --no-paths --verbose -p frontend
|
||||
- bin/behat --no-snippets --no-paths --verbose -p backend
|
||||
# - bin/behat --no-snippets --no-paths --verbose -p api
|
||||
|
||||
notifications:
|
||||
email: "travis-ci@sylius.org"
|
||||
|
|
|
|||
|
|
@ -16,6 +16,14 @@ default:
|
|||
class: SyliusKernel
|
||||
mink_driver: true
|
||||
|
||||
no-js:
|
||||
filters:
|
||||
tags: "~@javascript"
|
||||
frontend:
|
||||
paths:
|
||||
features: features/frontend
|
||||
|
||||
backend:
|
||||
paths:
|
||||
features: features/backend
|
||||
|
||||
api:
|
||||
paths:
|
||||
features: features/api
|
||||
|
|
|
|||
|
|
@ -13,12 +13,13 @@ namespace Sylius\Bundle\WebBundle\Menu;
|
|||
|
||||
use Knp\Menu\FactoryInterface;
|
||||
use Knp\Menu\ItemInterface;
|
||||
use Sylius\Bundle\CartBundle\Provider\CartProviderInterface;
|
||||
use Sylius\Bundle\MoneyBundle\Twig\SyliusMoneyExtension;
|
||||
use Sylius\Bundle\ResourceBundle\Model\RepositoryInterface;
|
||||
use Sylius\Bundle\TaxonomiesBundle\Model\TaxonInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Security\Core\SecurityContextInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Sylius\Bundle\CartBundle\Provider\CartProviderInterface;
|
||||
use Sylius\Bundle\MoneyBundle\Twig\SyliusMoneyExtension;
|
||||
|
||||
/**
|
||||
* Frontend menu builder.
|
||||
|
|
@ -156,18 +157,25 @@ class FrontendMenuBuilder extends MenuBuilder
|
|||
foreach ($taxonomies as $taxonomy) {
|
||||
$child = $menu->addChild($taxonomy->getName(), $childOptions);
|
||||
|
||||
foreach ($taxonomy->getTaxons() as $taxon) {
|
||||
$child->addChild($taxon->getName(), array(
|
||||
'route' => 'sylius_product_index_by_taxon',
|
||||
'routeParameters' => array('permalink' => $taxon->getPermalink()),
|
||||
'labelAttributes' => array('icon' => 'icon-angle-right')
|
||||
));
|
||||
}
|
||||
$this->createTaxonomiesMenuNode($child, $taxonomy->getRoot());
|
||||
}
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
private function createTaxonomiesMenuNode(ItemInterface $menu, TaxonInterface $taxon)
|
||||
{
|
||||
foreach ($taxon->getChildren() as $child) {
|
||||
$childMenu = $menu->addChild($child->getName(), array(
|
||||
'route' => 'sylius_product_index_by_taxon',
|
||||
'routeParameters' => array('permalink' => $child->getPermalink()),
|
||||
'labelAttributes' => array('icon' => 'icon-angle-right')
|
||||
));
|
||||
|
||||
$this->createTaxonomiesMenuNode($childMenu, $child);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds frontend social menu.
|
||||
*
|
||||
|
|
@ -198,11 +206,6 @@ class FrontendMenuBuilder extends MenuBuilder
|
|||
'linkAttributes' => array('title' => $this->translate('sylius.frontend.menu.social.facebook')),
|
||||
'labelAttributes' => array('icon' => 'icon-facebook-sign icon-large', 'iconOnly' => true)
|
||||
));
|
||||
$menu->addChild('google', array(
|
||||
'uri' => '#',
|
||||
'linkAttributes' => array('title' => $this->translate('sylius.frontend.menu.social.google')),
|
||||
'labelAttributes' => array('icon' => 'icon-google-plus-sign icon-large', 'iconOnly' => true)
|
||||
));
|
||||
$menu->addChild('linkedin', array(
|
||||
'uri' => 'http://www.linkedin.com/groups/Sylius-Community-4903257',
|
||||
'linkAttributes' => array('title' => $this->translate('sylius.frontend.menu.social.linkedin')),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue