add ordoring field & Display Activity type by Category

This commit is contained in:
Jean-Francois Monfort
2021-05-06 11:53:07 +02:00
parent f836114d84
commit 1f1b9c594f
10 changed files with 134 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
@@ -21,7 +22,12 @@ class ActivityTypeCategoryType extends AbstractType
'No' => false
),
'expanded' => true
));
))
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5
])
;
}
public function configureOptions(OptionsResolver $resolver): void

View File

@@ -7,6 +7,7 @@ use Chill\ActivityBundle\Form\Type\ActivityFieldPresence;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -39,6 +40,10 @@ class ActivityTypeType extends AbstractType
return $this->translatableStringHelper->localize($activityTypeCategory->getName());
},
])
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5
])
;
$fields = [