whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: prompt for establish resolutions
Date Sat, 03 Jun 2017 23:41:27 GMT
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  303b0f3   prompt for establish resolutions
303b0f3 is described below

commit 303b0f3f5cf548ab4b33173a107b157e28878982
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Jun 3 19:41:04 2017 -0400

    prompt for establish resolutions
---
 www/roster/public/stylesheets/app.css   |  4 ++
 www/roster/views/app.js.rb              |  1 +
 www/roster/views/ppmc/establish.text.rb |  7 +++-
 www/roster/views/ppmc/graduate.js.rb    | 72 +++++++++++++++++++++++++++++++++
 www/roster/views/ppmc/main.js.rb        |  3 ++
 5 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/www/roster/public/stylesheets/app.css b/www/roster/public/stylesheets/app.css
index d9a682c..a66b304 100644
--- a/www/roster/public/stylesheets/app.css
+++ b/www/roster/public/stylesheets/app.css
@@ -67,6 +67,10 @@ input:disabled[type=submit] {cursor: not-allowed}
 .row .name:after {content: '\00A0\2014'; margin-right: -2px}
 .row .value {border-left: solid 1px #000; padding: 0 0.5em}
 
+#graduate p {
+  margin-top: 1em
+}
+
 @media screen and (min-width: 768px) {
   .wide-form .modal-dialog {
     width: 80%;
diff --git a/www/roster/views/app.js.rb b/www/roster/views/app.js.rb
index c50a1d7..6740b00 100644
--- a/www/roster/views/app.js.rb
+++ b/www/roster/views/app.js.rb
@@ -20,6 +20,7 @@ require_relative 'ppmc/main'
 require_relative 'ppmc/mentors'
 require_relative 'ppmc/members'
 require_relative 'ppmc/committers'
+require_relative 'ppmc/graduate'
 
 require_relative 'committerSearch'
 require_relative 'confirm'
diff --git a/www/roster/views/ppmc/establish.text.rb b/www/roster/views/ppmc/establish.text.rb
index 7025f74..f85b65b 100644
--- a/www/roster/views/ppmc/establish.text.rb
+++ b/www/roster/views/ppmc/establish.text.rb
@@ -6,6 +6,8 @@ list = podling.owners.map {|person| [person.public_name, person.id]}
 width = list.map {|name, id| name.length}.max
 
 resolution = <<-EOF
+Establish the Apache #{podling.display_name} Project
+
 WHEREAS, the Board of Directors deems it to be in the best interests of the
 Foundation and consistent with the Foundation's purpose to establish a Project
 Management Committee charged with the creation and maintenance of open-source
@@ -53,7 +55,7 @@ hereafter discharged.
 EOF
 
 # reflow paragraphs
-line_width = 80
+line_width = 72
 resolution = resolution.split("\n\n").map do |paragraph|
   paragraph.gsub(/\s+/, ' ').
     gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip
@@ -62,6 +64,7 @@ resolution = resolution.join("\n\n")
 
 # insert list of proposed PMC members
 resolution.sub! '*** LIST ***',
-  list.map {|name, id| " * #{name.ljust(width)} <#{id}@apache.org>"}.join("\n")
+  list.sort_by {|name, id| name}.
+    map {|name, id| " * #{name.ljust(width)} <#{id}@apache.org>"}.join("\n")
 
 resolution
diff --git a/www/roster/views/ppmc/graduate.js.rb b/www/roster/views/ppmc/graduate.js.rb
new file mode 100644
index 0000000..a3cceaf
--- /dev/null
+++ b/www/roster/views/ppmc/graduate.js.rb
@@ -0,0 +1,72 @@
+#
+# Draft an "Establish" resolution for a new PMC
+#
+
+class PPMCGraduate < React
+  def initialize
+    @owners = []
+  end
+
+  def render
+    _button.btn.btn_info 'Draft graduation resolution',
+      data_target: '#graduate', data_toggle: 'modal'
+
+    _div.modal.fade.graduate! tabindex: -1 do
+      _div.modal_dialog do
+        _div.modal_content do
+          _form method: 'post', action: "ppmc/#{@@ppmc.id}/establish" do
+	    _div.modal_header.bg_info do
+	      _button.close 'x', data_dismiss: 'modal'
+	      _h4.modal_title "Establish Apache #{@project}"
+	    end
+
+	    _div.modal_body do
+	      _p do
+		_b 'Complete this sentence: '
+		_span "Apache #{@project} consists of software related to"
+	      end
+
+	      _textarea name: 'description', value: @description, rows: 4
+
+	      _p { _b 'Choose a chair' }
+
+	      _select name: 'chair' do
+		@owners.each do |person|
+		  _option person.name, value: person.id,
+		    selected: person.id == @@id
+		end
+	      end
+	    end
+
+	    _div.modal_footer do
+	      _span.status 'Processing request...' if @disabled
+	      _button.btn.btn_default 'Cancel', data_dismiss: 'modal'
+	      _button.btn.btn_primary 'Draft Resolution'
+	    end
+          end
+        end
+      end
+    end
+  end
+
+  def componentDidMount()
+    textarea = jQuery('#graduate textarea')
+
+    jQuery('#graduate').on('show.bs.modal') do |event|
+      @project = @@ppmc.display_name
+      @description = @@ppmc.description
+
+      textarea.css('height', 0)
+      textarea.css('height',Math.max(50, textarea[0].scrollHeight)+'px')
+
+      @owners = @@ppmc.owners.
+        map {|id| {id: id, name: @@ppmc.roster[id].name}}.
+        sort_by {|person| person.name}
+    end
+
+    textarea.on('keyup') do |event|
+      textarea.css('height', 0)
+      textarea.css('height', Math.max(50, textarea[0].scrollHeight)+'px')
+    end
+  end
+end
diff --git a/www/roster/views/ppmc/main.js.rb b/www/roster/views/ppmc/main.js.rb
index 5467e9f..3272bf0 100644
--- a/www/roster/views/ppmc/main.js.rb
+++ b/www/roster/views/ppmc/main.js.rb
@@ -88,6 +88,9 @@ class PPMC < React
       end
     end
 
+    # Graduation resolution
+    _PPMCGraduate ppmc: @ppmc, id: @@auth.id
+
     # hidden form
     _Confirm action: :ppmc, project: @ppmc.id, update: self.update if auth
   end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message