From 87604176b29e94c665cea2cc7e12cdd143510419 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 25 Sep 2020 13:54:49 +0200 Subject: [PATCH 1/4] fonticon possible sur les pages --- .../CoreBundle/Form/Type/IconChoiceType.php | 95 + .../CoreBundle/Resources/config/services.yml | 10 + .../fonts/fontawesome/fontawesome-icons.json | 58179 ++++++++++++++++ .../Resources/views/Form/fields.html.twig | 2 + .../Resources/views/Include/footer.html.twig | 18 + .../src/Cadoles/PortalBundle/Entity/Page.php | 31 + .../PortalBundle/Form/PageSubmitType.php | 5 + .../Form/PageUpdateEditorType.php | 6 + .../PortalBundle/Form/PageUpdateToolType.php | 9 +- .../PortalBundle/Form/PageUpdateURLType.php | 6 + .../Form/PageUpdateWidgetType.php | 6 + .../Resources/views/Page/pages.html.twig | 59 +- .../Resources/views/Page/submit.html.twig | 1 + .../views/Page/updateeditor.html.twig | 1 + .../Resources/views/Page/updatetool.html.twig | 1 + .../Resources/views/Page/updateurl.html.twig | 1 + .../views/Page/updatewidget.html.twig | 1 + 17 files changed, 58422 insertions(+), 9 deletions(-) create mode 100644 src/ninegate-1.0/src/Cadoles/CoreBundle/Form/Type/IconChoiceType.php create mode 100644 src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/fonts/fontawesome/fontawesome-icons.json diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/Type/IconChoiceType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/Type/IconChoiceType.php new file mode 100644 index 00000000..35c38354 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/Type/IconChoiceType.php @@ -0,0 +1,95 @@ +fontawesomeIconsFile = $fontawesomeIconsFile; + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + // Pass this flag is necessary to render the label as raw. + // See below the twig field template for more details. + $view->vars['raw_label'] = true; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'attr' => [ + // It's the key of the solution and can be done in many ways. + // Now, the rendered {% endspaceless %} {% endblock file_widget %} + + diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/footer.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/footer.html.twig index 6ef2a7b2..524f827c 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/footer.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/footer.html.twig @@ -91,6 +91,24 @@