From a35a43eeaf6e7fe1247657ffffda8bb1735def12 Mon Sep 17 00:00:00 2001 From: Eevee Date: Sat, 8 May 2010 16:28:17 -0700 Subject: [PATCH] Dead simple user list. --- spline/plugins/users/__init__.py | 3 ++- spline/plugins/users/controllers/users.py | 8 +++----- spline/plugins/users/templates/users/list.mako | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 spline/plugins/users/templates/users/list.mako diff --git a/spline/plugins/users/__init__.py b/spline/plugins/users/__init__.py index f0c8a33..e606823 100644 --- a/spline/plugins/users/__init__.py +++ b/spline/plugins/users/__init__.py @@ -22,7 +22,8 @@ def add_routes_hook(map, *args, **kwargs): # Self-admin map.connect('/users/{id};{name}/edit', controller='users', action='profile_edit') - # Public per-user pages + # Public user pages + map.connect('/users', controller='users', action='list') map.connect('/users/{id};{name}', controller='users', action='profile') map.connect('/users/{id}', controller='users', action='profile') diff --git a/spline/plugins/users/controllers/users.py b/spline/plugins/users/controllers/users.py index 4811aa0..4afb9cd 100644 --- a/spline/plugins/users/controllers/users.py +++ b/spline/plugins/users/controllers/users.py @@ -41,11 +41,9 @@ class ProfileEditForm(Form): class UsersController(BaseController): - def index(self): - # Return a rendered template - # return render('/template.mako') - # or, Return a response - return 'stub' + def list(self): + c.users = meta.Session.query(model.User).order_by(model.User.id.asc()) + return render('/users/list.mako') def profile(self, id, name=None): """Main user profile. diff --git a/spline/plugins/users/templates/users/list.mako b/spline/plugins/users/templates/users/list.mako new file mode 100644 index 0000000..fc25241 --- /dev/null +++ b/spline/plugins/users/templates/users/list.mako @@ -0,0 +1,16 @@ +<%inherit file="/base.mako" /> +<%namespace name="userlib" file="/users/lib.mako" /> + +<%def name="title()">Users + +

Users

+ + -- 2.7.4