community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1872888 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/statistics_generator.js wizard.js
Date Thu, 16 Jan 2020 17:34:43 GMT
Author: humbedooh
Date: Thu Jan 16 17:34:42 2020
New Revision: 1872888

URL: http://svn.apache.org/viewvc?rev=1872888&view=rev
Log:
also fix on stats page...

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js?rev=1872888&r1=1872887&r2=1872888&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/statistics_generator.js Thu Jan
16 17:34:42 2020
@@ -942,16 +942,19 @@ function statistics_releases(data) {
     ages = ages.splice(0, new_releases >= 3 ? new_releases : 3);
     let to_show = ages.length;
     let releases_shown = 0;
+    let releases_picked = {};
     while (ages.length) {
-        let ts = ages.shift();
-        for (var rel in data.releases[project]) {
-            if (releases_shown == to_show) break;
-            let reldate = moment(data.releases[project][rel] * 1000.0);
-            if (ts == reldate.unix()) {
-                rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.utc().format('YYYY-MM-DD'));
-                releases_shown++;
-            }
-        }
+      let ts = ages.shift();
+      for (var rel in data.releases[project]) {
+        if (releases_shown >= to_show) break;
+          let reldate = moment(data.releases[project][rel] * 1000.0);
+          if (releases_picked[rel]) continue;
+          if (ts == reldate.unix()) {
+              rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.utc().format('YYYY-MM-DD'));
+              releases_shown++;
+              releases_picked[rel] = true;
+          }
+      }
     }
     if (rtxt != '') {
         rtxt = "<h6>Recent releases: </h6><ul>" + rtxt + "</ul>";

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1872888&r1=1872887&r2=1872888&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Thu Jan 16 17:34:42 2020
@@ -3142,16 +3142,19 @@ function statistics_releases(data) {
     ages = ages.splice(0, new_releases >= 3 ? new_releases : 3);
     let to_show = ages.length;
     let releases_shown = 0;
+    let releases_picked = {};
     while (ages.length) {
-        let ts = ages.shift();
-        for (var rel in data.releases[project]) {
-            if (releases_shown == to_show) break;
-            let reldate = moment(data.releases[project][rel] * 1000.0);
-            if (ts == reldate.unix()) {
-                rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.utc().format('YYYY-MM-DD'));
-                releases_shown++;
-            }
-        }
+      let ts = ages.shift();
+      for (var rel in data.releases[project]) {
+        if (releases_shown >= to_show) break;
+          let reldate = moment(data.releases[project][rel] * 1000.0);
+          if (releases_picked[rel]) continue;
+          if (ts == reldate.unix()) {
+              rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.utc().format('YYYY-MM-DD'));
+              releases_shown++;
+              releases_picked[rel] = true;
+          }
+      }
     }
     if (rtxt != '') {
         rtxt = "<h6>Recent releases: </h6><ul>" + rtxt + "</ul>";



Mime
View raw message