diff --git a/src/Hackspace/Bundle/CalciferBundle/Controller/EventController.php b/src/Hackspace/Bundle/CalciferBundle/Controller/EventController.php index 3c83ff1..3397192 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Controller/EventController.php +++ b/src/Hackspace/Bundle/CalciferBundle/Controller/EventController.php @@ -305,4 +305,33 @@ class EventController extends Controller ); } + + /** + * Copies a Event entity. + * + * @Route("/termine/{slug}/kopieren", name="_copy") + * @Method("GET") + * @Template("CalciferBundle:Event:new.html.twig") + */ + public function copyAction(Request $request, $slug) { + /** @var EntityManager $em */ + $em = $this->getDoctrine()->getManager(); + + /** @var EntityRepository $repo */ + $repo = $em->getRepository('CalciferBundle:Event'); + + /** @var Event $entity */ + $entity = $repo->findOneBy(['slug' => $slug]); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find Event entity.'); + } + + $entity->id = null; + + return array( + 'entity' => $entity, + + ); + } } diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss index b109b51..6b615cb 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss @@ -6,7 +6,7 @@ } } - .startdate,.location,.url,.edit,.delete { + .startdate,.location,.url,.action { display: inline; margin: 0; margin-right: 0.5rem; diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/edit.html.twig b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/edit.html.twig index 07d2d67..a004f41 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/edit.html.twig +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/edit.html.twig @@ -4,8 +4,7 @@ {% stylesheets filter="compass" "@CalciferBundle/Resources/assets/css/jquery.datetimepicker.scss" "@CalciferBundle/Resources/assets/css/events.scss" - "@CalciferBundle/Resources/assets/css/leaflet.scss" - %} + "@CalciferBundle/Resources/assets/css/leaflet.scss" %} {% endstylesheets %} {% endblock %} @@ -14,8 +13,7 @@ {% javascripts "@CalciferBundle/Resources/assets/js/jquery.datetimepicker.js" "@CalciferBundle/Resources/assets/js/events.js" - "@CalciferBundle/Resources/assets/js/leaflet.js" - %} + "@CalciferBundle/Resources/assets/js/leaflet.js" %} {% endjavascripts %} {% endblock %} diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig index a74377a..f451908 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig @@ -5,17 +5,24 @@ {% if (detail|default(false)) %} -
+
-+
+ ++ + + Kopieren + +
{% endif %}