From 187dec530c88785bdc15558f9f87526df92ec0f1 Mon Sep 17 00:00:00 2001 From: Kylar13 Date: Wed, 18 May 2016 20:07:17 +0200 Subject: [PATCH] Everything now truly works -> VALIDATED --- .../views/default/view_profile.html.twig | 50 ++++++------- app/config/routing.yml | 1 + composer.lock | 72 +++++++++---------- .../Controller/ProfileController.php | 5 +- src/AppBundle/Entity/Product.php | 7 +- src/AppBundle/Form/CommentType.php | 6 +- 6 files changed, 70 insertions(+), 71 deletions(-) diff --git a/app/Resources/views/default/view_profile.html.twig b/app/Resources/views/default/view_profile.html.twig index 7d577f8..49efeff 100644 --- a/app/Resources/views/default/view_profile.html.twig +++ b/app/Resources/views/default/view_profile.html.twig @@ -57,39 +57,17 @@
  • this is a handsome dude {{ comment.title|upper }} -

    by {{ comment.author.username }} {{ comment.author.username }} on {{ comment.getDateString }}
    +

    by {{ comment.author.username }} on {{ comment.getDateString }}

    {{ comment.comment|raw }}

    {% if is_granted("EDIT", comment) %} - mode_edit + mode_edit delete {% endif %}
  • - - - @@ -141,4 +119,26 @@ + + + {% endblock %} \ No newline at end of file diff --git a/app/config/routing.yml b/app/config/routing.yml index 06db29a..2ee02ab 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -232,6 +232,7 @@ delete_comment: _controller: AppBundle:Profile:deleteComment _format: html methods: + - GET - POST resend_email: diff --git a/composer.lock b/composer.lock index 02f94cd..98f8d1e 100644 --- a/composer.lock +++ b/composer.lock @@ -1006,16 +1006,16 @@ }, { "name": "paragonie/random_compat", - "version": "v1.4.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "c7e26a21ba357863de030f0b9e701c7d04593774" + "reference": "088c04e2f261c33bed6ca5245491cfca69195ccf" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/paragonie/random_compat/zipball/c7e26a21ba357863de030f0b9e701c7d04593774", - "reference": "c7e26a21ba357863de030f0b9e701c7d04593774", + "url": "https://github.com/gitapi/repos/paragonie/random_compat/zipball/088c04e2f261c33bed6ca5245491cfca69195ccf", + "reference": "088c04e2f261c33bed6ca5245491cfca69195ccf", "shasum": "" }, "require": { @@ -1050,7 +1050,7 @@ "pseudorandom", "random" ], - "time": "2016-03-18 20:34:03" + "time": "2016-04-03 06:00:07" }, { "name": "predis/predis", @@ -1478,16 +1478,16 @@ }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "8328069d9f5322f0e7b3c3518485acfdc94c3942" + "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/symfony/polyfill-intl-icu/zipball/8328069d9f5322f0e7b3c3518485acfdc94c3942", - "reference": "8328069d9f5322f0e7b3c3518485acfdc94c3942", + "url": "https://github.com/gitapi/repos/symfony/polyfill-intl-icu/zipball/0f8dc2c45f69f8672379e9210bca4a115cd5146f", + "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f", "shasum": "" }, "require": { @@ -1500,7 +1500,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1532,20 +1532,20 @@ "portable", "shim" ], - "time": "2016-02-26 16:18:12" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "reference": "dff51f72b0706335131b00a7f49606168c582594" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://github.com/gitapi/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", "shasum": "" }, "require": { @@ -1557,7 +1557,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1591,20 +1591,20 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-php56", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9" + "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/symfony/polyfill-php56/zipball/4d891fff050101a53a4caabb03277284942d1ad9", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9", + "url": "https://github.com/gitapi/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", + "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", "shasum": "" }, "require": { @@ -1614,7 +1614,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1647,30 +1647,30 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-php70", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "386c1be9cad3ab531425211919e78c37971be4ce" + "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/symfony/polyfill-php70/zipball/386c1be9cad3ab531425211919e78c37971be4ce", - "reference": "386c1be9cad3ab531425211919e78c37971be4ce", + "url": "https://github.com/gitapi/repos/symfony/polyfill-php70/zipball/a42f4b6b05ed458910f8af4c4e1121b0101b2d85", + "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0", + "paragonie/random_compat": "~1.0|~2.0", "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1706,20 +1706,20 @@ "portable", "shim" ], - "time": "2016-01-28 22:42:02" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-util", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4" + "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/symfony/polyfill-util/zipball/8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", + "url": "https://github.com/gitapi/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", + "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", "shasum": "" }, "require": { @@ -1728,7 +1728,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1758,7 +1758,7 @@ "polyfill", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/swiftmailer-bundle", diff --git a/src/AppBundle/Controller/ProfileController.php b/src/AppBundle/Controller/ProfileController.php index d3d5369..908cfb7 100644 --- a/src/AppBundle/Controller/ProfileController.php +++ b/src/AppBundle/Controller/ProfileController.php @@ -433,7 +433,6 @@ public function showAction($username){ } } - dump($userComment); $canComment2 = false; foreach($this->getUser()->getPurchases() as $purchase){ if($purchase->getProduct()->getOwner() == $user){ @@ -446,6 +445,7 @@ public function showAction($username){ $formCreate = $this->createForm(CommentType::class, $newComment, array('username' => $username)); + dump($userComment); $formEdit = $this->createForm(CommentType::class, $userComment, array('username' => $username, 'route' => 'edit_comment')); @@ -530,10 +530,7 @@ public function deleteCommentAction($username){ } } - dump($userComment); - if(!is_null($userComment)){ - dump("Hallo"); $this->getDoctrine()->getManager()->remove($userComment); $this->getDoctrine()->getManager()->flush(); } diff --git a/src/AppBundle/Entity/Product.php b/src/AppBundle/Entity/Product.php index edfc4f0..502958c 100644 --- a/src/AppBundle/Entity/Product.php +++ b/src/AppBundle/Entity/Product.php @@ -75,6 +75,9 @@ class Product /** * @var DateTime + * @Validator\Range( + * min="now" + * ) * * @ORM\Column(name="expiring_date", type="datetime") */ @@ -83,9 +86,7 @@ class Product /** * @var string * - * @Validator\Range( - * min="now" - * ) + * * @ORM\Column(name="picture", type="string", length=550) * */ diff --git a/src/AppBundle/Form/CommentType.php b/src/AppBundle/Form/CommentType.php index cebf7e6..3942bb8 100644 --- a/src/AppBundle/Form/CommentType.php +++ b/src/AppBundle/Form/CommentType.php @@ -25,11 +25,11 @@ public function __construct(UrlGeneratorInterface $router) public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->setAction($this->router->generate($options['route'], array('username' => $options['username']))) - ->setMethod('POST') ->add('title', TextType::class) ->add('comment', FroalaEditorType::class) - ->add('submit', SubmitType::class); + ->add('submit', SubmitType::class) + ->setAction($this->router->generate($options['route'], array('username' => $options['username']))) + ->setMethod('POST'); }