From 92f6a531aee741a07e28e397bb5b99ab38ed6281 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:47:23 +0000 Subject: [PATCH 1/3] Update mysqlclient requirement from <2.2.1 to <2.2.2 Updates the requirements on [mysqlclient](https://github.com/PyMySQL/mysqlclient) to permit the latest version. - [Release notes](https://github.com/PyMySQL/mysqlclient/releases) - [Changelog](https://github.com/PyMySQL/mysqlclient/blob/main/HISTORY.rst) - [Commits](https://github.com/PyMySQL/mysqlclient/compare/MySQLdb-0.3.3...v2.2.1) --- updated-dependencies: - dependency-name: mysqlclient dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- mysql-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-requirements.txt b/mysql-requirements.txt index ca302042c..4843142bf 100644 --- a/mysql-requirements.txt +++ b/mysql-requirements.txt @@ -1 +1 @@ -mysqlclient<2.2.1 +mysqlclient<2.2.2 From 863dfa7c60aa5557780eb7add7ce1fbf92875c3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:47:32 +0000 Subject: [PATCH 2/3] Bump feedparser from 6.0.10 to 6.0.11 Bumps [feedparser](https://github.com/kurtmckee/feedparser) from 6.0.10 to 6.0.11. - [Changelog](https://github.com/kurtmckee/feedparser/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/kurtmckee/feedparser/compare/6.0.10...6.0.11) --- updated-dependencies: - dependency-name: feedparser dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9dd1c3eeb..fcfc4518b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ bcrypt # Requires libffi-dev and python-dev asgiref dnspython==2.4.2 -feedparser==6.0.10 +feedparser==6.0.11 gevent==23.9.1 jsonfield==3.1.0 Pillow # Optional dependency for django-ckeditor From a876d9952b6479e93218873e25184a5f91f16f0a Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 14 Dec 2023 14:37:44 +0100 Subject: [PATCH 3/3] Added JS method to select/unselect all table rows --- modoboa/static/js/jquery.htmltable.js | 61 ++++++++++++++++----------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/modoboa/static/js/jquery.htmltable.js b/modoboa/static/js/jquery.htmltable.js index 71c866412..25737c089 100644 --- a/modoboa/static/js/jquery.htmltable.js +++ b/modoboa/static/js/jquery.htmltable.js @@ -54,28 +54,28 @@ } }, - /** - * Set the row's state, cancel the change if the current state - * and the new state are identical - */ - _set_select: function($row, selected) { - var $input = $row.find(this.options.input_selector); + /** + * Set the row's state, cancel the change if the current state + * and the new state are identical + */ + _set_select: function($row, selected) { + var $input = $row.find(this.options.input_selector); - if (this.is_selected($row) == selected) - return; - $input.prop('checked', selected); - if (selected) { - $row.addClass(this.options.row_selected_class); + if (this.is_selected($row) == selected) + return; + $input.prop('checked', selected); + if (selected) { + $row.addClass(this.options.row_selected_class); if (this.options.row_unselected_event !== undefined) { this.options.row_unselected_event($row); - } - } else { - $row.removeClass(this.options.row_selected_class); + } + } else { + $row.removeClass(this.options.row_selected_class); if (this.options.row_selected_event !== undefined) { this.options.row_selected_event($row); } - } - }, + } + }, /** * Change the selection state of a given row. @@ -90,29 +90,42 @@ var $row = $(e.target).parents(this.options.row_selector); if (this.shift_pressed && this.last_selection) { - var select = !this.is_selected($row); - var itfunc = ($row.index() >= this.last_selection.index()) ? + var select = !this.is_selected($row); + var itfunc = ($row.index() >= this.last_selection.index()) ? "next" : "prev"; - var $cur_row; - + var $cur_row; + for ($cur_row = this.last_selection; - $cur_row.length; - $cur_row = $cur_row[itfunc](this.options.row_selector)) { + $cur_row.length; + $cur_row = $cur_row[itfunc](this.options.row_selector)) { this._set_select($cur_row, select); if ($row.attr("id") == $cur_row.attr("id")) { break; } } - this.last_selection = $row; + this.last_selection = $row; return; } else if (!this.options.keep_selection && !this.ctrl_pressed && - (!this.last_selection || !this.last_selection.is($row))) { + (!this.last_selection || !this.last_selection.is($row))) { this.clear_selection(); } this.last_selection = $row; this._toggle_select($row); }, + /** + * Change the selection state of all rows. + */ + toggleSelectAll: function(value) { + if (!value) { + this.clear_selection(); + } else { + $(this.options.row_selector).each((index, row) => { + this._set_select($(row), true); + }); + } + }, + /** * Check if $row is selected or not. */