community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1664340 - in /comdev/reporter.apache.org/site: getjson.py render.js
Date Thu, 05 Mar 2015 13:30:05 GMT
Author: humbedooh
Date: Thu Mar  5 13:30:04 2015
New Revision: 1664340

URL: http://svn.apache.org/r1664340
Log:
- Add a quick-nav for members
- Add PMC/Committer count to report

Modified:
    comdev/reporter.apache.org/site/getjson.py
    comdev/reporter.apache.org/site/render.js

Modified: comdev/reporter.apache.org/site/getjson.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/getjson.py?rev=1664340&r1=1664339&r2=1664340&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/getjson.py (original)
+++ comdev/reporter.apache.org/site/getjson.py Thu Mar  5 13:30:04 2015
@@ -114,6 +114,7 @@ def getJIRAS(project):
 
 def getProjectData(project):
     try:
+        y = []
         with open("/var/www/projects.apache.org/site/json/projects/%s.json" % project, "r")
as f:
             x = json.loads(f.read())
             f.close()
@@ -121,6 +122,7 @@ def getProjectData(project):
                 p = json.loads(f.read())
                 f.close()
                 for xproject in p:
+                    y.append(xproject)
                     if xproject == project:
                         x['name'] = p[project]['name']
             with open("/var/www/projects.apache.org/site/json/foundation/chairs.json", "r")
as f:
@@ -130,13 +132,15 @@ def getProjectData(project):
                     if xproject == x['name']:
                         x['chair'] = c[xproject]
 
-        return x;
+        return x, y;
     except:
         x = {}
+        y = []
         with open("/var/www/projects.apache.org/site/json/foundation/pmcs.json", "r") as
f:
             p = json.loads(f.read())
             f.close()
             for xproject in p:
+                y.append(xproject)
                 if xproject == project:
                     x['name'] = p[project]['name']
 
@@ -146,7 +150,7 @@ def getProjectData(project):
             for xproject in c:
                 if 'name' in x and xproject == x['name']:
                     x['chair'] = c[xproject]
-        return x
+        return x,y
 
 def getReleaseData(project):
     try:
@@ -207,12 +211,18 @@ if m:
     jdata = {}
     ddata = {}
     rdata = {}
-    
+    allpmcs = []
     keys = {}
+    count = {}
     for group in groups:
         jiras = []
+        count[group] = [0,0]
+        if group in pchanges:
+            count[group][0] = len(pchanges[group])
+        if group in cchanges:
+            count[group][1] = len(cchanges[group])
         jdata[group] = [0,0, None]
-        ddata[group] = getProjectData(group)
+        ddata[group], allpmcs = getProjectData(group)
         rdata[group] = getReleaseData(group)
         jiraname = group.upper()
         if group in jmap:
@@ -246,8 +256,12 @@ if m:
                 for member in cchanges[pmc]:
                     if cchanges[pmc][member][1] > 0:
                         cdata[group]['committer'][member] = cchanges[pmc][member]
