community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864073 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js source/init.js wizard.js
Date Wed, 31 Jul 2019 15:21:46 GMT
Author: humbedooh
Date: Wed Jul 31 15:21:46 2019
New Revision: 1864073

URL: http://svn.apache.org/viewvc?rev=1864073&view=rev
Log:
Show only the user's projects at first, but allow showing everything...

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

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1864073&r1=1864072&r2=1864073&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Wed Jul 31 15:21:46
2019
@@ -66,10 +66,18 @@ function generate_meta(data) {
 }
 
 
-function splash(state, json) {
+function pre_splash(state, json) {
+    cycles = json;
+    GET("/getjson.py", splash, {});
+}
+
+function splash(state, json, all) {
+    pdata = json;
     let html = document.body;
-    html.innerHTML = '';
-    let tbl = new HTML('table');
+    html.style.margin = '16px';
+    let link = all ? '(<a href="javascript:splash({}, pdata, false);">show only your
projects</a>)' : '(<a href="javascript:splash({}, pdata, true);">show all projects</a>)'
+    html.innerHTML = '<h3>Your Projects: %s</h3>'.format(link);
+    let tbl = new HTML('table', {cellpadding: '8px', style: {margin: '20px'}});
     let hdr = new HTML('tr', {style: {color: "#963"}})
     hdr.inject([
         new HTML('td', {}, "Project:"),
@@ -77,10 +85,11 @@ function splash(state, json) {
         new HTML('td', {}, "Wizard link:")
     ])
     tbl.inject(hdr);
-    
-    for (var key in json) {
+    let keys = json.pdata;
+    if (all) keys = cycles;
+    for (var key in keys) {
         let tr = new HTML('tr');
-        let rd = new HTML('td', {}, getReportDate(json, key, true));
+        let rd = new HTML('td', {}, getReportDate(cycles, key, true));
         let link = new HTML('td', {}, new HTML('a', {href: '?%s'.format(key)}, "Start reporting
guide"));
         let title = new HTML('td', {}, new HTML('b', {}, key));
         tr.inject([title, rd, link])

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js?rev=1864073&r1=1864072&r2=1864073&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js Wed Jul 31 15:21:46 2019
@@ -19,7 +19,7 @@ console.log("/******* ASF Board Report W
 // Adjust titles:
 let project = location.search.substr(1);
 if (project.length < 2) {
-    GET("/reportingcycles.json", splash, {});
+    GET("/reportingcycles.json", pre_splash, {});
 } else {
     document.title = "ASF Board Report Wizard: %s".format(project);
     let titles = document.getElementsByClassName("title");

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=1864073&r1=1864072&r2=1864073&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Wed Jul 31 15:21:46 2019
@@ -1054,10 +1054,18 @@ function generate_meta(data) {
 }
 
 
-function splash(state, json) {
+function pre_splash(state, json) {
+    cycles = json;
+    GET("/getjson.py", splash, {});
+}
+
+function splash(state, json, all) {
+    pdata = json;
     let html = document.body;
-    html.innerHTML = '';
-    let tbl = new HTML('table');
+    html.style.margin = '16px';
+    let link = all ? '(<a href="javascript:splash({}, pdata, false);">show only your
projects</a>)' : '(<a href="javascript:splash({}, pdata, true);">show all projects</a>)'
+    html.innerHTML = '<h3>Your Projects: %s</h3>'.format(link);
+    let tbl = new HTML('table', {cellpadding: '8px', style: {margin: '20px'}});
     let hdr = new HTML('tr', {style: {color: "#963"}})
     hdr.inject([
         new HTML('td', {}, "Project:"),
@@ -1065,10 +1073,11 @@ function splash(state, json) {
         new HTML('td', {}, "Wizard link:")
     ])
     tbl.inject(hdr);
-    
-    for (var key in json) {
+    let keys = json.pdata;
+    if (all) keys = cycles;
+    for (var key in keys) {
         let tr = new HTML('tr');
-        let rd = new HTML('td', {}, getReportDate(json, key, true));
+        let rd = new HTML('td', {}, getReportDate(cycles, key, true));
         let link = new HTML('td', {}, new HTML('a', {href: '?%s'.format(key)}, "Start reporting
guide"));
         let title = new HTML('td', {}, new HTML('b', {}, key));
         tr.inject([title, rd, link])
@@ -1120,7 +1129,7 @@ console.log("/******* ASF Board Report W
 // Adjust titles:
 let project = location.search.substr(1);
 if (project.length < 2) {
-    GET("/reportingcycles.json", splash, {});
+    GET("/reportingcycles.json", pre_splash, {});
 } else {
     document.title = "ASF Board Report Wizard: %s".format(project);
     let titles = document.getElementsByClassName("title");



Mime
View raw message