Skip to content

Commit

Permalink
Change banner management
Browse files Browse the repository at this point in the history
  • Loading branch information
mbontemps committed May 26, 2012
1 parent 8121131 commit 1287a9c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 297 deletions.
4 changes: 4 additions & 0 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ parameters:
solarium.host: 127.0.0.1
solarium.port: 8983
solarium.path: /solr

banner:
text: "Hello|[Edgar]"
url: "http://knpbundles.com"
4 changes: 4 additions & 0 deletions app/config/parameters.yml.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ parameters:
solarium.host: 127.0.0.1
solarium.port: 8983
solarium.path: /solr

banner:
text: "Hello|[World]"
url: "http://knpbundles.com"
8 changes: 4 additions & 4 deletions src/Knp/Bundle/KnpBundlesBundle/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function bannerAction()
{
$translator = $this->get('translator');
$maxId = $translator->trans('menu.promo.nb');
$id = rand(0, $maxId - 1);
$url = $translator->trans('menu.promo.'.$id.'.url');
$text = $translator->trans('menu.promo.'.$id.'.text');

$banner = $this->container->getParameter('banner');
$text = $banner['text'];
$url = $banner['url'];

return $this->render('KnpBundlesBundle:Main:banner.html.twig', array(
'url' => $url,
'id' => $id,
'text' => $text,
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@ menu:
evolution: "Evolution"
addBundleManually: "Register a bundle"

promo:
nb: 5
0:
text: "Get a [training]| by KnpLabs' ninjas!"
url: "http://knplabs.com/training/symfony2"
1:
text: "Work with [ninja developers]| at KnpLabs!"
url: "http://knplabs.com/"
2:
text: "Get [coding assistance]|from a KnpLabs ninja!"
url: "http://knplabs.com/service/symfony-support"
3:
text: "[Join] the KnpLabs team!|In Nantes/France or remotely."
url: "http://knplabs.com/jobs"
4:
text: "Follow [KnpLabs on Twitter]!"
url: "http://twitter.com/knplabs"

search:
list:
title: "Search"
Expand Down
144 changes: 0 additions & 144 deletions src/Knp/Bundle/KnpBundlesBundle/Resources/translations/messages.fr.yml

This file was deleted.

126 changes: 0 additions & 126 deletions src/Knp/Bundle/KnpBundlesBundle/Resources/translations/messages.pl.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="promo" onclick="_gaq.push(['_trackEvent', 'banner', '{{ id }}', '{{ app.request.locale }}']);">
<div id="promo" onclick="_gaq.push(['_trackEvent', 'banner');">
<a class="img" href="{{ url }}"><img src="{{ asset('bundles/knpbundles/images/edgar.png') }}" /></a>
<div class="bulle">
{{ text|replace({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@
<dt><a href="http://knplabs.com">KnpLabs</a></dt>
<dd>
<ul>
<li><a href="http://knplabs.com/training/symfony2">Symfony training (World)</a></li>
<li><a href="http://knplabs.fr/formation/symfony2" hreflang="fr" lang="fr">Formation Symfony (France)</a></li>
<li><a href="http://knplabs.co.uk/training/symfony2">Symfony training in London</a></li>
<li><a href="http://knplabs.com/training/symfony2">Symfony training</a> (World)</li>
<li><a href="http://knplabs.fr/formation/symfony2" hreflang="fr" lang="fr">Formation Symfony</a> (France)</li>
<li><a href="http://knpuniversity.com/">Symfony tutorial</a> screencast</li>

<li><a href="http://twitter.com/knplabs">Knp on Twitter</a></li>
<li><a href="http://twitter.com/knplabs">KnpLabs on Twitter</a></li>
<li><a href="http://behat.org">Behat: BDD framework for PHP</a></li>
</ul>
</dd>
Expand Down

0 comments on commit 1287a9c

Please sign in to comment.