diff --git a/source/import_documentation/Components/Solid-Auth.rst b/source/import_documentation/Components/Solid-Auth.rst index 912614513112d243b5e73fe2ad4fa685d3c6eb4a..000b88ee161f90e1293e46b542582fb4ba652d8f 100644 --- a/source/import_documentation/Components/Solid-Auth.rst +++ b/source/import_documentation/Components/Solid-Auth.rst @@ -8,16 +8,15 @@ Installation -------------- Initialize ``sib-auth`` in your HTML file: - .. code:: html +.. code:: html - <script type="module" src="https://unpkg.com/@startinblox/oidc@latest"></script> - <sib-auth> - <sib-auth-provider - data-authority="https://test-paris.happy-dev.fr/openid/" - data-id="paris" - > - </sib-auth-provider> - </sib-auth> + <script type="module" src="https://unpkg.com/@startinblox/oidc@latest"></script> + <sib-auth> + <sib-auth-provider + data-authority="https://test-paris.happy-dev.fr/openid/" + data-id="paris" + ></sib-auth-provider> + </sib-auth> `You'll find here the detail of the attributes configuration. <https://github.com/IdentityModel/oidc-client-js/wiki#usermanager>`__ @@ -26,13 +25,14 @@ Set an OIDC provider to your server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Django package associated is there => https://github.com/jblemee/django-oidc-provider + More documentation here => https://django-oidc-provider.readthedocs.io/en/latest/ Don't forget to set up your RSA key: - .. code:: bash +.. code:: bash - python3 ./manage.py creatersakey + python3 ./manage.py creatersakey Setup your login button @@ -40,36 +40,56 @@ Setup your login button Here is an example to make you understand the logic: - .. code:: html +.. code:: html - <button id="login">Login</button> - <!-- wherever you want in your interface --> + <button id="login">Login</button> + <!-- wherever you want in your interface --> - <script> - // wherever you want in your project - document.querySelector('#login').addEventListener('click', () => { - document.querySelector('sib-auth').login() - }); - </script> + <script> + // wherever you want in your project + document.querySelector('#login').addEventListener('click', () => { + document.querySelector('sib-auth').login() + }); + </script> -.. _bind-user: -bind-user +Attributes ---------- - To associate the currently logged in user to a component, add the bind-user attribute to it. - It will set its ``data-src`` attribute to the currently logged in user's resource URL. - Example: - .. code:: html +.. _bind-user: +``bind-user`` +~~~~~~~~~~~~~ +To associate the currently logged in user to a component, add the bind-user attribute to it. +It will set its ``data-src`` attribute to the currently logged in user's resource URL. +Example: + +.. code:: html + + <sib-conversation bind-user></sib-conversation> + +will result in: + +.. code:: html + + <sib-conversation data-src="https://your-domain/your-user-uri/3" bind-user></sib-conversation> + - <sib-conversation bind-user></sib-conversation> +``auto-login`` +~~~~~~~~~~~~~~ +If set, ``auto-login`` will automatically redirect the user to the login page of his +provider if he's not authenticated yet. - will result in: +Example: - .. code:: html +.. code:: html - <sib-conversation data-src="https://your-domain/your-user-uri/3" bind-user></sib-conversation> + <sib-auth auto-login> + <sib-auth-provider + data-authority="https://test-paris.happy-dev.fr/openid/" + data-id="paris" + ></sib-auth-provider> + </sib-auth> -Methods available +Methods ------------------ ``login`` diff --git a/source/import_documentation/Components/Solid-Form-Search.rst b/source/import_documentation/Components/Solid-Form-Search.rst index 5fdeac06d844e5db2f33d74771dc8d9939e48d8d..93b75e5bb57c0861b072be117fa504ae283e67e5 100644 --- a/source/import_documentation/Components/Solid-Form-Search.rst +++ b/source/import_documentation/Components/Solid-Form-Search.rst @@ -37,26 +37,26 @@ Attributes List of fields used to perform the search. ``label-[field]`` -~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~ When displaying a form, the default labels are the fields names of the model. If you want something fancier, you can set this attribute. i.e. ``label-username="Your name"`` ``submit-button`` -~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~ *Available from version 0.13* Text of the submit button to create in the search form. If the attribute is not defined, no button will be added and the form will trigger the search on change. ``range-[field]`` -~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~ URL of a container which list the accepted values for the field ``[field]``. It’s particularly useful with a dropdown field. ``enum-[field]`` -~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~ *Available from version 0.13* List of values of your choice for the field ``[field]``. @@ -70,6 +70,29 @@ Attributes * ``enum-[field]="value1 = a, value2 = b, value3 = c"``: each value will be displayed and "a", "b", "c" will be loaded in value attribute. +``start-value-[field]`` +~~~~~~~~~~~~~~~~~~~~~~~ + *Available from version 0.15* + + Allows to define the value of the first ``<input>`` to filter data. + Only usable with ``solid-form-rangedate`` and ``solid-form-rangenumber``. + In ``solid-form-rangedate``, it can be defined to ``today``. + +``end-value-[field]`` +~~~~~~~~~~~~~~~~~~~~~ + *Available from version 0.15* + + Allows to define the value of the second ``<input>`` to filter data. + Only usable with ``solid-form-rangedate`` and ``solid-form-rangenumber``. + In ``solid-form-rangedate``, it can be defined to ``today``. + +``autocomplete-[field]`` +~~~~~~~~~~~~~~~~~~~~~~~~ + *Available from version 0.15* + + Equal to the value ``off``, it cancels the automatic entry of values in the relevant ``[field]``. + It can be added to ``inputs``, ``textarea`` and ``select``. + Widgets ------- By default, the widget used is ``<solid-form-label-text>``. Cf the diff --git a/source/import_documentation/Components/Solid-Form.rst b/source/import_documentation/Components/Solid-Form.rst index 6fd65a767b8793dbe2d2bef3ded5df74866e4dcc..5e9b45a800a7af33a1b5ed91ce5c8edf20c57930 100644 --- a/source/import_documentation/Components/Solid-Form.rst +++ b/source/import_documentation/Components/Solid-Form.rst @@ -111,6 +111,12 @@ Attributes Add this attribute to create a dialog box linked with the submit button of the solid-form. Its value matches the message displayed in the dialog box. +``autocomplete-[field]`` +~~~~~~~~~~~~~~~~~~~~~~~~ + *Available from version 0.15* + + Equal to the value ``off``, it cancels the automatic entry of values in the relevant ``[field]``. + It can be added to ``inputs``, ``textarea`` and ``select``. Widgets ------- diff --git a/source/import_documentation/Widgets/Reference.rst b/source/import_documentation/Widgets/Reference.rst index b617f45867aa6f91e4818ad485f91b546c3cb13f..622f2330cdd290090d4a7946f4f973641cdd7943 100644 --- a/source/import_documentation/Widgets/Reference.rst +++ b/source/import_documentation/Widgets/Reference.rst @@ -40,9 +40,11 @@ A widget is built like this. - ``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``. - ``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. + - ``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. - ``number``: set ``value`` in an ``<input>`` of type ``number``. - - ``rangenumber``: set 2 values in 2 ``<input>`` of type ``number``. Used for filtering with min and max. + - ``rangenumber``: set 2 values in 2 ``<input>`` of type ``number``. Used for filtering with min and max. + Possible to add ``start-value-[field]`` and ``end-value-[field]`` attributes to set min and max values. - ``hidden``: set ``value`` in an ``<input>`` of type ``hidden``. - ``dropdown``: set ``value`` in a ``<select>``. The list is provided via the ``range`` attribute, which expects a container’s URL, or via the ``enum`` attribute, which takes a list of the values separated by commas. - ``radio``: set ``value`` in a list of radio buttons. The list is provided via the ``range`` attribute, which expects a container’s URL, or via the ``enum`` attribute, which takes a list of the values separated by commas. @@ -57,8 +59,8 @@ A widget is built like this. - ``set`` - ``default``: inserts widgets directly in the set tag. - - ``div``: inserts widgets in a ``<div>`` tag - - ``ul``: inserts widgets in a ``<ul>`` tag + - ``div``: inserts widgets in a ``<div>`` tag. + - ``ul``: inserts widgets in a ``<ul>`` tag. - **default** (no template keyword defined) @@ -72,15 +74,18 @@ A widget is built like this. ++++++++++++ Features to add to the widget. You can choose as many as you want - - ``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 - - ``autocompletion``: initializes the ``SlimSelect`` plugin. Works only with dropdowns + - ``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. + - ``autocompletion``: initializes the ``SlimSelect`` plugin. Works only with dropdowns. - ``autolink``: analyzes widget content, and transforms all links in anchor. - - ``mailto``: adds ``mailto:`` at the beginning of an ``href`` attribute. Works only with links - - ``tel``: adds ``tel:`` at the beginning of an ``href`` attribute. Works only with links - - ``blank``: adds an attribute ``target="_blank"``. Works only with links + - ``mailto``: adds ``mailto:`` at the beginning of an ``href`` attribute. Works only with links. + - ``tel``: adds ``tel:`` at the beginning of an ``href`` attribute. Works only with links. + - ``blank``: adds an attribute ``target="_blank"``. Works only with links. - ``placeholder``: adds a placeholder in the input. Uses the attribute ``name`` or ``label`` if ``placeholder`` is not defined. Works only with input widgets. - ``date``: transforms the value in a date, in the browser’s default locale format. - ``datetime``: transforms the value in a date and time, in the browser’s default locale format. - - ``multiline``: Shows a value on multiple lines (replace ``\n`` by ``<br>``) - - ``markdown``: Takes markdown code and displays formatted text. Works only with a display template (value, div, link). + - ``multiline``: shows a value on multiple lines (replace ``\n`` by ``<br>``). + - ``markdown``: takes markdown code and displays formatted text. Works only with a display template (value, div, link). + - ``addable``: adds a ``<solid-form>`` that allows to add data on the field concerned. + It accepts attributes from :ref:`solid-form <solid-form>` by using ``addable-[field]-[attribute]="value"`` format. + If ``addable-data-src`` is not provided, the solid-form will use the URI in ``range-[field]`` as data-src, if declared. diff --git a/source/import_documentation/attributes-list.rst b/source/import_documentation/attributes-list.rst index 9cc0c99347558cf67beaf1abb5fc813117723a95..1fde6c9e73c44895658b17ee6197b771b4d405b8 100644 --- a/source/import_documentation/attributes-list.rst +++ b/source/import_documentation/attributes-list.rst @@ -5,6 +5,11 @@ List of attributes (core framework) ~~~~~~~~~~~~~~~~~~ * :ref:`widget-mixin <widget-mixin>` +``autocomplete-[field]`` +~~~~~~~~~~~~~~~~~~~~~~~~ + * :ref:`solid-form <solid-form>` + * :ref:`solid-form-search <solid-form-search>` + ``child-[field]`` ~~~~~~~~~~~~~~~~~ * :ref:`solid-display <solid-display>` @@ -51,6 +56,10 @@ List of attributes (core framework) ~~~~~~~~~~~~~~~~ * :ref:`list-mixin <list-mixin>` +``end-value-[field]`` +~~~~~~~~~~~~~~~~~~~~~ + * :ref:`solid-form-search <solid-form-search>` + ``enum-[field]`` ~~~~~~~~~~~~~~~~ * :ref:`solid-form <solid-form>` @@ -183,6 +192,10 @@ List of attributes (core framework) ~~~~~~~~~~~~~~~~~~~~ * :ref:`required-mixin <required-mixin>` +``start-value-[field]`` +~~~~~~~~~~~~~~~~~~~~~~~ + * :ref:`solid-form-search <solid-form-search>` + ``(search-fields)`` deprecated ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * :ref:`filter-mixin <filter-mixin>`