community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1663610 [1/8] - in /comdev/reporter.apache.org: data/ site/ site/css/ site/data/ site/img/ site/js/ site/js/foundation/ site/js/vendor/
Date Tue, 03 Mar 2015 10:19:16 GMT
Author: humbedooh
Date: Tue Mar  3 10:19:15 2015
New Revision: 1663610

URL: http://svn.apache.org/r1663610
Log:
Initial check-in of reporter.a.o system

Added:
    comdev/reporter.apache.org/data/
    comdev/reporter.apache.org/data/parsepmcs.py   (with props)
    comdev/reporter.apache.org/data/pmcs.json   (with props)
    comdev/reporter.apache.org/data/projects.json   (with props)
    comdev/reporter.apache.org/site/
    comdev/reporter.apache.org/site/addrelease.html
    comdev/reporter.apache.org/site/addrelease.py
    comdev/reporter.apache.org/site/css/
    comdev/reporter.apache.org/site/css/foundation.css
    comdev/reporter.apache.org/site/css/foundation.min.css
    comdev/reporter.apache.org/site/css/normalize.css
    comdev/reporter.apache.org/site/data/
    comdev/reporter.apache.org/site/getjson.py
    comdev/reporter.apache.org/site/img/
    comdev/reporter.apache.org/site/js/
    comdev/reporter.apache.org/site/js/foundation/
    comdev/reporter.apache.org/site/js/foundation.min.js
    comdev/reporter.apache.org/site/js/foundation/foundation.dropdown.js
    comdev/reporter.apache.org/site/js/foundation/foundation.interchange.js
    comdev/reporter.apache.org/site/js/foundation/foundation.js
    comdev/reporter.apache.org/site/js/foundation/foundation.reveal.js
    comdev/reporter.apache.org/site/js/foundation/foundation.tab.js
    comdev/reporter.apache.org/site/js/foundation/foundation.tooltip.js
    comdev/reporter.apache.org/site/js/foundation/foundation.topbar.js
    comdev/reporter.apache.org/site/js/vendor/
    comdev/reporter.apache.org/site/js/vendor/fastclick.js
    comdev/reporter.apache.org/site/js/vendor/jquery.cookie.js
    comdev/reporter.apache.org/site/js/vendor/jquery.js
    comdev/reporter.apache.org/site/js/vendor/modernizr.js
    comdev/reporter.apache.org/site/js/vendor/placeholder.js
    comdev/reporter.apache.org/site/reportingcycles.json

Added: comdev/reporter.apache.org/data/parsepmcs.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/data/parsepmcs.py?rev=1663610&view=auto
==============================================================================
Binary file - no diff available.

Propchange: comdev/reporter.apache.org/data/parsepmcs.py
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: comdev/reporter.apache.org/data/pmcs.json
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/data/pmcs.json?rev=1663610&view=auto
==============================================================================
Binary file - no diff available.

Propchange: comdev/reporter.apache.org/data/pmcs.json
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: comdev/reporter.apache.org/data/projects.json
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/data/projects.json?rev=1663610&view=auto
==============================================================================
Binary file - no diff available.

