[llvm-commits] [zorg] r125870 - in /zorg/trunk/llvmlab/llvmlab/ui: templates/user.html templates/users.html views.py

Daniel Dunbar daniel at zuster.org
Fri Feb 18 08:41:08 PST 2011


Author: ddunbar
Date: Fri Feb 18 10:41:08 2011
New Revision: 125870

URL: http://llvm.org/viewvc/llvm-project?rev=125870&view=rev
Log:
llvmlab: Add a per-user info page.

Added:
    zorg/trunk/llvmlab/llvmlab/ui/templates/user.html
      - copied, changed from r125869, zorg/trunk/llvmlab/llvmlab/ui/templates/users.html
Modified:
    zorg/trunk/llvmlab/llvmlab/ui/templates/users.html
    zorg/trunk/llvmlab/llvmlab/ui/views.py

Copied: zorg/trunk/llvmlab/llvmlab/ui/templates/user.html (from r125869, zorg/trunk/llvmlab/llvmlab/ui/templates/users.html)
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/templates/user.html?p2=zorg/trunk/llvmlab/llvmlab/ui/templates/user.html&p1=zorg/trunk/llvmlab/llvmlab/ui/templates/users.html&r1=125869&r2=125870&rev=125870&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/templates/users.html (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/templates/user.html Fri Feb 18 10:41:08 2011
@@ -9,13 +9,9 @@
 {% else %}
 
 <table>
-<tr><th>User Name</th><th>User Email</th></tr>
-{% for user in config.data.users.values() %}
-<tr>
-  <td>{{ user.name }}</td>
-  <td>{{ user.email }}</td>
-</tr>
-{% endfor %}
+<tr><th>ID</th><td>{{ user.id }}</td></tr>
+<tr><th>Name</th><td>{{ user.name }}</td></tr>
+<tr><th>Email</th><td>{{ user.email }}</td></tr>
 </table>
 
 {% endif %}

Modified: zorg/trunk/llvmlab/llvmlab/ui/templates/users.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/templates/users.html?rev=125870&r1=125869&r2=125870&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/templates/users.html (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/templates/users.html Fri Feb 18 10:41:08 2011
@@ -9,9 +9,14 @@
 {% else %}
 
 <table>
-<tr><th>User Name</th><th>User Email</th></tr>
+<thead>
+<tr><th colspan=3>Users</th></tr>
+<tr><th>ID</th><th>Name</th><th>Email</th></tr>
+</thead>
 {% for user in config.data.users.values() %}
 <tr>
+  <td><a href="{{ url_for('user', username=user.id) }}">{{
+      user.id }}</a></td>
   <td>{{ user.name }}</td>
   <td>{{ user.email }}</td>
 </tr>

Modified: zorg/trunk/llvmlab/llvmlab/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/views.py?rev=125870&r1=125869&r2=125870&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/views.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/views.py Fri Feb 18 10:41:08 2011
@@ -1,4 +1,5 @@
 import flask
+from flask import abort
 from flask import redirect
 from flask import render_template
 from flask import request
@@ -20,6 +21,14 @@
 def users():
     return render_template("users.html")
 
+ at ui.route('/user/<username>')
+def user(username):
+    user = current_app.config.data.users.get(username)
+    if user is None:
+        abort(404)
+
+    return render_template("user.html", user=user)
+
 @ui.route('/login', methods=['GET', 'POST'])
 def login():
     # If this isn't a post request, return the login template.





More information about the llvm-commits mailing list