diff --git a/source/_static/images/import_documentation/Widgets-API-Developers-OLD.png b/source/_static/images/import_documentation/Widgets-API-Developers-OLD.png new file mode 100644 index 0000000000000000000000000000000000000000..a5c2b17b19b692dcd069d31fb3382463608a3d72 Binary files /dev/null and b/source/_static/images/import_documentation/Widgets-API-Developers-OLD.png differ diff --git a/source/_static/images/import_documentation/Widgets-API-Developers.png b/source/_static/images/import_documentation/Widgets-API-Developers.png index a5c2b17b19b692dcd069d31fb3382463608a3d72..4de3d2dc44e88d4190d98d4b9f3afc80a2e36e65 100644 Binary files a/source/_static/images/import_documentation/Widgets-API-Developers.png and b/source/_static/images/import_documentation/Widgets-API-Developers.png differ diff --git a/source/import_documentation/Components/Solid-Ac-Checker2.rst b/source/import_documentation/Components/Solid-Ac-Checker2.rst new file mode 100644 index 0000000000000000000000000000000000000000..ab09d80ff6edd5d744c9c2682b9b00d2bb3892dd --- /dev/null +++ b/source/import_documentation/Components/Solid-Ac-Checker2.rst @@ -0,0 +1,50 @@ +.. _solid-ac-checker: +solid-ac-checker +================ + +Hides an element from the page if the current user doesn’t have the +required permissions on it. + +.. code:: html + + <solid-ac-checker permission="acl:Write" bind-resources> + <solid-route name="member-edit"> + <div>Edit</div> + </solid-route> + </solid-ac-checker> + +Mixins +------ + +This component uses the following mixins: + + * :ref:`store-mixin <store-mixin>` + + +Please check their documentation to know more about their capabilities. + +Personnal attributes +-------------------- + +``permission`` +~~~~~~~~~~~~~~ + Displays the element if the user has the specified right + +``no-permission`` +~~~~~~~~~~~~~~~~~ + Displays the element if the user has not the specified right + +Possible values: + +- `acl:Read <https://github.com/solid/web-access-control-spec#aclread>`__ +- `acl:Write <https://github.com/solid/web-access-control-spec#aclwrite>`__ +- `acl:Append <https://github.com/solid/web-access-control-spec#aclappend>`__ +- `acl:Control <https://github.com/solid/web-access-control-spec#aclcontrol>`__ + + +Mixin attributes +----------------- + +.. include:: ../Mixins/store-mixin.request + start-line : 21 + end-line : 122 diff --git a/source/import_documentation/Components/Solid-Widget.rst b/source/import_documentation/Components/Solid-Widget.rst index db7c48bfda7a614abee45912bc3f60950220db79..e9f8688968243be2babb625b706d9b13e4521621 100644 --- a/source/import_documentation/Components/Solid-Widget.rst +++ b/source/import_documentation/Components/Solid-Widget.rst @@ -29,7 +29,7 @@ In a ``solid-widget``, you have access to these values: - ``label``: if defined, label of the current field - ``range``: if defined, range of the current field -.. +.. note:: NB: Do not forget to define your custom template in a ``<template>`` tag. Otherwise, your widget will not be declared properly. diff --git a/source/import_documentation/Mixins/counter-mixin.rst b/source/import_documentation/Mixins/counter-mixin.rst index 0d6859307000f53250cfe690eac78aa37bde3f99..0129985cf2b12f280ea8dc977b2cb3bd27daf26f 100644 --- a/source/import_documentation/Mixins/counter-mixin.rst +++ b/source/import_documentation/Mixins/counter-mixin.rst @@ -27,4 +27,3 @@ Attributes fields="username" counter-template="<strong>${counter} users here</strong>" ></solid-display> - diff --git a/source/import_documentation/Mixins/filter-mixin.rst b/source/import_documentation/Mixins/filter-mixin.rst index 35546ce080e884118991afe9d62df91e6a31e0ec..a14069201f9501e67601874271662330a3a9f377 100644 --- a/source/import_documentation/Mixins/filter-mixin.rst +++ b/source/import_documentation/Mixins/filter-mixin.rst @@ -41,8 +41,6 @@ Attributes ``search-fields`` **deprecated** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - The properties you want to use to filter the list of resources. You can add multiple fields, separated by a comma. diff --git a/source/import_documentation/Mixins/grouper-mixin.rst b/source/import_documentation/Mixins/grouper-mixin.rst index c22dcdb462bdad3c43301c0fb49ab92437580458..3f331ea5f040c24dd989858a99e3553645b24a89 100644 --- a/source/import_documentation/Mixins/grouper-mixin.rst +++ b/source/import_documentation/Mixins/grouper-mixin.rst @@ -54,7 +54,6 @@ Attributes </template> </solid-widget> - ``group-class`` ~~~~~~~~~~~~~~~ The name of the class to add on each group widget. \ No newline at end of file diff --git a/source/import_documentation/Widgets/Reference.rst b/source/import_documentation/Widgets/Reference.rst index 7816b484647230b6c579d92ca6e7cb3354604bfd..b627cadb4927849f9fa7b3a80386cea86070619e 100644 --- a/source/import_documentation/Widgets/Reference.rst +++ b/source/import_documentation/Widgets/Reference.rst @@ -3,7 +3,9 @@ Widgets API Reference ===================== -Widgets are created at the moment you ask for it for the first time. +Widgets are tools that allow to choose, precise how to display data. + +They are created at the moment you ask for it for the first time. The name of the widget is analyzed to build a widget which uses the features and template you want. Here is a schema of how it works: @@ -11,22 +13,31 @@ Here is a schema of how it works: .. figure:: ../../_static/images/import_documentation/Widgets-API-Developers.png :alt: Widget API 1 -A widget is built like this. - ``solid-[type]-[template]-[features]`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*All the keywords must be separated by ``-`` but can be put in any order.* +Its name must begin by "**solid-**", followed by at least a ``type`` (except for ``default`` type) and a ``template``, and eventually one or several ``features``. + +*All the keywords must be separated by an hyphen``-``, it is recommended to keep that order (to harmonise widget names writing).* ``type`` ++++++++ -Can be ``display`` , ``form`` or ``set``. Will select the directory of template to use. +It refers to the "kind" of data to display : + +- ``display`` refers to a display formatting, +- ``form`` to display a form element (``<input>``, ``<textarea>``, ``<select>``, etc), +- ``set`` to precise how to display values of fields in :ref:`sets <widget-mixin>`. + +It will select the directory of template to use. ``template`` ++++++++++++ +Name of the template to use. + +Each type has several templates. They specify how to use or display the value(s) and/or to indicate the HTML tag to use. -Name of the template to use. Available templates: +Available templates : - ``display`` directory @@ -42,6 +53,7 @@ Name of the template to use. Available templates: - ``textarea``: set ``value`` in a ``<textarea>``. - ``richtext``: set ``value`` in an ``<div>`` and initialize a light rich text editor by using ``Quill``. - ``checkbox``: create a checkbox, which is checked if ``value == true``. + - ``email``: set ``value`` in an ``<input>`` of type ``email``. - ``date``: set ``value`` in an ``<input>`` of type ``date``. - ``rangedate``: set 2 values in 2 ``<input>`` of type ``date``. Used for filtering with min and max. Possible to add ``start-value-[field]`` and ``end-value-[field]`` attributes to set min and max values. Date format to follow : "YYYY-MM-DD". Each attribute accepts ``today`` as value. @@ -69,7 +81,7 @@ Name of the template to use. Available templates: - ``div``: inserts widgets in a ``<div>`` tag. - ``ul``: inserts widgets in a ``<ul>`` tag. -- **default** (no template keyword defined) +- **default** (no type keyword defined) - ``action``: Displays a link inside a ``<solid-link>`` tag with ``src`` for the ``data-src`` attribute, ``value`` for the ``next`` attribute and ``label`` as text content. @@ -79,7 +91,7 @@ Name of the template to use. Available templates: ``features`` ++++++++++++ -Features to add to the widget. You can choose as many as you want +They allows to modify the behavior or the display of the widget. It is possible to add one or several features to the widget's name : - ``label``: adds a ``label`` before the template. Uses the attribute ``name`` if ``label`` is not defined. - ``labellast``: adds a ``label`` after the template. Uses the attribute ``name`` if ``label`` is not defined. diff --git a/source/import_documentation/framework_guide/list-base-components.rst b/source/import_documentation/framework_guide/list-base-components.rst index 6651a62a38c66e3f09cce0e76081093bef8ae7f5..6b133b35841e0ea127fae54aba9dec38e1ee1eb8 100644 --- a/source/import_documentation/framework_guide/list-base-components.rst +++ b/source/import_documentation/framework_guide/list-base-components.rst @@ -9,13 +9,13 @@ The base components are : .. toctree:: :maxdepth: 1 - /import_documentation/Components/Solid-Ac-Checker - /import_documentation/Components/Solid-Calendar - /import_documentation/Components/Solid-Delete - /import_documentation/Components/Solid-Display - /import_documentation/Components/Solid-Form - /import_documentation/Components/Solid-Form-Search - /import_documentation/Components/Solid-Lang - /import_documentation/Components/Solid-Map - /import_documentation/Components/Solid-Table - /import_documentation/Components/Solid-Widget + /import_documentation/Components/Solid-Ac-Checker : to manage permissions + /import_documentation/Components/Solid-Calendar : to display and manage data on a calendar + /import_documentation/Components/Solid-Delete : to delete data + /import_documentation/Components/Solid-Display : to display data + /import_documentation/Components/Solid-Form : to create forms and modify data + /import_documentation/Components/Solid-Form-Search : to search data + /import_documentation/Components/Solid-Lang : to manage language + /import_documentation/Components/Solid-Map : to display and manage data on a map + /import_documentation/Components/Solid-Table : to manage data on a table + /import_documentation/Components/Solid-Widget : to create custom elements (pattern) to display data diff --git a/source/import_documentation/framework_guide/list-external-components.rst b/source/import_documentation/framework_guide/list-external-components.rst index 93ee4ef6bf1947d81b0e05613d673e24b53187b3..495cfb6c884d04ecf470b94342d6febe1b5c2d44 100644 --- a/source/import_documentation/framework_guide/list-external-components.rst +++ b/source/import_documentation/framework_guide/list-external-components.rst @@ -7,5 +7,5 @@ however they can be used to add useful features such as authentication and route .. toctree:: :maxdepth: 1 - /import_documentation/Components/Solid-Auth - /import_documentation/Components/Solid-Router + /import_documentation/Components/Solid-Auth : to manage authentification of users + /import_documentation/Components/Solid-Router : to create menu and navigate between pages