community-commits mailing list archives

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

URL: http://svn.apache.org/r1679440
Log:
display TLP info even if no project DOAP has been written

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=1679440&r1=1679439&r2=1679440&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Thu May 14 19:40:55 2015
@@ -262,19 +262,22 @@ function renderProjectPage(project, proj
     if ((!project || !project.name) && projects[projectId]) {
         project = projects[projectId];
     }
-    if (!project || !project.name) {
+    if (tlps[projectId]) {
+        isTLP = true;
+    }
+    if ((!project || !project.name) && (!isTLP)) {
         obj.innerHTML = "<h2>Sorry, I don't have any information available about this
project</h2>";
         return;
     }
 
-    var isIncubating = project.podling || project.name.match(/incubating/i);
+    var isIncubating = project && (project.podling || project.name.match(/incubating/i));
 
     // Rerig the unix name and tlp
     var unixgroup = projectId.split("-")[0];
     // special case: empire-db
     if (unixgroup == "empire") unixgroup = "empire-db";
     if (unixgroup == "hc") unixgroup = "httpcomponents";
-    if (project.pmc == "attic") {
+    if (project && project.pmc == "attic") {
         unixgroup = "attic";
     }
     var tlpId = unixgroup;
@@ -294,21 +297,21 @@ function renderProjectPage(project, proj
     var tlp = tlps[tlpId];
 
     // 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) {
-	project.description = (project.shortdesc && project.shortdesc.length > 0 ) ?
project.shortdesc : "No description available"
+    var description = tlp.shortdesc;
+    if (project && (!project.description || project.description.length == 0)) {
+	description = (project.shortdesc && project.shortdesc.length > 0 ) ? project.shortdesc
: "No description available"
     }
 
     // Title + description
     var pt = "Top Level Project";
     if (isIncubating) {
         pt = "Incubating";
-    } else if (!tlpsByName[project.name] && tlps[project.pmc]) {
+    } else if (project && !tlpsByName[project.name] && tlps[project.pmc])
{
 	pt = (project.pmc == "attic") ? "in the Attic" : "Sub-project"
     } else {
 	isTLP = true
     }
-    var name = project.name;
+    var name = project ? project.name : tlp.name;
     if (!name.match(/incubating/i)) {
         name +=  " (" + pt + ")";
     }
@@ -317,7 +320,7 @@ function renderProjectPage(project, proj
     // 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>"});
+    p.innerHTML = description.replace(/([^\r\n]+)\r?\n\r?\n/g,function(a) { return "<p>"+a+"</p>"});
     obj.appendChild(p);
 
     var ul = document.createElement('ul');
@@ -327,7 +330,7 @@ function renderProjectPage(project, proj
 
         appendLiInnerHTML(ul, "<b>Website:</b> <a href='" + tlp.homepage +
"' target='_blank'>" + tlp.homepage + "</a>");
 
-        appendLiInnerHTML(ul, "<b>Project established:</b> " + tlpsByName[project.name].established);
+        appendLiInnerHTML(ul, "<b>Project established:</b> " + tlp.established);
 
         // VP
         appendLiInnerHTML(ul, "<b>PMC Chair:</b> " + people[tlp.chair]);



Mime
View raw message