community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1679654 - /comdev/projects.apache.org/site/js/projects.js
Date Fri, 15 May 2015 22:53:55 GMT
Author: hboutemy
Date: Fri May 15 22:53:54 2015
New Revision: 1679654

URL: http://svn.apache.org/r1679654
Log:
when listing projects by date, add tlps that do not have projects (ie not written DOAP file)

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=1679654&r1=1679653&r2=1679654&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Fri May 15 22:53:54 2015
@@ -510,7 +510,11 @@ function projectIcon(name) {
 }
 
 function projectLink(id) {
-    project = projects[id];
+    var project = projects[id];
+    if (!project) {
+        // not project id: perhaps tlp id
+        project = tlps[id];
+    }
     var name = project.name;
     if (project.pmc == "attic") {
         name += " (in the Attic)";
@@ -656,17 +660,13 @@ function renderProjectsList(cat) {
     
 	var dates = [];
 	var dcount = {};
-	for (i in projects) {
-	    if (tlpsByName[projects[i].name]) {
-		var date = tlpsByName[projects[i].name].established;
-	    
-		if (dates.indexOf(date) < 0) {
-		    dates.push(date);
-		    dcount[date] = 0;
-		}
-		dcount[date]++;
-	    }
-	    
+	for (i in tlps) {
+            var date = tlps[i].established;
+            if (dates.indexOf(date) < 0) {
+                dates.push(date);
+                dcount[date] = 0;
+            }
+            dcount[date]++;
 	}
 	dates.sort()
 	
@@ -678,14 +678,11 @@ function renderProjectsList(cat) {
 	    var li = document.createElement('li');
 	    li.innerHTML = "<h3><a id='" + date + "'>" + date + " (" + dcount[date]
+ ")</a>:</h3>";
 	    var cul = document.createElement('ul');
-	    for (i in projectsSorted) {
-		i = projectsSorted[i];
-		 if (tlpsByName[projects[i].name]) {
-		    xdate = tlpsByName[projects[i].name].established;
-		    if (xdate == date) {
-			appendLiInnerHTML(cul, projectIcon(projects[i].name) + projectLink(i));
-		    }
-		 }
+	    for (i in tlpsByName) {
+		i = tlpsByName[i];
+                if (i.established == date) {
+                    appendLiInnerHTML(cul, projectIcon(i.name) + projectLink(i.id));
+                }
 	    }
 	    li.appendChild(cul);
 	    ul.appendChild(li);
@@ -865,8 +862,8 @@ function buildProjectListAsTable(json) {
 }
 
 
-function isTLP(project) {
-    return tlpsByName[project];
+function isTLP(name) {
+    return tlpsByName[name];
 }
 
 // ------------ Front page rendering ------------\\



Mime
View raw message