[whimsy] branch master updated: rough in an email form
This is an automated email from the ASF dual-hosted git repository. rubys 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 026e7b7 rough in an email form 026e7b7 is described below commit 026e7b70e0cc22f541fbe3ca8858f47bb517f273 Author: Sam Ruby AuthorDate: Sun Apr 7 21:37:18 2019 -0400 rough in an email form --- www/board/agenda/public/stylesheets/app.css | 12 + www/board/agenda/views/actions/email.json.rb | 28 +++ www/board/agenda/views/buttons/email.js.rb | 72 ++-- www/board/agenda/views/utils.js.rb | 6 ++- 4 files changed, 113 insertions(+), 5 deletions(-) diff --git a/www/board/agenda/public/stylesheets/app.css b/www/board/agenda/public/stylesheets/app.css index aa1e1a7..06793f5 100644 --- a/www/board/agenda/public/stylesheets/app.css +++ b/www/board/agenda/public/stylesheets/app.css @@ -548,3 +548,15 @@ input[type=file]#upload { font-family: monospace; overflow: hidden; } + +#email-form input { + display: inline; + width: 80%; + padding-right: 5px; + padding-left: 5px; +} + +.reminder .modal-content button { + margin-left: 0.5em; + margin-bottom: 0em; +} diff --git a/www/board/agenda/views/actions/email.json.rb b/www/board/agenda/views/actions/email.json.rb new file mode 100644 index 000..5d208b5 --- /dev/null +++ b/www/board/agenda/views/actions/email.json.rb @@ -0,0 +1,28 @@ +# +# send email +# + +ASF::Mail.configure + +# extract values for each field +to, cc, subject, body = @to, @cc, @subject, @body + +# construct from address +sender = ASF::Person.find(env.user) +from = "#{sender.public_name.inspect} <#{sender.id}@apache.org>".untaint + +# construct email +mail = Mail.new do + from from + to to + cc cc if cc and not cc.empty? + subject subject + + body body +end + +# deliver mail +mail.deliver! + +# return email in the response +{mail: mail.to_s} diff --git a/www/board/agenda/views/buttons/email.js.rb b/www/board/agenda/views/buttons/email.js.rb index 3ae3a7b..1c6dbc8 100644 --- a/www/board/agenda/views/buttons/email.js.rb +++ b/www/board/agenda/views/buttons/email.js.rb @@ -3,9 +3,15 @@ # class Email < Vue + def initialize +@email = {} + end + def render _button.btn 'send email', class: self.mailto_class(), onClick: self.launch_email_client + +_EmailForm email: @email end # render 'send email' as a primary button if the viewer is the shepherd for @@ -31,7 +37,7 @@ class Email < Vue end # launch email client, pre-filling the destination, subject, and body - def launch_email_client() + def launch_email_client(event) mail_list = @@item.mail_list mail_list = "private@#{mail_list}.apache.org" unless mail_list.include? '@' @@ -77,8 +83,66 @@ class Email < Vue end end -window.location = "mailto:#{to}?cc=#{cc}; + - "=#{encodeURIComponent(subject)}" + - "=#{encodeURIComponent(body)}" +if event.ctrlKey or event.shiftKey or event.metaKey + @email = { +to: to, +cc: cc, +subject: subject, +body: body + } + + jQuery('#email-form').modal(:show) +else + window.location = "mailto:#{to}?cc=#{cc}; + +"=#{encodeURIComponent(subject)}" + +"=#{encodeURIComponent(body)}" +end + end +end + +class EmailForm < Vue + def render +_ModalDialog.email_form! color: 'commented' do + _h4 "Send email - #{@@email.subject}" + + # input field: to + _div.form_group.row do +_label.col_sm_2 'To', for: 'email-to' +_input.col_sm_10.email_to! placeholder: "destination email address", + disabled: @disabled, value: @@email.to + end + + # input field: cc + _div.form_group.row do +_label.col_sm_2 'CC', for: 'email-cc' +_input.col_sm_10.email_cc! placeholder: "cc list", disabled: @disabled, + value: @@email.cc + end + + # input field: subject + _div.form_group.row do +_label.col_sm_2 'Subject', for: 'email-subject' +_input.col_sm_10.email_subject! placeholder: "email subject", +disabled: @disabled, value: @@email.subject + end + + # input field: body + _textarea.email_body! label: 'Body', placeholder: "email text", +disabled: @disabled, value: @@email.body, rows: 10 + + _button.btn_default 'Cancel', type: 'button', data_dismiss: 'modal' + _button.btn_primary 'Send', type: 'button', onClick: self.send, +disabled: @disabled +end + end + + def send(event) +@disabled = true +post 'email', @@email do |response| + console.log response + @disabled = false + jQuery('#email-form').modal(:hide) + document.body.classList.remove('modal-open') +end end end diff --git a/www/board/agenda/views/utils.js.rb b/www/board/agenda/views/utils.js.rb index 7bead82..0e5f503 100644 ---
[whimsy] branch master updated: Better description
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 803de65 Better description 803de65 is described below commit 803de655b9c1d795b847b6df00ef0b505a6277dd Author: Sebb AuthorDate: Sun Apr 7 13:58:34 2019 +0100 Better description --- www/index.html| 2 +- www/members/archivers.cgi | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/index.html b/www/index.html index 1c4b8e0..1ab3d69 100644 --- a/www/index.html +++ b/www/index.html @@ -182,7 +182,7 @@ STV Explorer Proxy form (ASF members meeting) Security Mailing List Subscriptions -Archiver Subscription Issues - excluding missing mail-archive subs +Archiver Subscription Issues - ignoring missing mail-archive subs Archiver Subscription Issues - including missing mail-archive subs Archiver Subscription Checks (all entries) diff --git a/www/members/archivers.cgi b/www/members/archivers.cgi index a2b8d2f..e8c8f8f 100755 --- a/www/members/archivers.cgi +++ b/www/members/archivers.cgi @@ -57,9 +57,9 @@ _html do end _ 'Showing: ' unless show_all or show_mailarchive -_b 'issues excluding missing mail-archive subscriptions' +_b 'issues (ignoring missing mail-archive subscriptions)' else -_a 'issues excluding missing mail-archive subscriptions', href: './' +_a 'issues (ignoring missing mail-archive subscriptions)', href: './' end _ ' | ' if show_mailarchive
[whimsy] branch master updated: Show which details are presented, and the source times
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 c4adf20 Show which details are presented, and the source times c4adf20 is described below commit c4adf20759a075d12d5872a09c8e170dbe646fea Author: Sebb AuthorDate: Sun Apr 7 13:28:29 2019 +0100 Show which details are presented, and the source times --- www/members/archivers.cgi | 35 +++ 1 file changed, 35 insertions(+) diff --git a/www/members/archivers.cgi b/www/members/archivers.cgi index fd559ab..a2b8d2f 100755 --- a/www/members/archivers.cgi +++ b/www/members/archivers.cgi @@ -11,6 +11,8 @@ require 'wunderbar/jquery/stupidtable' ids={} binarchives = ASF::Mail.lists(true) +binarchtime = ASF::Mail.list_mtime + show_all = (ENV['PATH_INFO'] == '/all') # all entries, regardless of error state # default is to show entry if neither mail-archive nor markmail is present (mail-archive is missing from a lot of lists) show_mailarchive = (ENV['PATH_INFO'] == '/mail-archive') # show entry if mail-archive is missing @@ -19,6 +21,8 @@ show_mailarchive = (ENV['PATH_INFO'] == '/mail-archive') # show entry if mail-ar # INFRA-18129 NOT_ARCHIVED = %w{apachecon-aceu19} +sublist_time = ASF::MLIST.list_time + _html do _body? do _whimsy_body( @@ -38,6 +42,37 @@ _html do _ 'Unexpected/missing entries are flagged' _br _ 'Minotaur emails can be either aliases (tlp-list-arch...@tlp.apache.org) or direct (apmail-tlp-list-arch...@www.apache.org).' + _br + _ 'Columns:' + _ul do +_li 'id - short id of list as used on mod_mbox' +_li 'list - full list name' +_li "Private? - public/private; derived from bin/.archives as at #{binarchtime}" +_li 'MINO - minotaur archiver' +_li 'MBOX - mbox-vm archiver' +_li 'PONY - PonyMail (lists.apache.org) archiver' +_li 'MAIL-ARCHIVE - @mail-archive.com archiver (public lists only)' +_li 'MARKMAIL - markmail.org archiver (public lists only)' +_li "Archivers - list of known archiver subscriptions as at #{sublist_time}" + end + _ 'Showing: ' + unless show_all or show_mailarchive +_b 'issues excluding missing mail-archive subscriptions' + else +_a 'issues excluding missing mail-archive subscriptions', href: './' + end + _ ' | ' + if show_mailarchive +_b 'issues including missing mail-archive subscriptions' + else +_a 'issues including missing mail-archive subscriptions', href: './mail-archive' + end + _ ' | ' + if show_all +_b 'details for all lists' + else +_a 'details for all lists', href: './all' + end end } ) do
[whimsy] branch master updated: Return the list time
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 a72f69d Return the list time a72f69d is described below commit a72f69db177bb6057e608264c0451ad7b090 Author: Sebb AuthorDate: Sun Apr 7 13:27:14 2019 +0100 Return the list time --- lib/whimsy/asf/mlist.rb | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb index 078f111..b1fd49e 100644 --- a/lib/whimsy/asf/mlist.rb +++ b/lib/whimsy/asf/mlist.rb @@ -173,6 +173,11 @@ module ASF return subscribers.to_h, (File.mtime(LIST_TIME) rescue File.mtime(LIST_SUBS)) end +# returns the list time (defaulting to list-subs time if the marker is not present) +def self.list_time + File.mtime(LIST_TIME) rescue File.mtime(LIST_SUBS) +end + def self.list_archivers list_parse('sub') do |dom, list, subs| yield [dom, list, subs.select {|s| is_archiver? s}.map{|m| [m,archiver_type(m,dom,list)].flatten}]
[whimsy] branch master updated: Return the list time
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 f448454 Return the list time f448454 is described below commit f4484543323ea2856498d9ebf45a5f338e3e39fb Author: Sebb AuthorDate: Sun Apr 7 13:27:39 2019 +0100 Return the list time --- lib/whimsy/asf/mail.rb | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb index 1a68bc6..c583fd4 100644 --- a/lib/whimsy/asf/mail.rb +++ b/lib/whimsy/asf/mail.rb @@ -64,6 +64,11 @@ module ASF public_private ? @lists : @lists.keys end +def self.list_mtime + Mail._load_lists + @list_mtime +end + # list of mailing lists that aren't actively seeking new subscribers def self.deprecated apmail_bin = ASF::SVN['apmail_bin']
[whimsy] branch master updated: Simplify/shorten
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 2eca08f Simplify/shorten 2eca08f is described below commit 2eca08f70ec38a1fbb862c4132186169b937d1d3 Author: Sebb AuthorDate: Sun Apr 7 12:51:30 2019 +0100 Simplify/shorten --- www/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/index.html b/www/index.html index 1ef5151..1c4b8e0 100644 --- a/www/index.html +++ b/www/index.html @@ -182,9 +182,9 @@ STV Explorer Proxy form (ASF members meeting) Security Mailing List Subscriptions -CrossCheck of Archiver Subscriptions (issues only - excluding missing mail-archive subscriptions) -CrossCheck of Archiver Subscriptions (issues only - including missing mail-archive subscriptions) -CrossCheck of Archiver Subscriptions (all entries) +Archiver Subscription Issues - excluding missing mail-archive subs +Archiver Subscription Issues - including missing mail-archive subs +Archiver Subscription Checks (all entries)