]> git.agnieray.net Git - galette.git/commitdiff
GNU GPL and variables's documentation in templates
authorGuillaume AGNIERAY <dev@agnieray.net>
Sat, 25 Feb 2023 13:11:41 +0000 (14:11 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 26 Feb 2023 17:42:46 +0000 (18:42 +0100)
galette/templates/default/elements/js/loader.js.twig
galette/templates/default/elements/js/modal.js.twig
galette/templates/default/elements/js/modal_action.js.twig

index b4bf39c78316ef8969a3f598cddeeb0ba37ae5bf..99c20ca5c1edeaea7a03449ad9ff74720efc928e 100644 (file)
@@ -1,3 +1,43 @@
+{#
+/**
+ * @file
+ * Show and hide loaders on ajax requests.
+ *
+ * Copyright © 2009-2023 The Galette Team
+ *
+ * This file is part of Galette (https://galette.eu).
+ *
+ * Galette is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Galette is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Galette. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * @category  Authentication
+ * @package   Galette
+ *
+ * @author    Johan Cwiklinski <johan@x-tnd.be>
+ * @copyright 2009-2023 The Galette Team
+ * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or later
+ * @link      https://galette.eu
+ * @since     Available since 1.0dev - 2022-06-08
+ *
+ * Available variables:
+ *
+ * - selector: element on which to apply the loader.
+ * - loader: loader's variation to use (on button, action's list or page dimmer).
+ * - loader_text: text to display in the loader.
+ *
+ */
+#}
+
 {% if (loader is not defined) %}
     {% set loader = (selector is not defined) ? 'dimmer' : 'inverted dimmer' %}
     {% set loader_parent = (selector is not defined) ? 'body' : selector %}
index 0d2894e92eeed38f5fbc5bd807ea6e7ecf69af9b..0292ffb9e8c81ecb6649e75843cbd5a360ba4988 100644 (file)
@@ -1,3 +1,65 @@
+{#
+/**
+ * @file
+ * Fomantic UI Modal.
+ *
+ * Copyright © 2009-2023 The Galette Team
+ *
+ * This file is part of Galette (https://galette.eu).
+ *
+ * Galette is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Galette is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Galette. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * @category  Authentication
+ * @package   Galette
+ *
+ * @author    Guillaume Agniéray <dev@agnieray.net>
+ * @author    Johan Cwiklinski <johan@x-tnd.be>
+ * @copyright 2009-2023 The Galette Team
+ * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or later
+ * @link      https://galette.eu
+ * @since     Available since 1.0dev - 2023-02-23
+ *
+ * Available variables:
+ *
+ * - modal_selector: existing inline HTML modal.
+ * - modal_without_title: true to hide modal's header.
+ * - modal_title: value coming from js code.
+ * - modal_title_twig: value coming from twig.
+ * - modal_without_content: true to hide modal's content.
+ * - modal_content: value coming from js code.
+ * - modal_content_twig: value coming from twig.
+ * - modal_class: class(es) applied on modal.
+ * - modal_content_class: class(es) applied on modal's content.
+ * - modal_other_options: hash to add other options { option: value }.
+ * - modal_onshow: modal's onShow callback.
+ * - modal_onapprove: modal's onApprove callback.
+ * - modal_ondeny: modal's onDeny callback.
+ * - modal_additional_button: hash to add a third button { text, icon, color, click }.
+ * - modal_deny_only: true hides the approve button.
+ * - modal_approve_text: modal's approve button's text.
+ * - modal_approve_icon: modal's approve button's icon.
+ * - modal_approve_color: modal's approve button's color.
+ * - modal_approve_click: modal's approve button's onclick event.
+ * - modal_cancel_text: modal's cancel button's icon.
+ * - modal_cancel_icon: modal's cancel button's icon.
+ * - modal_cancel_color: modal's cancel button's icon.
+ * - modal_cancel_click: modal's cancel button's onclick event.
+ * - modal_classname: string to override default Fomantic UI classes.
+ *
+ */
+#}
+
 {% if modal_selector is not defined %}
     $.modal({
     {% if modal_without_title is not defined %}
index 3d6e108273a81c35e24dcc9cb9c7caa68df4eabd..cef0b288c37230b5eec32c90d368f362757d5036 100644 (file)
@@ -1,3 +1,64 @@
+{#
+/**
+ * @file
+ * Single click event using Fomantic UI Modal.
+ *
+ * Copyright © 2009-2023 The Galette Team
+ *
+ * This file is part of Galette (https://galette.eu).
+ *
+ * Galette is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Galette is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Galette. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * @category  Authentication
+ * @package   Galette
+ *
+ * @author    Guillaume Agniéray <dev@agnieray.net>
+ * @author    Johan Cwiklinski <johan@x-tnd.be>
+ * @copyright 2009-2023 The Galette Team
+ * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or later
+ * @link      https://galette.eu
+ * @since     Available since 1.0dev - 2023-02-17
+ *
+ * Available variables:
+ *
+ * - selector: actionable element.
+ * - actionurl: URL where to send the request.
+ * - method: HTTP method to use for the request.
+ * - datatype: type of data expected in response.
+ * - extra_success: additionnal code at the begining of the success callback.
+ *
+ * - loader_selector: element on which to apply the loader.
+ * - loader: loader's variation to use (on button, action's list or page dimmer).
+ * - loader_text: text to display in the loader.
+ *
+ * - modal_title: value coming from js code.
+ * - modal_title_twig: value coming from twig.
+ * - modal_content: value coming from js code.
+ * - modal_content_twig: value coming from twig.
+ * - modal_class: class(es) applied on modal.
+ * - modal_content_class: class(es) applied on modal's content.
+ * - modal_onapprove: modal's onApprove callback.
+ * - modal_approve_text: modal's approve button's text.
+ * - modal_approve_icon: modal's approve button's icon.
+ * - modal_cancel_text: modal's cancel button's text.
+ *
+ * @see loader.js.twig
+ * @see modal.js.twig
+ *
+ */
+#}
+
 {% set selector = selector is defined ? selector : ".single-custom-action" %}
 {% set method = method is defined ? method : "GET" %}
 {% set datatype = datatype is defined ? datatype : "html" %}
@@ -22,7 +83,7 @@
         var _url = _this.attr('href');
         $.ajax({
             url: {% if actionurl is not defined %}_url{% else %}'{{ actionurl|raw }}'{% endif %},
-            type: "{{ method }}",
+            method: "{{ method }}",
             datatype: "{{ datatype }}",
             {% include "elements/js/loader.js.twig" with {
                 loader: loader,