Skip to content

Commit

Permalink
Link accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
GCalmels committed Dec 5, 2014
1 parent 4284ac6 commit 56df14e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/CG/PlatformBundle/Controller/PlatformController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,11 @@ public function listEventsAction()
return $this->render('CGPlatformBundle:Event:list.html.twig', array('events' => $events));
}

public function showRatingsAction()
{
// Les évènements avec le plus de dons
$repository = $this->getDoctrine()->getRepository('CGPlatformBundle:Event');
$events = $repository->findAllByDonations();
}

}
6 changes: 6 additions & 0 deletions src/CG/PlatformBundle/Entity/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ public function findByEnabledWithOrder($enabled)
{
return $this->findBy(array('enabled' => $enabled), array('id' => 'DESC'));
}

public function findAllByDonations()
{

return $this->findBy(array(), array)
}

}
5 changes: 4 additions & 1 deletion src/CG/PlatformBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ cg_platform_events_list:
defaults: { _controller: CGPlatformBundle:Platform:listEvents }
cg_platform_event_view:
path: /event/{id}
defaults: { _controller: CGPlatformBundle:Platform:showEvent }
defaults: { _controller: CGPlatformBundle:Platform:showEvent }
cg_platform_ratings:
path: /ratings
defaults: { _controller: CGPlatformBundle:Platform:showRatings }
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ event:
page_header: Évènement
list:
page_header: Les évènements
menu:
events: Les évènements
ratings: Classements

2 changes: 1 addition & 1 deletion src/CG/PlatformBundle/Resources/views/Event/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<p>{{ 'event.name'|trans }}: {{ event.name }}</p>
<p>{{ 'event.long_description'|trans }}: {{ event.longDescription }}</p>
<p>{{ 'event.location'|trans }}: {{ event.location }}</p>
<p>{{ 'event.link'|trans }}: {{ event.link|date("d/m/Y") }}</p>
<p>{{ 'event.link'|trans }}: {{ event.link }}</p>
<p>{{ 'event.worldwide_day'|trans }}: {{ event.worldwideDay|date("d/m/Y") }}</p>
<p>{{ 'event.date'|trans }}: {{ event.date|date("d/m/Y") }}</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li>
<a href="{{ path('cg_platform_events_list')}}">Les évènements</a>
<a href="{{ path('cg_platform_events_list')}}">{{ 'menu.events'|trans({}, 'CGPlatformBundle') }}</a>
<a href="{{ path('cg_platform_ratings')}}">{{ 'menu.ratings'|trans({}, 'CGPlatformBundle') }}</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
Expand Down

0 comments on commit 56df14e

Please sign in to comment.