community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1679388 - /comdev/projects.apache.org/site/js/projects.js
Date Thu, 14 May 2015 14:55:40 GMT
Author: hboutemy
Date: Thu May 14 14:55:39 2015
New Revision: 1679388

URL: http://svn.apache.org/r1679388
Log:
remove "committees" notion: they are TLPs

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=1679388&r1=1679387&r2=1679388&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Thu May 14 14:55:39 2015
@@ -20,9 +20,9 @@
 var people = {}; // committer -> name lookups
 var unixgroups = {}; // unix (ldap) groups (project -> committers lookup)
 var tlps = {}; // id -> tlp info (chair, established, group, homepage, id, name, reporting,
shortdesc)
-var projects = {}; // Projects (sub + tlp)
-var committees = {}; // TLP committees for TLP evolution charts et al
-var committees_raw = {}; // TLP committees, sorted by date founded
+var tlpsByName = {}; // name -> tlp info
+var tlpsEvolution = {}; // TLPs sorted by date founded, with retired (name = "retired: name")
+var projects = {}; // Projects (main project or sub-project from a TLP)
 var evolution = {}; // Podling evolution
 var accounts = {}; // Account creation lookups
 var releases = {}; // Release data
@@ -276,7 +276,7 @@ function renderProjectPage(json, state)
 
     // Title + description
     var pt = "Top Level Project";
