forked from wallabag/wallabag
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:
36
src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
Normal file
36
src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
Normal 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';
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
{
|
||||
Reference in New Issue
Block a user