community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1679439 - /comdev/projects.apache.org/site/js/projects.js
Date Thu, 14 May 2015 19:23:07 GMT
Author: hboutemy
Date: Thu May 14 19:23:07 2015
New Revision: 1679439

URL: http://svn.apache.org/r1679439
Log:
for main project of TLPs, differentiate TLP info from project info, adding subprojects list
if the TLP has multiple subprojects

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=1679439&r1=1679438&r2=1679439&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Thu May 14 19:23:07 2015
@@ -256,6 +256,9 @@ function appendLiInnerHTML(ul,html) {
 }
 
 function renderProjectPage(project, projectId) {
+    var obj = document.getElementById('contents');
+    var isTLP = false;
+
     if ((!project || !project.name) && projects[projectId]) {
         project = projects[projectId];
     }
@@ -270,6 +273,10 @@ function renderProjectPage(project, proj
     var unixgroup = projectId.split("-")[0];
     // special case: empire-db
     if (unixgroup == "empire") unixgroup = "empire-db";
+    if (unixgroup == "hc") unixgroup = "httpcomponents";
+    if (project.pmc == "attic") {
+        unixgroup = "attic";
+    }
     var tlpId = unixgroup;
     if (!tlps[unixgroup]) {
         // one TLP has a unix group that is different from TLP id: webservices (group=ws),
see parsecommittees.py#group_ids
@@ -281,14 +288,11 @@ function renderProjectPage(project, proj
         }
     }
     if (isIncubating) {
-        tlpId = 'incubator'
+        tlpId = 'incubator';
         project.pmc = tlpId;
     }
     var tlp = tlps[tlpId];
 
-    var obj = document.getElementById('contents');
-    var isTLP = false;
-
     // Start by splitting the name, thus fetching the root name of the project, and not the
sub-project.
 
     if (!project.description || project.description.length == 0) {
@@ -310,16 +314,68 @@ function renderProjectPage(project, proj
     }
     obj.innerHTML = "<h1>" + name + "</h1>";
 
+    // project description
     var p = document.createElement('p');
     p.style.fontFamily = '"Times New Roman", Times, serif';
     p.innerHTML = project.description.replace(/([^\r\n]+)\r?\n\r?\n/g,function(a) { return
"<p>"+a+"</p>"});
     obj.appendChild(p);
 
+    var ul = document.createElement('ul');
+
+    if (isTLP) {
+        appendElementWithInnerHTML(obj,'h4',"Top Level Project data:");
+
+        appendLiInnerHTML(ul, "<b>Website:</b> <a href='" + tlp.homepage +
"' target='_blank'>" + tlp.homepage + "</a>");
+
+        appendLiInnerHTML(ul, "<b>Project established:</b> " + tlpsByName[project.name].established);
+
+        // VP
+        appendLiInnerHTML(ul, "<b>PMC Chair:</b> " + people[tlp.chair]);
+
+        // Reporting cycle
+        var cycles = [ "every month", "January, April, July, October", "February, May, August,
November", "March, June, September, December" ];
+        appendLiInnerHTML(ul, "<b>Reporting cycle:</b> " + cycles[tlp.reporting]
+ ", see <a href='https://whimsy.apache.org/board/minutes/" + camelCase(project.pmc) +
".html'>minutes</a>");
+
+        // PMC
+        if (unixgroups[unixgroup+"-pmc"]) {
+            var pmcl = [];
+            var pmcgroup = unixgroups[unixgroup+"-pmc"];
+            for (i in pmcgroup) {
+                pmcl.push(linkCommitterIndex(pmcgroup[i]));
+            }
+            appendLiInnerHTML(ul, "<b>PMC Members (" + pmcgroup.length + "):</b>
<blockquote>" + pmcl.join(", &nbsp;") + "</blockqoute>");
+        }
+
+        // Committers
+        var commitl = [];
+        var commitgroup = unixgroups[unixgroup];
+        for (i in commitgroup) {
+            commitl.push(linkCommitterIndex(commitgroup[i]));
+        }
+        appendLiInnerHTML(ul, "<b>Committers (" + commitgroup.length + "):</b>
<blockquote>" + commitl.join(", &nbsp;") + "</blockqoute>");
+
+        var subprojects = [];
+        for (p in projects) {
+            if (projects[p].pmc == tlpId) {
+                subprojects.push(p);
+            }
+        }
+        if (subprojects.length > 1) {
+            var phtml = [];
+            for (p in subprojects) {
+                p = subprojects[p];
+                phtml.push(projectLink(p));
+            }
+            appendLiInnerHTML(ul, "<b>Sub-projects (" + subprojects.length + "):</b>
" + phtml.join(", "));
+        }
+
+        obj.appendChild(ul);
+
+        ul = document.createElement('ul');
+    }
 
     // Base data
     appendElementWithInnerHTML(obj,'h4',"Project base data:");
-    obj.appendChild(p);
-    var ul = document.createElement('ul');
 
     // Categories
     if (project['category']) {
@@ -333,7 +389,7 @@ function renderProjectPage(project, proj
     }
 
     // Website
-    if (project.homepage) {
+    if (project.homepage && ((project.homepage != tlp.homepage) && !isTLP
)) {
 	appendLiInnerHTML(ul, "<b>Website:</b> <a href='" + project.homepage + "'
target='_blank'>" + project.homepage + "</a>");
     }
     if (isIncubating) {
@@ -344,10 +400,6 @@ function renderProjectPage(project, proj
 	appendLiInnerHTML(ul, "<b>Project status:</b> <span class='pretired'>Retired</span>");
     }
 
-    if (tlpsByName[project.name]) {
-	appendLiInnerHTML(ul, "<b>Project established:</b> " + tlpsByName[project.name].established);
-    }
-
     // TLP Owner?
     if (project.pmc) {
 	if (project.pmc.match(/http:\/\/([a-z0-9]+)/i)) {
@@ -360,29 +412,8 @@ function renderProjectPage(project, proj
 	appendLiInnerHTML(ul, "<b>Sub-project of:</b> <a href='/project.html?" +
project.pmc + "'>" + tlps[project.pmc].name + "</a>");
     }
 
-    if (isTLP) {
-        var tlp = tlps[project.pmc];
-
-	// VP
-        appendLiInnerHTML(ul, "<b>PMC Chair:</b> " + people[tlp.chair]);
-
-	// Reporting cycle
-        var cycles = [ "every month", "January, April, July, October", "February, May, August,
November", "March, June, September, December" ];
-        appendLiInnerHTML(ul, "<b>Reporting cycle:</b> " + cycles[tlp.reporting]
+ ", see <a href='https://whimsy.apache.org/board/minutes/" + camelCase(project.pmc) +
".html'>minutes</a>");
-
-	// PMC
-	if (unixgroups[unixgroup+"-pmc"]) {
-	    var pmcl = [];
-	    var pmcgroup = unixgroups[unixgroup+"-pmc"];
-	    for (i in pmcgroup) {
-		pmcl.push(linkCommitterIndex(pmcgroup[i]));
-	    }
-	    appendLiInnerHTML(ul, "<b>PMC Members (" + pmcgroup.length + "):</b> <blockquote>"
+ pmcl.join(", &nbsp;") + "</blockqoute>");
-	}
-    }
-
     // Committers
-    if (unixgroups[unixgroup] && (isTLP || isIncubating)) {
+    if (isIncubating && unixgroups[unixgroup]) {
 	var commitl = [];
 	var commitgroup = unixgroups[unixgroup];
 	for (i in commitgroup) {



Mime
View raw message