community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1799092 - in /comdev/reporter.apache.org/trunk/site: css/tabs.css js/coffee/tabs.coffee
Date Sun, 18 Jun 2017 15:47:51 GMT
Author: humbedooh
Date: Sun Jun 18 15:47:50 2017
New Revision: 1799092

URL: http://svn.apache.org/viewvc?rev=1799092&view=rev
Log:
check to see if member and/or on a PMC

Modified:
    comdev/reporter.apache.org/trunk/site/css/tabs.css
    comdev/reporter.apache.org/trunk/site/js/coffee/tabs.coffee

Modified: comdev/reporter.apache.org/trunk/site/css/tabs.css
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/css/tabs.css?rev=1799092&r1=1799091&r2=1799092&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/css/tabs.css (original)
+++ comdev/reporter.apache.org/trunk/site/css/tabs.css Sun Jun 18 15:47:50 2017
@@ -17,6 +17,11 @@ a {
     color: #224;
 }
 
+.warning {
+    font-size: 1.2rem;
+    color: #A60;
+}
+
 #dialog {
     position: relative;
     display: inline-block;

Modified: comdev/reporter.apache.org/trunk/site/js/coffee/tabs.coffee
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/coffee/tabs.coffee?rev=1799092&r1=1799091&r2=1799092&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/coffee/tabs.coffee (original)
+++ comdev/reporter.apache.org/trunk/site/js/coffee/tabs.coffee Sun Jun 18 15:47:50 2017
@@ -21,15 +21,23 @@ loadTabs = (stab) ->
         tdiv.inject(tab)
         k++
     
-    all = ['Add a tab:', '---------------']
-    for pmc in jsdata.all or []
-        all.push(pmc)
-    sel = makeSelect('project', all)
-    sel.setAttribute("onchange", "addTab(this.value);")
-    tdiv.inject(sel)
-    bread = new HTML('div', { class: 'bread', id: 'contents'}, "Loading page, please wait...")
-    main.inject(bread)
-    loadBread(stab)
+    # Check if person is a member of any PMC or an ASF member
+    if jsdata.all.length > 0
+        # Dirty hack to determine membership for now
+        if jsdata.all.length > 200
+            all = ['Add a tab:', '---------------']
+            for pmc in jsdata.all or []
+                all.push(pmc)
+            sel = makeSelect('project', all)
+            sel.setAttribute("onchange", "addTab(this.value);")
+            tdiv.inject(sel)
+            bread = new HTML('div', { class: 'bread', id: 'contents'}, "Loading page, please
wait...")
+            main.inject(bread)
+            
+        # If all good, render the tab
+        loadBread(stab)
+    else
+        main.inject(new HTML('p', { class: 'warning'}, "You need to be a member of at least
one PMC in order to utilize the reporting tool."))
 
 addTab = (pmc) ->
     fetch("getjson.py?only="+pmc, {pmc: pmc}, preloadTabs)



Mime
View raw message