Author: humbedooh Date: Sun Mar 8 15:12:56 2015 New Revision: 1665016 URL: http://svn.apache.org/r1665016 Log: Reflow report template if >1 new committer or pmc member this time around, for easier overview of things
Modified: comdev/reporter.apache.org/site/render.js Modified: comdev/reporter.apache.org/site/render.js URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/render.js?rev=1665016&r1=1665015&r2=1665016&view=diff ============================================================================== --- comdev/reporter.apache.org/site/render.js (original) +++ comdev/reporter.apache.org/site/render.js Sun Mar 8 15:12:56 2015 @@ -260,6 +260,20 @@ function renderFrontPage(json) { } else { changes.innerHTML += "<h5>Changes within the last 3 months:</h5>" var l = 0; + + // pre-flight check + var npmc = 0; + for (i in json.changes[pmc].pmc) { + var entry = json.changes[pmc].pmc[i]; + if (entry[1] > after.getTime() / 1000) { + npmc++; + } + } + if (npmc > 1) { + addLine(pmc, " - New PMC members:") + } + + for (i in json.changes[pmc].pmc) { var entry = json.changes[pmc].pmc[i]; if (entry[1] > np) { @@ -269,13 +283,32 @@ function renderFrontPage(json) { if (entry[1] > after.getTime() / 1000) { l++; changes.innerHTML += "→ " + entry[0] + " was added to the PMC on " + new Date(entry[1] * 1000).toDateString() + "<br/>"; - addLine(pmc, " - " + entry[0] + " was added to the PMC on " + new Date(entry[1] * 1000).toDateString()) + addLine(pmc, (npmc>1? " " : "") + " - " + entry[0] + " was added to the PMC on " + new Date(entry[1] * 1000).toDateString()) } } if (l == 0) { addLine(pmc, " - No new PMC members added in the last 3 months") changes.innerHTML += "→ <font color='red'><b>No new PMC members in the last 3 months.</b></font><br/>"; } + if (npn) { + if (np < after.getTime() / 1000) { + addLine(pmc, " - Last PMC addition was " + npn + " at " + new Date(np * 1000).toDateString()) + } + changes.innerHTML += "→ " + "<b>Latest PMC addition: </b>" + new Date(np * 1000).toDateString() + " (" + npn + ")<br/>" + } + + + // pre-flight check + var ncom = 0; + for (i in json.changes[pmc].committer) { + var entry = json.changes[pmc].committer[i]; + if (entry[1] > after.getTime() / 1000) { + ncom++; + } + } + if (ncom > 1) { + addLine(pmc, " - New commmitters:") + } for (i in json.changes[pmc].committer) { var entry = json.changes[pmc].committer[i]; if (entry[1] > nc) { @@ -285,19 +318,14 @@ function renderFrontPage(json) { if (entry[1] > after.getTime() / 1000) { l++; changes.innerHTML += "→ " + entry[0] + " was added as a committer on " + new Date(entry[1] * 1000).toDateString() + "<br/>"; - addLine(pmc, " - " + entry[0] + " was added as a committer on " + new Date(entry[1] * 1000).toDateString()) + addLine(pmc, (ncom>1? " " : "") + " - " + entry[0] + " was added as a committer on " + new Date(entry[1] * 1000).toDateString()) } } if (l == 0) { changes.innerHTML += "→ <font color='red'><b>No new committers in the last 3 months.</b></font><br/>"; addLine(pmc, " - No new committers added in the last 3 months") } - if (npn) { - if (np < after.getTime() / 1000) { - addLine(pmc, " - Last PMC addition was " + npn + " at " + new Date(np * 1000).toDateString()) - } - changes.innerHTML += "→ " + "<b>Latest PMC addition: </b>" + new Date(np * 1000).toDateString() + " (" + npn + ")<br/>" - } + if (ncn) { if (nc < after.getTime() / 1000) { addLine(pmc, " - Last committer addition was " + ncn + " at " + new Date(nc * 1000).toDateString())