mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
Build section menu using knp menu builder
This commit is contained in:
@@ -36,12 +36,6 @@ chill_main_homepage_without_locale:
|
||||
chill_main_homepage:
|
||||
path: /{_locale}/homepage
|
||||
defaults: { _controller: ChillMainBundle:Default:index }
|
||||
options:
|
||||
menus:
|
||||
section:
|
||||
order: 10
|
||||
label: Homepage
|
||||
icons: [home]
|
||||
|
||||
|
||||
chill_main_admin_central:
|
||||
|
@@ -1,12 +1,6 @@
|
||||
chill_main_export_index:
|
||||
path: /
|
||||
defaults: { _controller: ChillMainBundle:Export:index }
|
||||
options:
|
||||
menus:
|
||||
section:
|
||||
order: 20
|
||||
label: Export Menu
|
||||
icons: [upload]
|
||||
|
||||
chill_main_export_new:
|
||||
path: /new/{alias}
|
||||
|
@@ -2,3 +2,9 @@ services:
|
||||
Chill\MainBundle\Routing\MenuBuilder\UserMenuBuilder:
|
||||
tags:
|
||||
- { name: 'chill.menu_builder' }
|
||||
|
||||
Chill\MainBundle\Routing\MenuBuilder\SectionMenuBuilder:
|
||||
arguments:
|
||||
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||
tags:
|
||||
- { name: 'chill.menu_builder' }
|
||||
|
@@ -14,4 +14,10 @@ services:
|
||||
class: Chill\MainBundle\Security\UserProvider\UserProvider
|
||||
arguments:
|
||||
$em: '@Doctrine\ORM\EntityManagerInterface'
|
||||
|
||||
Chill\MainBundle\Security\Authorization\ChillExportVoter:
|
||||
arguments:
|
||||
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
@@ -21,16 +21,18 @@
|
||||
<a href="javascript:void(0)" class="more">Sections</a>
|
||||
</div>
|
||||
<ul class="submenu width-15-em" style="padding-left: 0; padding-right: 0; background-color:transparent;">
|
||||
{% for route in routes %}
|
||||
{% for menu in menus %}
|
||||
<li style="display:block; background-color: #333333; padding-left:1.5em; border-bottom:1px; border-bottom: 1px solid #FFF;padding-top:0; padding-bottom:0;">
|
||||
<div style="margin-bottom:2px;">
|
||||
<div style="font-family: 'Open Sans'; font-weight:300; font-size: 0.75em; text-align:left; height: 46px; display:inline-block; width: calc(100% - 5em - 1px); vertical-align:top;">
|
||||
<a href="{{ path(route.key, args ) }}">{{ route.label|trans }}</a>
|
||||
<a href="{{ menu.uri }}">{{ menu.label|trans }}</a>
|
||||
</div>
|
||||
<div style="background-color: #333333; text-align:center;width: 2em; margin-left:-0.15em; font-size:1.5em; color:#FFF; height: 46px; display:inline-block; vertical-align:top;float:right">{% spaceless %}
|
||||
{% for icon in route.icons %}
|
||||
{% if menu.extras.icons is defined %}
|
||||
{% for icon in menu.extras.icons %}
|
||||
<i class="fa fa-{{ icon }}"></i>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endspaceless %}</div>
|
||||
</div>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user