]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
Entry: handle originUrl in edit form, update translations
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / EditEntryType.php
index 0cb29881834db98ebe0ffee1b20aca29f28e9696..4bceaf5f96595914eabfce42c51e675f396c0970 100644 (file)
@@ -3,7 +3,6 @@
 namespace Wallabag\CoreBundle\Form\Type;
 
 use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
 use Symfony\Component\Form\Extension\Core\Type\SubmitType;
 use Symfony\Component\Form\Extension\Core\Type\TextType;
 use Symfony\Component\Form\FormBuilderInterface;
@@ -14,22 +13,31 @@ class EditEntryType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('title', TextType::class, array('required' => true))
-            ->add('is_public', CheckboxType::class, array('required' => false))
-            // @todo: add autocomplete
-            // ->add('tags', 'entity', array(
-            //     'class' => 'Wallabag\CoreBundle\Entity\Tag',
-            //     'choice_translation_domain' => true,
-            // ))
-            ->add('save', SubmitType::class)
+            ->add('title', TextType::class, [
+                'required' => true,
+                'label' => 'entry.edit.title_label',
+            ])
+            ->add('url', TextType::class, [
+                'disabled' => true,
+                'required' => false,
+                'label' => 'entry.edit.url_label',
+            ])
+            ->add('origin_url', TextType::class, [
+                'required' => false,
+                'property_path' => 'originUrl',
+                'label' => 'entry.edit.origin_url_label',
+            ])
+            ->add('save', SubmitType::class, [
+                'label' => 'entry.edit.save_label',
+            ])
         ;
     }
 
     public function configureOptions(OptionsResolver $resolver)
     {
-        $resolver->setDefaults(array(
+        $resolver->setDefaults([
             'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
-        ));
+        ]);
     }
 
     public function getBlockPrefix()