Add basic title edition

Fix #218
I mean basic, because there is no javascript at all. It could be a nice edit-in-place. But for the moment, it is simple.
This commit is contained in:
Jeremy Benoist
2015-06-02 18:54:34 +02:00
parent 51d9699fa1
commit 82d6d9cb06
8 changed files with 147 additions and 13 deletions

View File

@ -0,0 +1,36 @@
<?php
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class EditEntryType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', 'text', array('required' => true))
->add('is_public', 'checkbox', array('required' => false))
// @todo: add autocomplete
// ->add('tags', 'entity', array(
// 'class' => 'Wallabag\CoreBundle\Entity\Tag',
// 'choice_translation_domain' => true,
// ))
->add('save', 'submit')
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
));
}
public function getName()
{
return 'entry';
}
}

View File

@ -6,7 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class EntryType extends AbstractType
class NewEntryType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{