community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1704127 - /comdev/projects.apache.org/site/js/projects.js
Date Sun, 20 Sep 2015 12:37:18 GMT
Author: sebb
Date: Sun Sep 20 12:37:17 2015
New Revision: 1704127

URL: http://svn.apache.org/viewvc?rev=1704127&view=rev
Log:
Sort project releases by most recent first

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=1704127&r1=1704126&r2=1704127&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Sun Sep 20 12:37:17 2015
@@ -458,13 +458,17 @@ function renderProjectPage(project, proj
         appendLiInnerHTML(ul, "<b>Download:</b> <a href='" + project['download-page']
+ "' target='_blank'>" + project['download-page'] + "</a>");
     }
     if (project.release) {
+        project.release.sort(function(a,b){// reverse date order (most recent first)
+            ac = a.created ? a.created : '1970-01-01';
+            bc = b.created ? b.created : '1970-01-01';
+            if(ac < bc) return 1;
+            if(ac > bc) return -1;
+            return 0;});
         var r;
         for (r in project.release) {
             r = project.release[r];
             var html = "<b>" + (r.revision ? r.revision : r.version) + "</b>";
-            if (r.created) {
-                html += " (" + r.created + ")";
-            }
+            html += " (" + (r.created ? r.created : 'unknown') + ")";
             appendLiInnerHTML(ul, html + ": " + r.name);
         }
     }



Mime
View raw message