Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from pilot/feature/multi-events
Feature/multi events
- Loading branch information
Showing
73 changed files
with
1,420 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Feature: Event settings | ||
As an admin | ||
I should be able to edit event settings | ||
In order to update my event description | ||
|
||
Background: | ||
Given following "Event": | ||
| ref | title | description | startDate | endDate | venue | email | host | | ||
| event | My event | My another awesome event! | 2014-10-10 | 2014-10-12 | Burj Khalifa Tower | eventator@email.com | http://event.com | | ||
| event2 | His event | His another awesome event! | 2014-11-15 | 2014-11-16 | Kuala-lumpur Tower | eventator@gmail.com | http://event2.com | | ||
And following "EventTranslation": | ||
| locale | | ||
| ru_RU | | ||
|
||
@wip | ||
Scenario: Admin should have access to the event manage | ||
Given I am sign in as admin | ||
When I follow "Events" | ||
Then I should see "Events" | ||
And the "Title" field should contain "My event" | ||
And the "Event Description" field should contain "My super awesome event!" | ||
And the "Venue Place" field should contain "Burj Khalifa Tower" | ||
|
||
@wip | ||
Scenario: Admin should have able to update event settings | ||
Given I am sign in as admin | ||
When I follow "Settings" | ||
And I fill in "Brief Description" with "Awesome event" | ||
And I select "United Arab Emirates" from "Country" | ||
And I fill in "State" with "Dubai" | ||
And I fill in "City" with "Dubai" | ||
And I fill in "Twitter" with "myevent" | ||
And I press "Update" | ||
Then I should see "Event settings updated." | ||
And I should see "Awesome event" | ||
And the "City" field should contain "Dubai" | ||
|
||
@wip @javascript | ||
Scenario: Admin should have able to update Russian event settings | ||
Given I am sign in as admin | ||
When I follow "Settings" | ||
And I follow "ru" | ||
And I fill in "title" with "Мое событие" | ||
And I press "Update" | ||
Then I should see "Event settings updated." | ||
When I follow "ru" | ||
Then the "title" field should contain "Мое событие" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Event/EventBundle/Controller/Backend/EventController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Event\EventBundle\Controller\Backend; | ||
|
||
use Symfony\Component\HttpFoundation\Request; | ||
use Event\EventBundle\Controller\Controller; | ||
use Event\EventBundle\Entity\Event; | ||
use Event\EventBundle\Entity\Translation\EventTranslation; | ||
use Event\EventBundle\Form\Type\EventType; | ||
|
||
class EventController extends Controller | ||
{ | ||
public function indexAction() | ||
{ | ||
return $this->render('EventEventBundle:Backend/Event:index.html.twig', array( | ||
'events' => $this->getRepository('EventEventBundle:Event')->findAll() | ||
)); | ||
} | ||
|
||
public function manageAction(Request $request, $id = null) | ||
{ | ||
if ($id === null) { | ||
$entity = new Event(); | ||
$entity = $this->initObjectLocales($entity, new EventTranslation()); | ||
} else { | ||
$entity = $this->findOr404('EventEventBundle:Event', $id); | ||
} | ||
|
||
$form = $this->createForm(new EventType(), $entity); | ||
|
||
if ($request->getMethod() === 'POST') { | ||
$form->handleRequest($request); | ||
|
||
if ($form->isValid()) { | ||
$this->getManager()->persist($entity); | ||
$this->getManager()->flush(); | ||
|
||
$this->setSuccessFlash(sprintf('Event %s updated.', $entity->getTitle())); | ||
|
||
return $this->redirectToRoute('backend_event'); | ||
} | ||
} | ||
|
||
return $this->render('EventEventBundle:Backend/Event:manage.html.twig', [ | ||
'event' => $entity, | ||
'form' => $form->createView() | ||
]); | ||
} | ||
|
||
public function deleteAction($id) | ||
{ | ||
$this->isGrantedAdmin(); | ||
|
||
$entity = $this->findOr404('EventEventBundle:Event', $id); | ||
$this->getManager()->remove($entity); | ||
$this->getManager()->flush(); | ||
|
||
$this->setSuccessFlash('Eevent deleted.'); | ||
|
||
return $this->redirectToRoute('backend_event'); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.