community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1679457 - /comdev/projects.apache.org/site/js/projects.js
Date Thu, 14 May 2015 20:35:11 GMT
Author: hboutemy
Date: Thu May 14 20:35:10 2015
New Revision: 1679457

URL: http://svn.apache.org/r1679457
Log:
improve description stability in each situation

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=1679457&r1=1679456&r2=1679457&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Thu May 14 20:35:10 2015
@@ -297,9 +297,17 @@ 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.
-    var description = tlp.shortdesc;
-    if (project && (!project.description || project.description.length == 0)) {
-	description = (project.shortdesc && project.shortdesc.length > 0 ) ? project.shortdesc
: "No description available"
+    var description = "";
+    if (project) {
+        if (!_.isEmpty(project.description)) {
+            description = project.description;
+        } else if (!_.isEmpty(project.shortdesc)) {
+            description = project.shortdesc;
+        } else if (!_.isEmpty(tlp.shortdesc)) {
+            description = tlp.shortdesc;
+        } else {
+            description = "No description available";
+        }
     }
 
     // Title + description



Mime
View raw message