whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 0c54472: link to forms on file
Date Wed, 02 Mar 2016 13:34:11 GMT
Commit 0c544728336e77f50b540ac3dc60d14139ad4c69:
    link to forms on file


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/roster/models/committer.rb                               | ++++++++ 
www/roster/views/committer.js.rb                             | +++++++++++++ -
------------------------------------------------------------
43 changes: 42 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index 5b7b7be..e24b7b8 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -67,11 +67,26 @@ def self.serialize(id, env)
     response[:committer].sort!
 
     if ASF::Person.find(env.user).asf_member?
+      response[:forms] = {}
+
+      iclas = ASF::SVN['private/documents/iclas']
+      if File.exist? File.join(iclas, person.icla.claRef + '.pdf')
+        response[:forms][:icla] = person.icla.claRef + '.pdf'
+      elsif Dir.exist? File.join(iclas, person.icla.claRef)
+        response[:forms][:icla] = person.icla.claRef + '/'
+      end
+
       member = {}
 
       if person.asf_member?
         member[:info] = person.members_txt
         member[:status] = ASF::Member.status[id] || 'Active'
+
+        apps = ASF::SVN['private/documents/member_apps']
+        memapp = member[:info].split("\n").first.downcase.gsub(/\s/, '-')
+        if File.exist? File.join(apps, memapp + '.pdf')
+          response[:forms][:member] = memapp + '.pdf'
+        end
       else
         if person.member_nomination
           member[:nomination] = person.member_nomination
@@ -79,6 +94,7 @@ def self.serialize(id, env)
       end
 
       response[:member] = member
+
     end
 
     response
diff --git a/www/roster/views/committer.js.rb b/www/roster/views/committer.js.rb
index e4d9d62..cc6c71c 100644
--- a/www/roster/views/committer.js.rb
+++ b/www/roster/views/committer.js.rb
@@ -149,10 +149,35 @@ def render
 
         if @committer.member.nomination
           _tr do
-            _td 'nomination'
+            _td 'Nomination'
             _td {_pre @committer.member.nomination}
           end
         end
+        j
+        if @committer.forms
+          _tr do
+            _td 'Forms on file'
+            _td do
+              _ul do
+                for form in @committer.forms
+                  link = @committer.forms[form]
+                  
+                  if form == 'icla'
+                    _li do
+                      _a 'ICLA', href: "https://svn.apache.org/repos/private/documents/iclas/#{link}"
+                    end
+                  elsif form == 'member'
+                    _li do
+                      _a 'Membership App', href: "https://svn.apache.org/repos/private/documents/member_apps/#{link}"
+                    end
+                  else
+                    _li "#{form}: #{link}"
+                  end
+                end
+              end
+            end
+          end
+        end
       end
 
       _tr data_edit: 'sascore' do

Mime
View raw message