From 956dc76b3bd0e5fe3ea95f7981bac0fc6dc2bd4d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 12 Sep 2022 19:09:29 +0200 Subject: [PATCH] wip #5448 @1.5 --- .../Operations/Tools/SVGSpriteDownload.php | 8 +++++ app/Models/ToolSVGSprite.php | 34 +++++++++++++++++++ app/SubForms/ToolSVGSpriteIcon.php | 19 +++++++++++ .../link_editor.blade.php | 4 ++- resources/views/tools/sidebar.blade.php | 2 ++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/Admin/Operations/Tools/SVGSpriteDownload.php create mode 100644 app/Models/ToolSVGSprite.php create mode 100644 app/SubForms/ToolSVGSpriteIcon.php diff --git a/app/Http/Controllers/Admin/Operations/Tools/SVGSpriteDownload.php b/app/Http/Controllers/Admin/Operations/Tools/SVGSpriteDownload.php new file mode 100644 index 000000000..42604ba94 --- /dev/null +++ b/app/Http/Controllers/Admin/Operations/Tools/SVGSpriteDownload.php @@ -0,0 +1,8 @@ + 'tool-sprite', + 'singular' => 'sprite', + 'plural' => 'sprite']; + + protected $_operations = [SVGSpriteDownload::class]; + + public function setFields() + { + parent::setFields(); + + $this->addOwnerField(); + + + $this->addField('name', Text::class, __('Nom'), ['column' => true]); + $this->addField('prefix', Text::class, __('Préfixe'), ['column' => true]); + $this->addField('icons', BunchOfFieldsMultiple::class, __('Icônes'), ['bunch' => ToolSVGSpriteIcon::class, 'edit_label' => __('Edit :icon :name', ['name' => '%iconname','icon'=>'
%svgcode
']), 'add_label' => __('Ajouter une icône')]); + } +} diff --git a/app/SubForms/ToolSVGSpriteIcon.php b/app/SubForms/ToolSVGSpriteIcon.php new file mode 100644 index 000000000..9242cc48a --- /dev/null +++ b/app/SubForms/ToolSVGSpriteIcon.php @@ -0,0 +1,19 @@ +addField('iconname', Text::class, __('Nom')); + $this->addField('svgcode', Code::class, __('SVG'), ['language' => 'xml', 'wrap' => true]); + } +} diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index d2f69a6f0..9eea3b4fe 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -8,7 +8,9 @@
-
+
+ +
diff --git a/resources/views/tools/sidebar.blade.php b/resources/views/tools/sidebar.blade.php index 3d3212cb5..9aaf56579 100644 --- a/resources/views/tools/sidebar.blade.php +++ b/resources/views/tools/sidebar.blade.php @@ -29,4 +29,6 @@ + -- 2.39.5