some improvement to the Update / create event pages

- i18n of all the form
- add a title to each page
- chill layout of each page
- add flash message on successfully creation and update action

For the update page, (see #23), the user is not allowed to update
the center

close #23
close #2
This commit is contained in:
2016-03-24 23:00:45 +01:00
parent cf7f8a929b
commit c9ce3aca96
5 changed files with 61 additions and 20 deletions

View File

@@ -41,6 +41,9 @@ class EventController extends Controller
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
$this->addFlash('success', $this->get('translator')
->trans('The event was created'));
return $this->redirect($this->generateUrl('chill_event__event_show', array('event_id' => $entity->getId())));
}
@@ -186,6 +189,7 @@ class EventController extends Controller
'method' => 'PUT',
));
$form->remove('center');
$form->add('submit', 'submit', array('label' => 'Update'));
@@ -211,6 +215,9 @@ class EventController extends Controller
if ($editForm->isValid()) {
$em->flush();
$this->addFlash('success', $this->get('translator')
->trans('The event was updated'));
return $this->redirect($this->generateUrl('chill_event__event_edit', array('event_id' => $event_id)));
}