Propchange: comdev/reporter.apache.org/data/projects.json
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: comdev/reporter.apache.org/site/addrelease.html
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/addrelease.html?rev=1663610&view=auto
==============================================================================
--- comdev/reporter.apache.org/site/addrelease.html (added)
+++ comdev/reporter.apache.org/site/addrelease.html Tue Mar  3 10:19:15 2015
@@ -0,0 +1,46 @@
+<!doctype html>
+<html class="no-js" lang="en">
+  <head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <link rel="stylesheet" href="css/foundation.css" />
+    <script src="js/vendor/modernizr.js"></script>
+   <script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
+   <script type="text/javascript" src="https://www.google.com/jsapi"></script>
+   
+   <title>Apache Project Report Helper: Add a release</title>
+</head>
+<body>
+
+<div id="contents" class="row-12" style="text-align: center; margin: 0 auto; width: 1000px;
">
+  <h2>Apache Project Report Helper: Add a release</h2>
+  <p>Please fill out the fields below to add a release to our report database. This
is not a requirement, but a help to those that use the Apache Reporter System to gauge the
project's development.</p>
+   <form action="addrelease.py" method="post" id="form" onsubmit="validate(this)">
+    
+    <input type="hidden" name="date" value="" id="date"/>
+    <b>Project:</b></b><input type="text" name="project" value="" readonly="readonly"
id="project"/><br/>
+    <b>Full version name:</b></b><input type="text" name="version" value=""
placeholder="1.2.0" id="version"/><br/>
+    <b>Date of release (YYYY-MM-DD):</b></b><input type="text" name="xdate"
value="" placeholder="YYYY-MM-DD" id="xdate"/><br/>
+    <input type="submit" value="Add release data"/>
+   </form>
+</div>
+<div id="footer">
+   Copyright&copy; 2015, the Apache Software Foundation. Licensed under the Apache License
v/2.0<br/>
+   For inquiries, contact <a href="mailto:dev@community.apache.org">dev@community.apache.org</a>.
+</div>
+    <script src="js/foundation.min.js"></script>
+    <script>
+     var project = document.location.search.substr(1);
+     document.getElementById('project').value = project;
+     var date = new Date();
+     var xdate = document.getElementById('xdate');
+     xdate.value = date.getFullYear() + "-" + ((date.getMonth()+1) < 10? "0"+(date.getMonth()+1)
: (date.getMonth()+1)) + "-" + ((date.getDay()+1) < 10? "0"+(date.getDay()+1) : (date.getDay()+1))
+     
+     function validate(form) {
+      var x = document.getElementById('xdate').value.split("-");
+      var y = new Date(x[0],parseInt(x[1])-1,parseInt(x[2]));
+      document.getElementById('date').value = parseInt(y.getTime()/1000);
+     }
+    </script>
+</body>
+<html>

Added: comdev/reporter.apache.org/site/addrelease.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/addrelease.py?rev=1663610&view=auto
==============================================================================
--- comdev/reporter.apache.org/site/addrelease.py (added)
+++ comdev/reporter.apache.org/site/addrelease.py Tue Mar  3 10:19:15 2015
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+import os, sys, re, json, subprocess, urllib, datetime, time
+import base64, urllib2, cgi
+
+form = cgi.FieldStorage();
+user = os.environ['HTTP_X_AUTHENTICATED_USER'] if 'HTTP_X_AUTHENTICATED_USER' in os.environ
else "nobody"
+date = int(form['date'].value) if ('date' in form and len(form['date'].value) > 0) else
None
+version = form['version'].value if ('version' in form and len(form['version'].value) >
0) else None
+project = form['project'].value if 'project' in form else None
+    
+def getPMCs(uid):
+    groups = []
+    ldapdata = subprocess.check_output(['ldapsearch', '-x', '-LLL', '(|(memberUid=%s)(member=uid=%s,ou=people,dc=apache,dc=org))'
% (uid, uid), 'cn'])
+    picked = {}
+    for match in re.finditer(r"dn: cn=([a-zA-Z0-9]+),ou=pmc,ou=committees,ou=groups,dc=apache,dc=org",
ldapdata):
+        group = match.group(1)
+        if group != "incubator":
+            
+            groups.append(group)
+    return groups
+
+
+def getReleaseData(project):
+    try:
+        with open("/var/www/reporter.apache.org/data/releases/%s.json" % project, "r") as
f:
+            x = json.loads(f.read())
+            f.close()
+        return x;
+    except:
+        return {}
+
+saved = False
+projects = getPMCs(user)
+if date and version and project:
+    if project in projects:
+        rdata = getReleaseData(project)
+        rdata[version] = date
+        with open("/var/www/reporter.apache.org/data/releases/%s.json" % project, "w") as
f:
+            f.write(json.dumps(rdata))
+            f.close()
+            saved = True
+            print("Content-Type: text/html\r\n\r\n<h3>Data submitted!</h3>You
may see the updated project data at: <a href='https://reporter.apache.org/?%s'>https://reporter.apache.org/?%s</a>."
% (project, project))
+
+if not saved:
+    print("Content-Type: text/plain\r\n\r\nCould not save. Make sure you have filled out
all fields and have access to this projects data! For further inquiries, please contact dev@community.apache.org")
+    
\ No newline at end of file



Mime
View raw message