Skip to content

Commit

Permalink
[BetterSelection] Le nom est affiche dans le menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnugat committed May 23, 2012
1 parent 637ad5d commit b2c91b8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
22 changes: 16 additions & 6 deletions app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<link rel="apple-touch-icon" sizes="72x72" href="{{ asset('bundles/bisoulandfront/images/apple-touch-icon-72x72.png') }}">
<link rel="apple-touch-icon" sizes="114x114" href="{{ asset('bundles/bisoulandfront/images/apple-touch-icon-114x114.png') }}">
{% endblock %}

{% block beforeJs %}
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
{% endblock %}
</head>

<body>
Expand All @@ -36,20 +40,26 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>

<a class="brand" href="{{ path('homepage') }}">
Bisouland
</a>
<nav class="nav-collapse collapse">
{{ knp_menu_render("BisoulandFrontBundle:Builder:mainMenu", {"currentClass": "active"}) }}
</nav>

<div class="nav-collapse">
<nav>
{{ knp_menu_render("BisoulandFrontBundle:Builder:mainMenu", {"currentClass": "active"}) }}
</nav>

<nav class="pull-right">
{{ knp_menu_render("BisoulandBeingsBundle:Builder:selectedMenu", {"currentClass": "active"}) }}
</nav>
</div>
</div>
</div>
</header>

<div class="container">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
{% render 'BisoulandBeingsBundle:Update:index' %}
{% render 'BisoulandBeingsBundle:Selection:index' %}

<div class="content">
{% block view %}{% endblock %}
Expand Down Expand Up @@ -116,5 +126,5 @@
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="{{ asset('js/bootstrap.min.js') }}"></script>

{% block javascript %}{% endblock %}
{% block afterJs %}{% endblock %}
</html>
26 changes: 26 additions & 0 deletions src/Bisouland/BeingsBundle/Menu/Builder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Bisouland\BeingsBundle\Menu;

use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;

class Builder extends ContainerAware
{
public function selectedMenu(FactoryInterface $factory, array $options)
{
$request = $this->container->get('request');
$selectedBeingName = $request->getSession()->get('nameOfSelectedBeing');

$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'nav');
$menu->setCurrentUri($request->getRequestUri());

$menu->addChild($selectedBeingName, array(
'route' => 'beings_view',
'routeParameters' => array('name' => $selectedBeingName),
));

return $menu;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</article>
{% endblock %}

{% block javascript %}
{% block afterJs %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('js/jquery.dataTables.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/bisoulandbeings/js/table-sorting.js') }}"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% block title %}Bisouland v2 - Amoureux {{ being.name }}{% endblock %}

{% block css %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('css/jquery.countdown.css') }}" />
{% endblock %}
Expand Down Expand Up @@ -105,7 +105,7 @@
</article>
{% endblock %}

{% block javascript %}
{% block afterJs %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('js/jquery.countdown.pack.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/jquery.countdown-fr.js') }}"></script>
Expand Down

0 comments on commit b2c91b8

Please sign in to comment.