protected function createRemoveResourceForm(Context $context, $message = null, $footer = true, array $options = [])
    {
        if (null === $message) {
            $message = 'ekyna_core.message.remove_confirm';
        }

        $resource = $context->getResource();

        $action = $this->generateResourcePath($resource, 'remove');

        $form = $this
            ->createFormBuilder(null, array_merge([
                'action' => $action,
                'attr' => ['class' => 'form-horizontal'],
                'method' => 'POST',
                'admin_mode' => true,
                '_redirect_enabled' => true,
            ], $options))
            ->add('confirm', 'checkbox', [
                'label' => $message,
                'attr' => ['align_with_widget' => true],
                'required' => true,
                'constraints' => [
                    new Constraints\IsTrue(),
                ]
            ])
            ->getForm()
        ;

        if ($footer) {
            $referer = $context->getRequest()->headers->get('referer');
            if (0 < strlen($referer) && false === strpos($referer, $action)) {
                $cancelPath = $referer;
            } else {
                if ($this->hasParent()) {
                    $cancelPath = $this->generateUrl(
                        $this->getParent()->getConfiguration()->getRoute('show'),
                        $context->getIdentifiers()
                    );
                } else {
                    $cancelPath = $this->generateResourcePath($resource);
                }
            }

            $form->add('actions', 'form_actions', [
                'buttons' => [
                    'remove' => [
                        'type' => 'submit',
                        'options' => [
                            'button_class' => 'danger',
                            'label' => 'ekyna_core.button.remove',
                            'attr' => ['icon' => 'trash'],
                        ],
                    ],
                    'cancel' => [
                        'type' => 'button',
                        'options' => [
                            'label' => 'ekyna_core.button.cancel',
                            'button_class' => 'default',
                            'as_link' => true,
                            'attr' => [
                                'class' => 'form-cancel-btn',
                                'icon' => 'remove',
                                'href' => $cancelPath,
                            ],
                        ],
                    ],
                ],
            ]);
        }

        return $form;
    }