Permalink
Browse files

initial commit

  • Loading branch information...
jaytaph committed Nov 6, 2012
0 parents commit da8096386cc878280557f6740771ad84b73fe495
Showing with 17,678 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +10 −0 .travis.yml
  3. +24 −0 LICENSE
  4. +2 −0 README.md
  5. +1 −0 app/.htaccess
  6. +9 −0 app/AppCache.php
  7. +44 −0 app/AppKernel.php
  8. +129 −0 app/Resources/views/base.html.twig
  9. +16 −0 app/Resources/views/flash_message.html.twig
  10. +95 −0 app/Resources/views/knp_menu.html.twig
  11. +638 −0 app/SymfonyRequirements.php
  12. +16 −0 app/autoload.php
  13. +55 −0 app/check.php
  14. +67 −0 app/config/config.yml
  15. +26 −0 app/config/config_dev.yml
  16. +19 −0 app/config/config_prod.yml
  17. +14 −0 app/config/config_test.yml
  18. +15 −0 app/config/parameters.yml
  19. +15 −0 app/config/parameters.yml.dist
  20. +20 −0 app/config/routing.yml
  21. +14 −0 app/config/routing_dev.yml
  22. +43 −0 app/config/security.yml
  23. +22 −0 app/console
  24. +41 −0 app/phpunit.xml.dist
  25. +47 −0 composer.json
  26. +1,588 −0 composer.lock
  27. BIN composer.phar
  28. +5 −0 installdb.sh
  29. +1 −0 public
  30. +1 −0 src/.htaccess
  31. +13 −0 src/Saffire/BadgeBundle/Controller/DefaultController.php
  32. +50 −0 src/Saffire/BadgeBundle/DataFixtures/ORM/BadgeCategoryFixtures.php
  33. +195 −0 src/Saffire/BadgeBundle/DataFixtures/ORM/BadgeFixtures.php
  34. +29 −0 src/Saffire/BadgeBundle/DependencyInjection/Configuration.php
  35. +28 −0 src/Saffire/BadgeBundle/DependencyInjection/SaffireBadgeExtension.php
  36. +176 −0 src/Saffire/BadgeBundle/Entity/Badge.php
  37. +130 −0 src/Saffire/BadgeBundle/Entity/Badge.php~
  38. +86 −0 src/Saffire/BadgeBundle/Entity/BadgeCategory.php
  39. +30 −0 src/Saffire/BadgeBundle/Entity/BadgeCategory.php~
  40. +19 −0 src/Saffire/BadgeBundle/Repository/BadgeRepository.php
  41. +3 −0 src/Saffire/BadgeBundle/Resources/config/routing.yml
  42. +7 −0 src/Saffire/BadgeBundle/Resources/config/services.yml
  43. 0 src/Saffire/BadgeBundle/Resources/doc/index.rst
  44. +11 −0 src/Saffire/BadgeBundle/Resources/translations/messages.fr.xlf
  45. +1 −0 src/Saffire/BadgeBundle/Resources/views/Default/index.html.twig
  46. +9 −0 src/Saffire/BadgeBundle/SaffireBadgeBundle.php
  47. +17 −0 src/Saffire/BadgeBundle/Tests/Controller/DefaultControllerTest.php
  48. +13 −0 src/Saffire/GroupBundle/Controller/DefaultController.php
  49. +32 −0 src/Saffire/GroupBundle/DataFixtures/ORM/GroupFixtures.php
  50. +29 −0 src/Saffire/GroupBundle/DependencyInjection/Configuration.php
  51. +28 −0 src/Saffire/GroupBundle/DependencyInjection/SaffireGroupExtension.php
  52. +157 −0 src/Saffire/GroupBundle/Entity/Group.php
  53. +130 −0 src/Saffire/GroupBundle/Entity/Group.php~
  54. +19 −0 src/Saffire/GroupBundle/Repository/GroupRepository.php
  55. +3 −0 src/Saffire/GroupBundle/Resources/config/routing.yml
  56. +7 −0 src/Saffire/GroupBundle/Resources/config/services.yml
  57. 0 src/Saffire/GroupBundle/Resources/doc/index.rst
  58. +11 −0 src/Saffire/GroupBundle/Resources/translations/messages.fr.xlf
  59. +1 −0 src/Saffire/GroupBundle/Resources/views/Default/index.html.twig
  60. +9 −0 src/Saffire/GroupBundle/SaffireGroupBundle.php
  61. +17 −0 src/Saffire/GroupBundle/Tests/Controller/DefaultControllerTest.php
  62. +13 −0 src/Saffire/HomeBundle/Controller/DefaultController.php
  63. +35 −0 src/Saffire/HomeBundle/Controller/WidgetController.php
  64. +29 −0 src/Saffire/HomeBundle/DependencyInjection/Configuration.php
  65. +28 −0 src/Saffire/HomeBundle/DependencyInjection/SaffireHomeExtension.php
  66. +11 −0 src/Saffire/HomeBundle/Resources/config/routing.yml
  67. +7 −0 src/Saffire/HomeBundle/Resources/config/services.yml
  68. 0 src/Saffire/HomeBundle/Resources/doc/index.rst
  69. +11 −0 src/Saffire/HomeBundle/Resources/translations/messages.fr.xlf
  70. +31 −0 src/Saffire/HomeBundle/Resources/views/Default/index.html.twig
  71. +18 −0 src/Saffire/HomeBundle/Resources/views/Widget/new.html.twig
  72. +4 −0 src/Saffire/HomeBundle/Resources/views/Widget/tip.html.twig
  73. +9 −0 src/Saffire/HomeBundle/SaffireHomeBundle.php
  74. +17 −0 src/Saffire/HomeBundle/Tests/Controller/DefaultControllerTest.php
  75. +13 −0 src/Saffire/UserBundle/Controller/DefaultController.php
  76. +40 −0 src/Saffire/UserBundle/DataFixtures/ORM/UserFixtures.php
  77. +29 −0 src/Saffire/UserBundle/DependencyInjection/Configuration.php
  78. +28 −0 src/Saffire/UserBundle/DependencyInjection/SaffireUserExtension.php
  79. +293 −0 src/Saffire/UserBundle/Entity/User.php
  80. +270 −0 src/Saffire/UserBundle/Entity/User.php~
  81. +19 −0 src/Saffire/UserBundle/Repository/UserRepository.php
  82. +11 −0 src/Saffire/UserBundle/Resources/config/routing.yml
  83. +7 −0 src/Saffire/UserBundle/Resources/config/services.yml
  84. 0 src/Saffire/UserBundle/Resources/doc/index.rst
  85. +11 −0 src/Saffire/UserBundle/Resources/translations/messages.fr.xlf
  86. +7 −0 src/Saffire/UserBundle/Resources/views/Default/index.html.twig
  87. +9 −0 src/Saffire/UserBundle/SaffireUserBundle.php
  88. +17 −0 src/Saffire/UserBundle/Tests/Controller/DefaultControllerTest.php
  89. +10 −0 web/.htaccess
  90. +24 −0 web/app.php
  91. +20 −0 web/app_dev.php
  92. BIN web/apple-touch-icon.png
  93. +815 −0 web/assets/bootstrap/css/bootstrap-responsive.css
  94. +4,914 −0 web/assets/bootstrap/css/bootstrap.css
  95. +727 −0 web/assets/bootstrap/css/bootstrap.min.css
  96. BIN web/assets/bootstrap/img/glyphicons-halflings-white.png
  97. BIN web/assets/bootstrap/img/glyphicons-halflings.png
  98. +90 −0 web/assets/bootstrap/js/bootstrap-alert.js
  99. +96 −0 web/assets/bootstrap/js/bootstrap-button.js
  100. +169 −0 web/assets/bootstrap/js/bootstrap-carousel.js
  101. +157 −0 web/assets/bootstrap/js/bootstrap-collapse.js
  102. +100 −0 web/assets/bootstrap/js/bootstrap-dropdown.js
  103. +218 −0 web/assets/bootstrap/js/bootstrap-modal.js
  104. +98 −0 web/assets/bootstrap/js/bootstrap-popover.js
  105. +151 −0 web/assets/bootstrap/js/bootstrap-scrollspy.js
  106. +135 −0 web/assets/bootstrap/js/bootstrap-tab.js
  107. +275 −0 web/assets/bootstrap/js/bootstrap-tooltip.js
  108. +61 −0 web/assets/bootstrap/js/bootstrap-transition.js
  109. +285 −0 web/assets/bootstrap/js/bootstrap-typeahead.js
  110. +1,836 −0 web/assets/bootstrap/js/bootstrap.js
  111. +7 −0 web/assets/bootstrap/js/bootstrap.min.js
  112. +4 −0 web/assets/bootstrap/js/jquery.js
  113. +85 −0 web/assets/fancybox/css/jquery.fancybox-buttons.css
  114. +54 −0 web/assets/fancybox/css/jquery.fancybox-thumbs.css
  115. +234 −0 web/assets/fancybox/css/jquery.fancybox.css
  116. BIN web/assets/fancybox/img/blank.gif
  117. BIN web/assets/fancybox/img/fancybox_buttons.png
  118. BIN web/assets/fancybox/img/fancybox_loading.gif
  119. BIN web/assets/fancybox/img/fancybox_sprite.png
  120. +115 −0 web/assets/fancybox/js/jquery.fancybox-buttons.js
  121. +157 −0 web/assets/fancybox/js/jquery.fancybox-thumbs.js
  122. +1,463 −0 web/assets/fancybox/js/jquery.fancybox.js
  123. +35 −0 web/assets/fancybox/js/jquery.fancybox.pack.js
  124. +13 −0 web/assets/fancybox/js/jquery.mousewheel-3.0.6.pack.js
  125. +4 −0 web/assets/jquery/jquery-1.7.2.min.js
  126. +13 −0 web/assets/jquery/jquery.mousewheel-3.0.6.pack.js
  127. +98 −0 web/config.php
  128. BIN web/favicon.ico
  129. BIN web/img/badges/._001.jpg
  130. BIN web/img/badges/._002.jpg
  131. BIN web/img/badges/._003.jpg
  132. BIN web/img/badges/._004.jpg
  133. BIN web/img/badges/._005.jpg
  134. BIN web/img/badges/._006.jpg
  135. BIN web/img/badges/._007.jpg
  136. BIN web/img/badges/._008.jpg
  137. BIN web/img/badges/._009.jpg
  138. BIN web/img/badges/._010.jpg
  139. BIN web/img/badges/._011.jpg
  140. BIN web/img/badges/._012.jpg
  141. BIN web/img/badges/._013.jpg
  142. BIN web/img/badges/._014.jpg
  143. BIN web/img/badges/._015.jpg
  144. BIN web/img/badges/._016.jpg
  145. BIN web/img/badges/._017.jpg
  146. BIN web/img/badges/._018.jpg
  147. BIN web/img/badges/._019.jpg
  148. BIN web/img/badges/._020.jpg
  149. BIN web/img/badges/001.jpg
  150. BIN web/img/badges/002.jpg
  151. BIN web/img/badges/003.jpg
  152. BIN web/img/badges/004.jpg
  153. BIN web/img/badges/005.jpg
  154. BIN web/img/badges/006.jpg
  155. BIN web/img/badges/007.jpg
  156. BIN web/img/badges/008.jpg
  157. BIN web/img/badges/009.jpg
  158. BIN web/img/badges/010.jpg
  159. BIN web/img/badges/011.jpg
  160. BIN web/img/badges/012.jpg
  161. BIN web/img/badges/013.jpg
  162. BIN web/img/badges/014.jpg
  163. BIN web/img/badges/015.jpg
  164. BIN web/img/badges/016.jpg
  165. BIN web/img/badges/017.jpg
  166. BIN web/img/badges/018.jpg
  167. BIN web/img/badges/019.jpg
  168. BIN web/img/badges/020.jpg
  169. BIN web/img/beta_ribbon.png
  170. BIN web/img/groups/._core.jpg
  171. BIN web/img/groups/core.jpg
  172. BIN web/img/icon-github.png
  173. BIN web/img/logo_bootstrap.png
  174. BIN web/img/logo_noxlogic.jpg
  175. BIN web/img/logo_php.gif
  176. BIN web/img/logo_symfony.png
  177. BIN web/img/logo_travis.png
  178. BIN web/img/saffire-logo.png
  179. +4 −0 web/robots.txt