-    if ((!committees[json.name] && tlps[json.pmc]) || json.name.match("Incubating",
"i")) {
+    if ((!tlpsByName[json.name] && tlps[json.pmc]) || json.name.match("Incubating",
"i")) {
 	pt = (json.pmc == "attic") ? "in the Attic" : "Sub-project"
     } else {
 	isTLP = true
@@ -325,8 +325,8 @@ function renderProjectPage(json, state)
 	isIncubating = true;
     }
 
-    if (committees[json.name]) {
-	appendLiInnerHTML(ul, "<b>Project founded:</b> " + committees[json.name]);
+    if (tlpsByName[json.name]) {
+	appendLiInnerHTML(ul, "<b>Project established:</b> " + tlpsByName[json.name].established);
     }
 
     // TLP Owner?
@@ -337,7 +337,7 @@ function renderProjectPage(json, state)
     } else {
 	json.pmc = state;
     }
-    if (!committees[json.name] && tlps[json.pmc]) {
+    if (!tlpsByName[json.name] && tlps[json.pmc]) {
 	appendLiInnerHTML(ul, "<b>Sub-project of:</b> <a href='/project.html?" +
json.pmc + "'>" + tlps[json.pmc].name + "</a>");
     }
 
@@ -590,8 +590,8 @@ function renderProjectsList(cat) {
 	var dates = [];
 	var dcount = {};
 	for (i in projects) {
-	    if (committees[projects[i].name]) {
-		var date = committees[projects[i].name];
+	    if (tlpsByName[projects[i].name]) {
+		var date = tlpsByName[projects[i].name].established;
 	    
 		if (dates.indexOf(date) < 0) {
 		    dates.push(date);
@@ -607,14 +607,14 @@ function renderProjectsList(cat) {
 	var ul = document.createElement('ul');
 	
 	for (l in dates) {
-	    var date = dates[l]
+	    var date = dates[l];
 	    var li = document.createElement('li');
-	    li.innerHTML = "<h3><a id='" + date + "'>" + date + " (" + dcount[date]
+ ")</a>:</h3>"
+	    li.innerHTML = "<h3><a id='" + date + "'>" + date + " (" + dcount[date]
+ ")</a>:</h3>";
 	    var cul = document.createElement('ul');
 	    for (i in projectsSorted) {
-		i = projectsSorted[i]
-		 if (committees[projects[i].name]) {
-		    xdate = committees[projects[i].name]
+		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));
 		    }
@@ -731,7 +731,6 @@ function renderProjectsList(cat) {
 }
 
 function buildProjectList(json) {
-    setCommittees(json, null);
     var cat = document.location.search.substr(1);
     if (cat.length == 0) {
 	cat = "name";
@@ -754,7 +753,7 @@ function buildProjectListAsTable(json) {
 	var shortp = p.split("-")[0];
 	if (unixgroups[shortp]) {
 	    type = "TLP";
-	    if ((!committees[project.name] && tlps[project.pmc]) || project.name.match(/incubating/i))
{
+	    if ((!tlpsByName[project.name] && tlps[project.pmc]) || project.name.match(/incubating/i))
{
 		type = "Sub-project";
 	    }
 	} else {
@@ -801,7 +800,7 @@ function buildProjectListAsTable(json) {
 
 
 function isTLP(project) {
-    return committees[project];
+    return tlpsByName[project];
 }
 
 // ------------ Front page rendering ------------\\
@@ -814,7 +813,7 @@ function htmlListTooltip(date,name,value
 
 function renderFrontPage() {
     var numchairs = 0;
-    for (i in committees) numchairs++;
+    for (i in tlps) numchairs++;
     cur = evolution[0].current;
     var nsubs = 0;
     
@@ -843,14 +842,14 @@ function renderFrontPage() {
     var parr = [];
     var cur = 0;
     var karr = [];
-    for (i in committees_raw) {
+    for (i in tlpsEvolution) {
 	karr.push(i);
     }
     karr.sort();
     
     for (var j in karr) {
 	var i = karr[j];
-	var changes = committees_raw[i];
+	var changes = tlpsEvolution[i];
 	var newTlps = [];
 	var retiredTlps = [];
 	for (var k in changes) {
@@ -1191,24 +1190,19 @@ function weaveInProjects(json) {
     }
 }
 
-function setCommittees(json, state) {
-    committees_raw = json
-    for (established in json) {
-	for (j in json[established]) {
-		var name = json[established][j];
-		if (name.match(/retired: /i)) {
-			delete committees[name.substring(9)]
-		} else {
-			committees[name] = established;
-		}
-	}
+function setTlps(json, state) {
+    for (p in json) {
+        p = json[p];
+        // tlps = { id -> tlp }
+        tlps[p.id] = p;
+        // tlpsByName = { name -> tlp }
+        tlpsByName[p.name] = p;
     }
     if (state) {
-	state();
+        state();
     }
 }
 
-
 // Render releases using datatables
 function buildReleases() {
     var arr = [];
@@ -1220,7 +1214,6 @@ function buildReleases() {
 	    // Shove the result into a row
 	    arr.push([ p, p, date, filename]);
 	}
-	
     }
     
     // Construct the data table
@@ -1254,14 +1247,14 @@ function buildReleases() {
 
 function preloadEverything(callback) {
     GetAsyncJSONArray([
-	    ["/json/foundation/tlps.json", function(json) { for(p in json) { p = json[p]; tlps[p.id]=p;
}; }],
+	    ["/json/foundation/tlps.json", setTlps],
 	    ["/json/foundation/groups.json", function(json) { unixgroups = json; }],
 	    ["/json/foundation/people_name.json", function(json) { people = json; }],
-	    ["/json/foundation/podlings-evolution.json", function(json) { evolution = json; }],
-	    ["/json/foundation/accounts-evolution.json", function(json) { accounts = json; }],
-	    ["/json/foundation/tlps-evolution.json", setCommittees],
 	    ["/json/foundation/projects.json", weaveInProjects],
 	    ["/json/foundation/podlings.json", weaveInProjects],
+            ["/json/foundation/tlps-evolution.json", function(json) { tlpsEvolution = json;
}],
+            ["/json/foundation/podlings-evolution.json", function(json) { evolution = json;
}],
+            ["/json/foundation/accounts-evolution.json", function(json) { accounts = json;
}],
 	    ["/json/foundation/releases.json", function(json) { releases = json; }]
         ],
 	callback);



Mime
View raw message