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: rough in the creation of a podling
Date Thu, 02 Nov 2017 14:45:55 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 8818f65  rough in the creation of a podling
8818f65 is described below

commit 8818f655766da201244ac9cc99896eb3b8c2e784
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Thu Nov 2 10:45:26 2017 -0400

    rough in the creation of a podling
    
    unadvertised and no back end processing as of yet
---
 www/roster/main.rb                    |  7 +++
 www/roster/public/stylesheets/app.css |  6 +++
 www/roster/views/app.js.rb            |  1 +
 www/roster/views/ppmc/new.js.rb       | 93 +++++++++++++++++++++++++++++++++++
 www/roster/views/ppmc_new.html.rb     | 27 ++++++++++
 5 files changed, 134 insertions(+)

diff --git a/www/roster/main.rb b/www/roster/main.rb
index 7c82646..83c99cd 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -157,6 +157,13 @@ get '/members.json' do
   _json Hash[ASF.members.map {|person| [person.id, person.public_name]}.sort]
 end
 
+get '/ppmc/_new_' do
+  @pmcsAndBoard = (ASF::Committee.pmcs.map(&:id) + ['board']).sort
+  @officersAndMembers = (ASF.pmc_chairs + ASF.members).uniq.map(&:id)
+  @ipmc = ASF::Committee['incubator'].owners.map(&:id)
+  _html :ppmc_new
+end
+
 # active podling list
 get '/ppmc/' do
   @projects = ASF::Project.list
diff --git a/www/roster/public/stylesheets/app.css b/www/roster/public/stylesheets/app.css
index 4ea0250..175fae8 100644
--- a/www/roster/public/stylesheets/app.css
+++ b/www/roster/public/stylesheets/app.css
@@ -90,6 +90,11 @@ input:disabled[type=submit] {cursor: not-allowed}
   margin-left: 15px;
 }
 
+.data-entry > .form-group {
+  padding-top: 2em;
+  clear: both;
+}
+
 @media screen and (min-width: 768px) {
   .wide-form .modal-dialog {
     width: 80%;
@@ -98,3 +103,4 @@ input:disabled[type=submit] {cursor: not-allowed}
     margin-top: 0
   }
 }
+
diff --git a/www/roster/views/app.js.rb b/www/roster/views/app.js.rb
index 49c972e..3a33024 100644
--- a/www/roster/views/app.js.rb
+++ b/www/roster/views/app.js.rb
@@ -29,6 +29,7 @@ require_relative 'ppmc/committers'
 require_relative 'ppmc/add'
 require_relative 'ppmc/mod'
 require_relative 'ppmc/graduate'
+require_relative 'ppmc/new'
 
 require_relative 'committerSearch'
 require_relative 'projectSearch'
diff --git a/www/roster/views/ppmc/new.js.rb b/www/roster/views/ppmc/new.js.rb
new file mode 100644
index 0000000..a392883
--- /dev/null
+++ b/www/roster/views/ppmc/new.js.rb
@@ -0,0 +1,93 @@
+#
+# Create a new Podling
+#
+
+class PPMCNew < Vue
+  def initialize
+    @mentors = []
+    @sponsor = 'incubator'
+    @startdate = Date.new().toISOString().slice(0,10)
+  end
+
+  def render
+    _h2 'Create a new Podling'
+
+    _form.data_entry do
+      _div.form_group do
+        _label 'Podling name', for: 'name'
+        _input.form_control id: 'name', name: 'name', value: @name,
+          onInput: setname
+        _small.form_text.text_muted 'Typically capitalized, as in a book title'
+      end
+
+      _div.form_group do
+        _label 'Podling identifier', for: 'resource'
+        _input.form_control id: 'resource', name: 'resource', value: @resource
+        _small.form_text.text_muted 'Resource identifier, all lower case'
+      end
+
+      _div.form_group do
+        _label 'Sponsor', for: 'sponsor'
+        _select.form_control id: 'sponsor', name: 'sponsor', value: @sponsor do
+          @@pmcsAndBoard.each do |pmc|
+            _option pmc
+          end
+        end
+        _small.form_text.text_muted 'Either a PMC or board'
+      end
+
+      _div.form_group do
+        _label 'Description', for: 'description'
+        _textarea.form_control id: 'description', name: 'description', 
+          value: @description, rows: 6
+        _small.form_text.text_muted 'Freeform text'
+      end
+
+      _div.form_group do
+        _label 'Start date', for: 'startdate'
+        _input.form_control id: 'startdate', name: 'startdate', 
+          value: @startdate
+        _small.form_text.text_muted 'Format: yyyy-mm-dd'
+      end
+
+      _div.form_group do
+        _label 'Champion', for: 'champion'
+        _input.form_control id: 'champion', name: 'champion', value: @champion,
+          disabled: true
+        _small.form_text.text_muted 'Officers and ASF Members'
+        _CommitterSearch include: @@officersAndMembers, add: addChampion
+      end
+
+      _div.form_group do
+        _label 'Mentors', for: 'mentors'
+        _input.form_control id: 'mentors', name: 'mentors', 
+          value: @mentors.join(','), disabled: true
+        _small.form_text.text_muted 'IPMC members'
+        _CommitterSearch include: @@ipmc, add: addMentor, exclude: @mentors
+      end
+
+      _div.form_group do
+        _button.btn.btn_primary 'submit', disabled: (not @name or 
+          not @resource or not @description or 
+          @startdate !~ /^\d\d\d\d-\d\d-\d\d/ or not @champion or 
+          @mentors.empty?)
+      end
+    end
+  end
+
+  # when name changes, update resource to match
+  def setname(event)
+    @name = event.target.value
+    @resource = @name.downcase().gsub(/\W/, '')
+  end
+
+  # set champion based on search
+  def addChampion(person)
+    @champion = person.id
+  end
+
+  # add mentor based on search
+  def addMentor(person)
+    @mentors << person.id
+  end
+end
diff --git a/www/roster/views/ppmc_new.html.rb b/www/roster/views/ppmc_new.html.rb
new file mode 100644
index 0000000..992e592
--- /dev/null
+++ b/www/roster/views/ppmc_new.html.rb
@@ -0,0 +1,27 @@
+#
+# Create a new podling (PPMC)
+#
+
+_html do
+  _base href: '..'
+  _link rel: 'stylesheet', href: "stylesheets/app.css?#{cssmtime}"
+  _title 'Create a Podling'
+
+  _body? do
+    _whimsy_body(
+      breadcrumbs: {
+        roster: '.',
+        ppmc: 'ppmc/',
+        _new_: "ppmc/_new_"
+      }
+    ) do
+      _div_.main!
+    end
+
+    _script src: 'app.js'
+    _.render '#main' do
+      _PPMCNew auth: @auth, pmcsAndBoard: @pmcsAndBoard,
+        officersAndMemers: @officersAndMembers, ipmc: @ipmc
+    end
+  end
+end

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

Mime
View raw message