From 97fa90d2655defae5fe0e3014fa8ee3c8babc54b Mon Sep 17 00:00:00 2001 From: Manon Bourgognon <manon.bourgognon@epitech.eu> Date: Thu, 8 Oct 2020 18:34:49 +0200 Subject: [PATCH 1/2] Refresh multiple-field attribute doc --- .../Mixins/widget-mixin.rst | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/source/import_documentation/Mixins/widget-mixin.rst b/source/import_documentation/Mixins/widget-mixin.rst index 8f935db..7dd3e31 100644 --- a/source/import_documentation/Mixins/widget-mixin.rst +++ b/source/import_documentation/Mixins/widget-mixin.rst @@ -125,19 +125,28 @@ Attributes ``multiple-[field]`` ~~~~~~~~~~~~~~~~~~~~ + This attribute allows to manage containers inside a resource. Show ``[field]`` as multiple field containing one widget for each child. + Multiple accepts a container's URL as value (= the ``field`` must refer to an URL) + and creates an intern component to display it, its resource is this container. + Multiple widget can be specified, example: ``multiple-skills="my-custom-multiple-widget"``. If argument is used without value, default multiple widget is used. - All attributes starting by ``each`` will be applied on each child, - without the prefix ``each``. - - ``each-label-[field]``: label of each child of multiple widget - - ``each-class-[field]``: class of each child of multiple widget - - ``each-range-[field]``: range value of each child of multiple widget + It can be used in : + + - Solid-display : the field in ``multiple-field`` will be transfered in a solid-multiple component by default. + If ``multiple-field`` is followed by something, this will be transfered inside a + solid-display (``multiple-[field]-empty-widget``, ``multiple-[field]-next``) . + - Solid-form : the "field" in ``multiple-field`` will be transfered in a + solid-form-multiple component by default. + Thanks to the multiple attribute, it is possible to add and remove elements. + + In both cases, the widget of ``multiple-[field]`` can be modified. For ``solid-form`` only: -- GitLab From 27dbb35597c8a409300b4d4d6bd98c3b50e25747 Mon Sep 17 00:00:00 2001 From: Matthieu Fesselier <matthieu.fesselier@gmail.com> Date: Fri, 9 Oct 2020 09:59:55 +0200 Subject: [PATCH 2/2] update: update multiple doc --- .../Mixins/grouper-mixin.rst | 16 ++++++++-- .../Mixins/widget-mixin.rst | 32 ++++++++++++------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/source/import_documentation/Mixins/grouper-mixin.rst b/source/import_documentation/Mixins/grouper-mixin.rst index 047b670..9b82705 100644 --- a/source/import_documentation/Mixins/grouper-mixin.rst +++ b/source/import_documentation/Mixins/grouper-mixin.rst @@ -33,11 +33,23 @@ Attributes When used with the pagination, each group is paginated. -``group-by-widget`` +``group-widget`` ~~~~~~~~~~~~~~~~~~~ - default: ``solid-group-div`` + default: ``solid-group-default`` The name of the widget to use as a group widget. + It takes the name of the group as a ``value`` and put content in a ``div[data-content]``. + Here is an example of a custom group widget: + + .. code:: html + + <solid-widget name="custom-group"> + <template> + <h2>${value}</h2> + <section data-content></section> + </template> + </solid-widget> + ``group-class`` diff --git a/source/import_documentation/Mixins/widget-mixin.rst b/source/import_documentation/Mixins/widget-mixin.rst index 7dd3e31..83c8c52 100644 --- a/source/import_documentation/Mixins/widget-mixin.rst +++ b/source/import_documentation/Mixins/widget-mixin.rst @@ -125,12 +125,10 @@ Attributes ``multiple-[field]`` ~~~~~~~~~~~~~~~~~~~~ - This attribute allows to manage containers inside a resource. - Show ``[field]`` as multiple field containing - one widget for each child. + Allows to display the container ``[field]`` nested in the current resource. - Multiple accepts a container's URL as value (= the ``field`` must refer to an URL) - and creates an intern component to display it, its resource is this container. + It takes a container URI as a value, fetch all the resources + of this container and display them. Multiple widget can be specified, example: ``multiple-skills="my-custom-multiple-widget"``. If argument is used @@ -139,14 +137,24 @@ Attributes It can be used in : - - Solid-display : the field in ``multiple-field`` will be transfered in a solid-multiple component by default. - If ``multiple-field`` is followed by something, this will be transfered inside a - solid-display (``multiple-[field]-empty-widget``, ``multiple-[field]-next``) . - - Solid-form : the "field" in ``multiple-field`` will be transfered in a - solid-form-multiple component by default. - Thanks to the multiple attribute, it is possible to add and remove elements. + - ``solid-display``: a nested ``solid-display`` will be created with the container URI as + data-src. + All attributes of the form ``multiple-[field]-[attribute]`` are transfered + on the nested ``solid-display`` as ``[attribute]``. + For example, to choose the fields you want to display, you can set: + ``multiple-[field]-fields="name, @id"`` - In both cases, the widget of ``multiple-[field]`` can be modified. + .. code:: html + + <solid-display + data-src="http://server/users/1/" + fields="skills" + multiple-skills + multiple-skills-fields="name" + ></solid-display> + + - ``solid-form`` : all the resources of the container are displayed in a text widget. + Buttons are automatically created to add and remove elements. For ``solid-form`` only: -- GitLab