+    if not isMember(uid):
+        allpmcs = []
     output = {
+        'count': count,
         'pmcs': groups,
+        'all': allpmcs,
         'mail': mlstats,
         'delivery': emails,
         'jira': jdata,

Modified: comdev/reporter.apache.org/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/render.js?rev=1664340&r1=1664339&r2=1664340&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/render.js (original)
+++ comdev/reporter.apache.org/site/render.js Thu Mar  5 13:30:04 2015
@@ -41,6 +41,19 @@ function GetAsyncJSON(theUrl, xstate, ca
 }
 
 
+function makeSelect(name, arr, sarr) {
+    var sel = document.createElement('select');
+    sel.setAttribute("name", name)
+    for (i in arr) {
+		var val = arr[i];
+		var opt = document.createElement('option')
+		opt.setAttribute("value", val)
+		opt.innerHTML = val
+		sel.appendChild(opt);
+    }
+    return sel
+}
+
 function getWednesdays(mo, y) {
     var d = new Date();
     if (mo) {
@@ -146,10 +159,10 @@ function addLine(pmc, line) {
 		var len = 0;
 		var out = ""
 		for (i in words) {
-			len += words[i].length + (i == words.length-1 ? 0 : 1)
+			len += words[i].replace(/<.+?>/, "").length + (i == words.length-1 ? 0 : 1)
 			if (len >= 80) {
 				out += "\n   "
-				len = words[i].length + (i == words.length-1 ? 0 : 1)
+				len = words[i].replace(/<.+?>/, "").length + (i == words.length-1 ? 0 : 1)
 			}
 			out += words[i] + " "
 		}
@@ -187,19 +200,19 @@ function renderFrontPage(json) {
 	var pmc = json.pmcs[i]
 	templates[pmc] = "Report from the " + (json.pdata[pmc].name ? json.pdata[pmc].name : pmc)
+ " project [" + (json.pdata[pmc].chair ? json.pdata[pmc].chair : "Put your name here") +
"]\n\n"
 	
-	addLine(pmc, "Description:")
+	addLine(pmc, "## Description:")
 	if (json.pdata[pmc].shortdesc) {
-	    addLine(pmc, json.pdata[pmc].shortdesc)
+	    addLine(pmc, "   " + json.pdata[pmc].shortdesc)
 	} else {
 	    addLine(pmc, " - <font color='red'>Description goes here</font>")
 	}
 	addLine(pmc)
 	
-	addLine(pmc, "Activity:")
+	addLine(pmc, "## Activity:")
 	addLine(pmc, " - <font color='red'>TODO - the PMC MUST provide this information</font>")
 	addLine(pmc)
 
-	addLine(pmc, "Issues:")
+	addLine(pmc, "## Issues:")
 	addLine(pmc, " - <font color='red'>TODO - list any issues that require board attention,
\n  or say \"there are no issues requiring board attention at this time\"</font>")
 	addLine(pmc)
     
@@ -240,11 +253,12 @@ function renderFrontPage(json) {
 	var np = 0;
 	var ncn = null;
 	var npn = null;
-	addLine(pmc, "PMC/Committership changes:")
+	addLine(pmc, "## PMC/Committership changes:")
 	addLine(pmc)
+	addLine(pmc, " - Currently " + json.count[pmc][1] + " committers and " + json.count[pmc][0]
+ " PMC members in the project.")
 	if (c == 0) {
 	    changes.innerHTML += "<font color='red'><b>No new changes to the PMC or
committer base detected</b></font>"
-	    addLine(pmc, "No new changes to the PMC or committership since last report.")
+	    addLine(pmc, " - No new changes to the PMC or committership since last report.")
 	    addLine(pmc)
 	}
 	else {
@@ -294,13 +308,14 @@ function renderFrontPage(json) {
 		}
 		changes.innerHTML += "&rarr; " + "<b>Latest committer addition: </b>" +
new Date(nc*1000).toDateString() + " (" + ncn +  ")<br/>"
 	    }
+		changes.innerHTML += "&rarr; " + "<b>Currently " + json.count[pmc][1] + " committers
and " + json.count[pmc][0] + " PMC members."
 	    addLine(pmc)
 	}
 	
 	// Release data
 	
 	var releases = buildPanel(pmc, "Releases")
-	addLine(pmc, "Releases:")
+	addLine(pmc, "## Releases:")
 	addLine(pmc)
 	var nr = 0;
 	var lr = null;
@@ -314,8 +329,12 @@ function renderFrontPage(json) {
 		lr = version
 	    }
 	    if (date >= after.getTime()/1000) {
-		releases.innerHTML += "&rarr; " + "<b>" + version + " was released on </b>"
+ new Date(date*1000).toDateString() + "<br/>"
-		addLine(pmc, " - " + version + " was released on " + new Date(date*1000).toDateString())
+			err = ""
+			if (new Date(date*1000) > new Date()) {
+				err = " (<font color='red'>This seems wrong?!</font>)"
+			}
+		releases.innerHTML += "&rarr; " + "<b>" + version + " was released on </b>"
+ new Date(date*1000).toDateString() + err + "<br/>"
+		addLine(pmc, " - " + version + " was released on " + new Date(date*1000).toDateString()
+ err)
 		nr++;
 	    }
 	}
@@ -347,7 +366,7 @@ function renderFrontPage(json) {
 	mlbox.appendChild(ul)
 	var prev = ""
 	var f = 0
-	addLine(pmc, "Mailing list activity:")
+	addLine(pmc, "## Mailing list activity:")
 	addLine(pmc)
 	var first = ['users', 'dev', 'commits', 'private', 'bugs', 'modules-dev'];
 	
@@ -498,13 +517,30 @@ function renderFrontPage(json) {
       $("#tabcontents #tab_" + project).fadeIn();
 	  $("#tabs #btn_" + project).attr('id', 'current');
     }
+	if (json.all && json.all.length > 0) {
+		var btn = document.createElement('li');
+		btn.setAttribute("style", "margin-left: 48px;")
+		btn.setAttribute("id", "btn_all")
+		btn.setAttribute("class", "tab-title")
+		json.all.sort()
+		json.all.unshift("-----------------------")
+		json.all.unshift("Members-only Quick-nav:")
+		var sel = makeSelect("project", json.all, [])
+		sel.setAttribute("style", "height: 32px !important; padding: 0px !important; margin: 0px
!important; margin-left: 32px !important;")
+		sel.style = "break-before: never; break-after: never; float: left"
+		sel.setAttribute("onchange", "location.href = '/?' + this.value;")
+		btn.appendChild(sel)
+		panellist.appendChild(btn)
+		
+	}
+	
 }
 
 
 function renderJIRA(pmc, project) {
     var obj = buildPanel(pmc, "JIRA Statistics")
  
-    addLine(pmc, "JIRA activity:")
+    addLine(pmc, "## JIRA activity:")
     addLine(pmc)
     addLine(pmc, " - " + jsdata.jira[pmc][0] + " JIRA tickets created in the last 3 months");
     addLine(pmc, " - " + jsdata.jira[pmc][1] + " JIRA tickets closed/resolved in the last
3 months");



Mime
View raw message