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 b400a90 data_sort needs thead/tbody to work
b400a90 is described below
commit b400a908e142d0c8abbb17e829108c534c006a68
Author: Sebb <[email protected]>
AuthorDate: Tue Mar 22 11:57:51 2022 +0000
data_sort needs thead/tbody to work
---
www/members/archivers.cgi | 196 +++++++++++++++++++++--------------------
www/members/subscriptions.cgi | 48 +++++-----
www/members/subscriptions2.cgi | 48 +++++-----
3 files changed, 152 insertions(+), 140 deletions(-)
diff --git a/www/members/archivers.cgi b/www/members/archivers.cgi
index 03a2c28..6202047 100755
--- a/www/members/archivers.cgi
+++ b/www/members/archivers.cgi
@@ -95,106 +95,110 @@ _html do
}
) do
- _table.table do
- _tr do
- _th 'list', data_sort: 'string'
- _th 'Private?', data_sort: 'string'
- _th 'MBOX'
- _th 'PONY'
- _th 'MAIL-ARCHIVE'
- _th 'MARKMAIL'
- _th 'Other archivers', data_sort: 'string'
- end
- ASF::MLIST.list_archivers do |dom, list, arcs|
- # arcs = array of arrays, each of which is [archiver, archiver_type,
"public"|"private"]
-
- lid = "#{list}@#{dom}"
-
- next if NOT_ARCHIVED.include? lid
-
- options = Hash.new # Any fields have warnings/errors?
-
- arcleft = arcs.map(&:first) # unused
-
- # in case there are multiple archivers with different classifications,
we
- # join all the unique entries.
- # This is equivalent to first if there is only one, but will produce
- # a string such as 'privatepublic' if there are distinct entries
- # However it generates an empty string if there are no entries.
-
- mbox = findarcs(arcs, :MBOX, arcleft)
-
- pubprv = mbox[0] # get privacy setting from MBOX entry
-
- next if pubprv == 'restricted' # Don't show these
-
- if mbox[0].empty?
- mbox = 'Missing'
- options[:mbox] = {class: 'warning'}
- end
-
- pony = findarcs(arcs, :PONY, arcleft)
- if ! pony[0].empty?
- options[:pony] = {class: 'danger'} if pony[0] != pubprv
- else
- pony = 'Missing'
- options[:pony] = {class: 'warning'}
- end
-
- mail_archive = findarcs(arcs, :MAIL_ARCH, arcleft)
- if ! mail_archive[0].empty?
- options[:mail_archive] = {class: 'danger'} if mail_archive[0] !=
pubprv
- elsif pubprv == 'private'
- mail_archive = 'N/A'
- else
- mail_archive = 'Missing'
- options[:mail_archive] = {class: 'warning'}
- end
-
- markmail = findarcs(arcs, :MARKMAIL, arcleft)
- if ! markmail[0].empty?
- options[:markmail] = {class: 'danger'} if (markmail[0] != pubprv) ||
markmail[1].size > 1
- elsif pubprv == 'private'
- markmail = 'N/A'
- else
- markmail = 'Missing'
- options[:markmail] = {class: 'warning'}
- end
-
- options[:arcleft] = {class: 'warning'} if arcleft.size > 0
-
- if show_mailarchive
- needs_attention = options.keys.length > 0
- else # don't show missing mail-archive
- needs_attention = options.reject { |k, _v| k == :mail_archive &&
mail_archive == 'Missing' }.length > 0
+ _table.table do
+ _thead_ do
+ _tr do
+ _th 'list', data_sort: 'string'
+ _th 'Private?', data_sort: 'string'
+ _th 'MBOX'
+ _th 'PONY'
+ _th 'MAIL-ARCHIVE'
+ _th 'MARKMAIL'
+ _th 'Other archivers', data_sort: 'string'
+ end
end
- next unless show_all || needs_attention # only show errors unless want
all
-
- # This is not a warning per-se
- options[:pubprv] = {class: 'warning'} if pubprv == 'private'
-
- _tr do
- _td lid
- _td pubprv, options[:pubprv]
- _td options[:mbox] do showdets(mbox) end
- _td options[:pony] do showdets(pony) end
- _td options[:mail_archive] do showdets(mail_archive) end
- _td options[:markmail] do showdets(markmail) end
- _td arcleft.sort, options[:arcleft]
+ _tbody do
+ ASF::MLIST.list_archivers do |dom, list, arcs|
+ # arcs = array of arrays, each of which is [archiver,
archiver_type, "public"|"private"]
+
+ lid = "#{list}@#{dom}"
+
+ next if NOT_ARCHIVED.include? lid
+
+ options = Hash.new # Any fields have warnings/errors?
+
+ arcleft = arcs.map(&:first) # unused
+
+ # in case there are multiple archivers with different
classifications, we
+ # join all the unique entries.
+ # This is equivalent to first if there is only one, but will
produce
+ # a string such as 'privatepublic' if there are distinct entries
+ # However it generates an empty string if there are no entries.
+
+ mbox = findarcs(arcs, :MBOX, arcleft)
+
+ pubprv = mbox[0] # get privacy setting from MBOX entry
+
+ next if pubprv == 'restricted' # Don't show these
+
+ if mbox[0].empty?
+ mbox = 'Missing'
+ options[:mbox] = {class: 'warning'}
+ end
+
+ pony = findarcs(arcs, :PONY, arcleft)
+ if ! pony[0].empty?
+ options[:pony] = {class: 'danger'} if pony[0] != pubprv
+ else
+ pony = 'Missing'
+ options[:pony] = {class: 'warning'}
+ end
+
+ mail_archive = findarcs(arcs, :MAIL_ARCH, arcleft)
+ if ! mail_archive[0].empty?
+ options[:mail_archive] = {class: 'danger'} if mail_archive[0] !=
pubprv
+ elsif pubprv == 'private'
+ mail_archive = 'N/A'
+ else
+ mail_archive = 'Missing'
+ options[:mail_archive] = {class: 'warning'}
+ end
+
+ markmail = findarcs(arcs, :MARKMAIL, arcleft)
+ if ! markmail[0].empty?
+ options[:markmail] = {class: 'danger'} if (markmail[0] !=
pubprv) || markmail[1].size > 1
+ elsif pubprv == 'private'
+ markmail = 'N/A'
+ else
+ markmail = 'Missing'
+ options[:markmail] = {class: 'warning'}
+ end
+
+ options[:arcleft] = {class: 'warning'} if arcleft.size > 0
+
+ if show_mailarchive
+ needs_attention = options.keys.length > 0
+ else # don't show missing mail-archive
+ needs_attention = options.reject { |k, _v| k == :mail_archive &&
mail_archive == 'Missing' }.length > 0
+ end
+ next unless show_all || needs_attention # only show errors unless
want all
+
+ # This is not a warning per-se
+ options[:pubprv] = {class: 'warning'} if pubprv == 'private'
+
+ _tr do
+ _td lid
+ _td pubprv, options[:pubprv]
+ _td options[:mbox] do showdets(mbox) end
+ _td options[:pony] do showdets(pony) end
+ _td options[:mail_archive] do showdets(mail_archive) end
+ _td options[:markmail] do showdets(markmail) end
+ _td arcleft.sort, options[:arcleft]
+ end
+ end
end
end
- end
- _script %{
- var table = $(".table").stupidtable();
- table.on("aftertablesort", function (event, data) {
- var th = $(this).find("th");
- th.find(".arrow").remove();
- var dir = $.fn.stupidtable.dir;
- var arrow = data.direction === dir.ASC ? "↑" : "↓";
- th.eq(data.column).append('<span class="arrow">' + arrow +'</span>');
- });
- }
+ _script %{
+ var table = $(".table").stupidtable();
+ table.on("aftertablesort", function (event, data) {
+ var th = $(this).find("th");
+ th.find(".arrow").remove();
+ var dir = $.fn.stupidtable.dir;
+ var arrow = data.direction === dir.ASC ? "↑" : "↓";
+ th.eq(data.column).append('<span class="arrow">' + arrow +'</span>');
+ });
+ }
end
end
end
diff --git a/www/members/subscriptions.cgi b/www/members/subscriptions.cgi
index 65dc499..d8a1914 100755
--- a/www/members/subscriptions.cgi
+++ b/www/members/subscriptions.cgi
@@ -79,30 +79,34 @@ _html do
end
_table.table do
- _tr do
- _th 'id', data_sort: 'string'
- _th 'email', data_sort: 'string'
- _th 'name', data_sort: 'string'
+ _thead_ do
+ _tr do
+ _th 'id', data_sort: 'string'
+ _th 'email', data_sort: 'string'
+ _th 'name', data_sort: 'string'
+ end
end
- subscriptions.sort.each do |id, person, email|
- _tr_ do
- if id.include? '*'
- _td.text_danger id
- elsif not person.asf_member?
- _td.text_danger id, title: 'Non Member', data_sort_value: '1'
- elsif person.asf_member? != true
- _td(data_sort_value: '2') {_em id, title: 'Emeritus'}
- elsif not ldap.include? person
- _td(data_sort_value: '3') {_strong.text_danger id, title: 'Not in
LDAP'}
- else
- _td id
- end
- _td email
+ _tbody do
+ subscriptions.sort.each do |id, person, email|
+ _tr_ do
+ if id.include? '*'
+ _td.text_danger id
+ elsif not person.asf_member?
+ _td.text_danger id, title: 'Non Member', data_sort_value: '1'
+ elsif person.asf_member? != true
+ _td(data_sort_value: '2') {_em id, title: 'Emeritus'}
+ elsif not ldap.include? person
+ _td(data_sort_value: '3') {_strong.text_danger id, title: 'Not
in LDAP'}
+ else
+ _td id
+ end
+ _td email
- if id.include? '*'
- _td ''
- else
- _td person.public_name
+ if id.include? '*'
+ _td ''
+ else
+ _td person.public_name
+ end
end
end
end
diff --git a/www/members/subscriptions2.cgi b/www/members/subscriptions2.cgi
index 2a6f41c..88fc8c5 100755
--- a/www/members/subscriptions2.cgi
+++ b/www/members/subscriptions2.cgi
@@ -82,30 +82,34 @@ _html do
end
_table.table do
- _tr do
- _th 'id', data_sort: 'string'
- _th 'email', data_sort: 'string'
- _th 'name', data_sort: 'string'
+ _thead_ do
+ _tr do
+ _th 'id', data_sort: 'string'
+ _th 'email', data_sort: 'string'
+ _th 'name', data_sort: 'string'
+ end
end
- subscriptions.sort.each do |id, person, email|
- _tr_ do
- if id.include? '*'
- _td.text_danger id
- elsif not person.asf_member?
- _td.text_danger id, title: 'Non Member', data_sort_value: '1'
- elsif person.asf_member? != true
- _td(data_sort_value: '2') {_em id, title: 'Emeritus'}
- elsif not ldap.include? person
- _td(data_sort_value: '3') {_strong.text_danger id, title: 'Not in
LDAP'}
- else
- _td id
- end
- _td email
+ _tbody do
+ subscriptions.sort.each do |id, person, email|
+ _tr_ do
+ if id.include? '*'
+ _td.text_danger id
+ elsif not person.asf_member?
+ _td.text_danger id, title: 'Non Member', data_sort_value: '1'
+ elsif person.asf_member? != true
+ _td(data_sort_value: '2') {_em id, title: 'Emeritus'}
+ elsif not ldap.include? person
+ _td(data_sort_value: '3') {_strong.text_danger id, title: 'Not
in LDAP'}
+ else
+ _td id
+ end
+ _td email
- if id.include? '*'
- _td ''
- else
- _td person.public_name
+ if id.include? '*'
+ _td ''
+ else
+ _td person.public_name
+ end
end
end
end