community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1679389 - /comdev/projects.apache.org/site/js/projects.js
Date Thu, 14 May 2015 15:18:38 GMT
Author: hboutemy
Date: Thu May 14 15:18:38 2015
New Revision: 1679389

URL: http://svn.apache.org/r1679389
Log:
when listing projects by PMC, display TLPs/PMCs even if no project DOAP

Modified:
    comdev/projects.apache.org/site/js/projects.js

Modified: comdev/projects.apache.org/site/js/projects.js
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/site/js/projects.js?rev=1679389&r1=1679388&r2=1679389&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Thu May 14 15:18:38 2015
@@ -675,50 +675,46 @@ function renderProjectsList(cat) {
 	// Title + description
 	obj.innerHTML = "<h1>Projects by PMC:</h1>";
     
-	var lpmcs = [];
 	var dcount = {};
-	for (i in projects) {
-	    i = projects[i];
+        for (tlp in tlps) {
+            dcount[tlp] = 0;
+        }
+	for (project in projects) {
+            project = projects[project];
 	    // Fix Incubating projects
-	    if (i.name.match("incubating", "i")) {
-		i.pmc = 'incubator'
+	    if (project.name.match("incubating", "i")) {
+                project.pmc = 'incubator'
 	    }
-	    if (tlps[i.pmc]) {
-		var lpmc = i.pmc
-	    
-		if (lpmcs.indexOf(lpmc) < 0) {
-		    lpmcs.push(lpmc)
-		    dcount[lpmc] = 0;
-		}
-		dcount[lpmc]++;
+	    if (tlps[project.pmc]) {
+		dcount[project.pmc]++;
 	    }
-	    
 	}
-	lpmcs.sort()
-	
+
 	// Construct pmc list
 	var ul = document.createElement('ul');
 	
-	for (l in lpmcs) {
-	    var lpmc = lpmcs[l];
+	for (lpmc in tlps) {
+            var c = dcount[lpmc];
 	    var li = document.createElement('li');
-	    li.innerHTML = "<h3><a id='" + lpmc + "'>" + tlps[lpmc].name + " (" + dcount[lpmc]
+ ")</a>:</h3>";
-	    var cul = document.createElement('ul');
-	    for (i in projectsSorted) {
-		i = projectsSorted[i];
-		var project = projects[i];
-		// Fix Incubating projects
-		if (project.name.match("incubating", "i")) {
-		    project.pmc = 'incubator'
-		}
-		 if (tlps[project.pmc]) {
-		    xlpmc = project.pmc;
-		    if (xlpmc == lpmc) {
-			appendLiInnerHTML(cul,projectIcon(project.name) + projectLink(i));
-		    }
-		 }
-	    }
-	    li.appendChild(cul);
+	    li.innerHTML = "<h3><a id='" + lpmc + "'>" + tlps[lpmc].name + " (" + c
+ ")</a>" + (c>0?":": "") + "</h3>";
+            if (c > 0) {
+                var cul = document.createElement('ul');
+                for (i in projectsSorted) {
+                    i = projectsSorted[i];
+                    var project = projects[i];
+                    // Fix Incubating projects
+                    if (project.name.match("incubating", "i")) {
+                        project.pmc = 'incubator'
+                    }
+                    if (tlps[project.pmc]) {
+                        xlpmc = project.pmc;
+                        if (xlpmc == lpmc) {
+                            appendLiInnerHTML(cul, projectIcon(project.name) + projectLink(i));
+                        }
+                    }
+                }
+                li.appendChild(cul);
+            }
 	    ul.appendChild(li);
 	}
 	



Mime
View raw message