This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new d56daa77 Add moderator count
d56daa77 is described below
commit d56daa77e81b08b59570729ead237116eeb92a1c
Author: Sebb <[email protected]>
AuthorDate: Thu Mar 9 12:59:55 2023 +0000
Add moderator count
---
www/members/mailing_lists.cgi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/www/members/mailing_lists.cgi b/www/members/mailing_lists.cgi
index 5a193504..78edec07 100755
--- a/www/members/mailing_lists.cgi
+++ b/www/members/mailing_lists.cgi
@@ -54,6 +54,8 @@ else
filter = nil
end
+mod_counts = ASF::MLIST.list_moderators(nil).first.map {|x,y| [x,
y.length]}.to_h
+
_html do
_body? do
_whimsy_body(
@@ -74,6 +76,11 @@ _html do
_p do
_ "This script shows the flag settings for all mailing lists, and
attempts to interpret them."
end
+ _p %{
+ 'mod count' is the number of moderators for the list.
+ Lists should ideally have at least 3 moderators.
+ The count is enclosed in [] if the list is 'open' or 'subonly',
because posts don't need to be moderated in that case.
+ }
_p %{
Note that there are other settings which affect the behaviour, and
the initial behaviour defined
by the flags can be modified by local changes to the editor script.
@@ -89,6 +96,7 @@ _html do
_th 'list', data_sort: 'string'
_th "flags #{filter}", data_sort: 'string'
_th 'Type (mu)', data_sort: 'string'
+ _th 'mod count', data_sort: 'int'
_th 'Known (z)', data_sort: 'string'
_th 'Private (s)', data_sort: 'string'
_th 'Filter (x)', data_sort: 'string'
@@ -107,6 +115,15 @@ _html do
_ mu
_ type(mu)
end
+ count = mod_counts["#{list}@#{domain}"]
+ if %w{subonly open}.include? type(mu)
+ # ensure unmoderated lists are not penalised for having few
moderators
+ _td data_sort_value: count+100 do
+ _ "[#{count}]"
+ end
+ else
+ _td count
+ end
_td flags.include? 'z'
_td flags.include? 's'
_td flags.include? 'x'