@@ -0,0 +1,7 @@
+/web/bundles/
+/app/bootstrap*
+/app/cache/*
+/app/logs/*
+/vendor/
+/app/config/parameters.ini
+.idea
@@ -0,0 +1,10 @@
+language: php
+
+php:
+ - 5.3.3
+ - 5.3
+ - 5.4
+
+before_script: composer install
+
+script: phpunit -c app
24 LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2012, The Saffire Group
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the <organization> nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,2 @@
+Saffire Connect
+===============
@@ -0,0 +1 @@
+deny from all
@@ -0,0 +1,9 @@
+<?php
+
+require_once __DIR__.'/AppKernel.php';
+
+use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
+
+class AppCache extends HttpCache
+{
+}
@@ -0,0 +1,44 @@
+<?php
+
+use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+class AppKernel extends Kernel
+{
+ public function registerBundles()
+ {
+ $bundles = array(
+ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
+ new Symfony\Bundle\SecurityBundle\SecurityBundle(),
+ new Symfony\Bundle\TwigBundle\TwigBundle(),
+ new Symfony\Bundle\MonologBundle\MonologBundle(),
+ new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
+ new Symfony\Bundle\AsseticBundle\AsseticBundle(),
+ new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
+ new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+ new JMS\AopBundle\JMSAopBundle(),
+ new JMS\DiExtraBundle\JMSDiExtraBundle($this),
+ new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+ new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
+ new Ornicar\GravatarBundle\OrnicarGravatarBundle(),
+ new Knp\Bundle\MenuBundle\KnpMenuBundle(),
+ new Saffire\BadgeBundle\SaffireBadgeBundle(),
+ new Saffire\UserBundle\SaffireUserBundle(),
+ new Saffire\HomeBundle\SaffireHomeBundle(),
+ new Saffire\GroupBundle\SaffireGroupBundle(),
+ );
+
+ if (in_array($this->getEnvironment(), array('dev', 'test'))) {
+ $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
+ $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
+ $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
+ }
+
+ return $bundles;
+ }
+
+ public function registerContainerConfiguration(LoaderInterface $loader)
+ {
+ $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
+ }
+}
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>{% block title %}Welcome!{% endblock %}</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ {% block stylesheets %}{% endblock %}
+ <link href="/assets/bootstrap/css/bootstrap.css" rel="stylesheet">
+ <link href="/assets/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
+ <link rel="stylesheet" href="/assets/fancybox/css/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen" />
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ padding-bottom: 40px;
+ }
+
+ .inactive {
+ opacity:0.4;
+ filter:alpha(opacity=40);
+ }
+ </style>
+
+ <script type="text/javascript" src="/assets/jquery/jquery-1.7.2.min.js"></script>
+
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="/assets/bootstrap/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/assets/bootstrap/ico/apple-touch-icon-144-precomposed.png">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/bootstrap/ico/apple-touch-icon-114-precomposed.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/bootstrap/ico/apple-touch-icon-72-precomposed.png">
+ <link rel="apple-touch-icon-precomposed" href="/assets/bootstrap/ico/apple-touch-icon-57-precomposed.png">
+ </head>
+
+ <body>
+
+{% if not app.request.get('standalone') %}
+ {# Remove me when we are not in beta anymore #}
+ <img style="z-index: 5000; position: fixed; top: 0; left: 0; border: 0;" src="/img/beta_ribbon.png" alt="This site beta">
+
+ <div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </a>
+ <a class="brand" href="/">connect.saffire-lang.org</a>
+ <div class="nav-collapse">
+ {#{{ knp_menu_render('BoxConfigDefaultBundle:Builder:mainMenu', {'currentClass': 'active'}) }}#}
+ </div><!--/.nav-collapse -->
+ </div>
+ </div>
+ </div>
+{% endif %}
+
+
+ <div class="container">
+ {% include "::flash_message.html.twig" %}
+
+ {% block body %}{% endblock %}
+
+{% if not app.request.get('standalone') %}
+ {% block widget %}{% endblock %}
+ <hr>
+ <footer>
+ <p>
+ <img height="20" style='padding-bottom: 6px' title="Created by NoxLogic" src="/img/logo_noxlogic.jpg"> &copy; NoxLogic - {{ "now" | date("Y")}} - All rights reserved.
+
+ <img height="20" style='padding-bottom: 6px' class="pull-right" title="Created with the Symfony2 framework" src="/img/logo_symfony.png">
+ <img height="20" style='padding-bottom: 6px; padding-right: 10px' class="pull-right" title="Source hosted on Github" src="/img/icon-github.png">
+ <img height="20" style='padding-bottom: 6px; padding-right: 10px' class="pull-right" title="Created with Bootstrap" src="/img/logo_bootstrap.png">
+ <img height="20" style='padding-bottom: 6px; padding-right: 10px' class="pull-right" title="Tested with Travis" src="/img/logo_travis.png">
+ <img height="20" style='padding-bottom: 6px; padding-right: 10px' class="pull-right" title="Written in PHP" src="/img/logo_php.gif">
+ </p>
+ </footer>
+{% endif %}
+
+ </div>
+
+ {% block javascripts %}{% endblock %}
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $(".fancybox").fancybox({
+ autoScale : false,
+ autoSize : false,
+ height : '75%',
+ width : '75%',
+ openEffect : 'fade',
+ helpers : {
+ overlay : {
+ opacity: 0.6,
+ css : {
+ 'background-color' : '#000'
+ }
+ }
+ }
+ });
+ });
+ </script>
+
+ <script src="/assets/fancybox/js/jquery.mousewheel-3.0.6.pack.js"></script>
+ <script src="/assets/fancybox/js/jquery.fancybox.pack.js?v=2.0.6"></script>
+
+ <script src="/assets/bootstrap/js/bootstrap-transition.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-alert.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-modal.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-dropdown.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-scrollspy.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-tab.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-tooltip.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-popover.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-button.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-collapse.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-carousel.js"></script>
+ <script src="/assets/bootstrap/js/bootstrap-typeahead.js"></script>
+
+ </body>
+</html>
+207.97.227.243
@@ -0,0 +1,16 @@
+{% for key, flash in app.session.getFlashes() %}
+{# fos flash banners are done through the fos layouts, since they need translations #}
+{% if key|slice(0, 4) != "fos_" %}
+ <div class="alert alert-{{ key }}">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ {% if key == "success" %}
+ <h4 class="alert-heading">Well done!</h4>
+ {% elseif key == "error" %}
+ <h4 class="alert-heading">Oh snap!</h4>
+ {% elseif key == "info" %}
+ <h4 class="alert-heading">Heads up!</h4>
+ {% endif %}
+ {{ flash }}
+ </div>
+{% endif %}
+{% endfor %}
@@ -0,0 +1,95 @@
+{% extends 'knp_menu.html.twig' %}
+
+{% block item %}
+{% import "knp_menu.html.twig" as macros %}
+{% if item.displayed %}
+ {%- set attributes = item.attributes|default({}) %}
+ {%- set is_raw = attributes.raw|default(false) %}
+ {%- set is_dropdown = attributes.dropdown|default(false) %}
+ {%- set divider_prepend = attributes.divider_prepend|default(false) %}
+ {%- set divider_append = attributes.divider_append|default(false) %}
+
+{# unset bootstrap specific attributes #}
+ {%- set attributes = attributes|merge({'raw': null, 'dropdown': null, 'divider_prepend': null, 'divider_append': null }) %}
+
+ {%- if divider_prepend %}
+ {{ block('dividerElement') }}
+ {%- endif %}
+
+{# building the class of the item #}
+ {%- set classes = item.attribute('class') is not empty ? [item.attribute('class')] : [] %}
+ {%- if item.current %}
+ {%- set classes = classes|merge([options.currentClass]) %}
+ {%- elseif item.currentAncestor %}
+ {%- set classes = classes|merge([options.ancestorClass]) %}
+ {%- endif %}
+ {%- if item.actsLikeFirst %}
+ {%- set classes = classes|merge([options.firstClass]) %}
+ {%- endif %}
+ {%- if item.actsLikeLast %}
+ {%- set classes = classes|merge([options.lastClass]) %}
+ {%- endif %}
+
+{# building the class of the children #}
+ {%- set childrenClasses = item.childrenAttribute('class') is not empty ? [item.childrenAttribute('class')] : [] %}
+ {%- set childrenClasses = childrenClasses|merge(['menu_level_' ~ item.level]) %}
+
+{# adding classes for dropdown #}
+ {%- if is_dropdown %}
+ {%- set classes = classes|merge(['dropdown']) %}
+ {%- set childrenClasses = childrenClasses|merge(['dropdown-menu']) %}
+ {%- endif %}
+
+{# putting classes together #}
+ {%- if classes is not empty %}
+ {%- set attributes = attributes|merge({'class': classes|join(' ')}) %}
+ {%- endif %}
+ {%- set listAttributes = item.childrenAttributes|merge({'class': childrenClasses|join(' ') }) %}
+
+{# displaying the item #}
+ <li{{ macros.attributes(attributes) }}>
+ {%- if is_dropdown %}
+ {{ block('dropdownElement') }}
+ {%- elseif item.uri is not empty and (not item.current or options.currentAsLink) %}
+ {{ block('linkElement') }}
+ {%- elseif is_raw %}
+ {{ block('spanElementRaw') }}
+ {% else %}
+ {{ block('spanElement') }}
+ {%- endif %}
+{# render the list of children#}
+ {{ block('list') }}
+ </li>
+
+ {%- if divider_append %}
+ {{ block('dividerElement') }}
+ {%- endif %}
+{% endif %}
+{% endblock %}
+
+{% block dividerElement %}
+{% if item.level == 1 %}
+ <li class="divider-vertical"></li>
+{% else %}
+ <li class="divider"></li>
+{% endif %}
+{% endblock %}
+
+{% block dropdownElement %}
+ {%- set classes = item.linkAttribute('class') is not empty ? [item.linkAttribute('class')] : [] %}
+ {%- set classes = classes|merge(['dropdown-toggle']) %}
+ {%- set attributes = item.linkAttributes|default({}) %}
+ {%- set attributes = attributes|merge({'class': classes|join(' ')}) %}
+ {%- set attributes = attributes|merge({'data-toggle': 'dropdown'}) %}
+ <a href="#"{{ macros.attributes(attributes) }}>{{ block('label') }} <b class="caret"></b></a>
+{% endblock %}
+
+{# Label RAW and psanElementRaw are there so we can do RAW items (like the gravatar) #}
+{# it uses ->setAttribute('raw', true) in addChild() #}
+{% block label %}{{ item.label|trans }}{% endblock %}
+{% block labelraw %}{{ item.label|trans|raw }}{% endblock %}
+
+{% block linkElement %}<a href="{{ item.uri }}">{{ block('labelraw') }}</a>{% endblock %}
+
+{% block spanElement %}<p class="navbar-text">{{ block('label') }}</p>{% endblock %}
+{% block spanElementRaw %}<p class="navbar-text">{{ block('labelraw') }}</p>{% endblock %}
Oops, something went wrong.

0 comments on commit da80963

Please sign in to comment.