labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1523510 [1/5] - in /labs/panopticon/src/asf/panopticon: __init__.py static/css/panopticon.css static/js/bootstrap.js static/js/bootstrap.min.js static/js/handlebars.js static/js/user-popover.js templates/layout.html
Date Sun, 15 Sep 2013 22:06:30 GMT
Author: adc
Date: Sun Sep 15 22:06:29 2013
New Revision: 1523510

URL: http://svn.apache.org/r1523510
Log:
Nifty popup when one overs over username.

Added:
    labs/panopticon/src/asf/panopticon/static/js/handlebars.js
    labs/panopticon/src/asf/panopticon/static/js/user-popover.js
Modified:
    labs/panopticon/src/asf/panopticon/__init__.py
    labs/panopticon/src/asf/panopticon/static/css/panopticon.css
    labs/panopticon/src/asf/panopticon/static/js/bootstrap.js
    labs/panopticon/src/asf/panopticon/static/js/bootstrap.min.js
    labs/panopticon/src/asf/panopticon/templates/layout.html

Modified: labs/panopticon/src/asf/panopticon/__init__.py
URL: http://svn.apache.org/viewvc/labs/panopticon/src/asf/panopticon/__init__.py?rev=1523510&r1=1523509&r2=1523510&view=diff
==============================================================================
--- labs/panopticon/src/asf/panopticon/__init__.py (original)
+++ labs/panopticon/src/asf/panopticon/__init__.py Sun Sep 15 22:06:29 2013
@@ -18,12 +18,12 @@
 #
 from logging import getLogger
 
-from flask import Flask, render_template, request, redirect, flash, current_app, g, abort,
session
+from flask import Flask, render_template, request, redirect, flash, current_app, g, abort,
session, jsonify, make_response, Response
 from flask.ext.principal import identity_changed, Identity, Principal, identity_loaded
 from flask.ext import principal
 
 from asf.data import ldap
-from asf.person import Person
+from asf.person import Person, PersonError
 
 
 app = Flask(__name__)
@@ -39,6 +39,29 @@ def hello_world():
     return render_template('index.html')
 
 
+@app.route('/api/users/<username>')
+def user_info(username):
+    if username == 'tester':
+        return jsonify({
+            'username': 'tester',
+            'fullname': 'Automated build user',
+            'email': 'ask_tools@linkedin.com',
+            'email_string': 'ask_tools@linkedin.com',
+        })
+    try:
+        person = Person(username)
+    except PersonError:
+        return make_response(Response('No Such User %s' % username, status=404))
+
+    return jsonify({
+        'username': person.username,
+        'fullname': person.fullname,
+        'email': person.email,
+        'email_string': person.email_string,
+        'picture_url': person.picture_url,
+    })
+
+
 @app.before_request
 def before_request():
     g.login_allowed = current_app.debug or request.scheme == 'https'

Modified: labs/panopticon/src/asf/panopticon/static/css/panopticon.css
URL: http://svn.apache.org/viewvc/labs/panopticon/src/asf/panopticon/static/css/panopticon.css?rev=1523510&r1=1523509&r2=1523510&view=diff
==============================================================================
--- labs/panopticon/src/asf/panopticon/static/css/panopticon.css (original)
+++ labs/panopticon/src/asf/panopticon/static/css/panopticon.css Sun Sep 15 22:06:29 2013
@@ -45,3 +45,16 @@ code {
 p.text-warning.navbar-text {
     color: #c09853;
 }
+
+
+
+
+
+/* Styles for user info popups */
+.popup-img {
+    float: left;
+    padding-right: 15px;
+}
+.popover { z-index: 10001; }
+
+label .required-mark { color: #b94a48; }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message