From d1c82313143b77249223d6da56823c51d1255137 Mon Sep 17 00:00:00 2001 From: "Sven R. Kunze" Date: Mon, 18 Jun 2012 23:34:15 +0200 Subject: [PATCH 01/20] Added route 'user/dashboard' and action 'dashboard' to user controller. --- ckan/config/routing.py | 1 + ckan/controllers/user.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/ckan/config/routing.py b/ckan/config/routing.py index 3890032817f..b529d90eed7 100644 --- a/ckan/config/routing.py +++ b/ckan/config/routing.py @@ -252,6 +252,7 @@ def make_map(): m.connect('/user/edit', action='edit') # Note: openid users have slashes in their ids, so need the wildcard # in the route. + m.connect('/user/dashboard', action='dashboard') m.connect('/user/followers/{id:.*}', action='followers') m.connect('/user/edit/{id:.*}', action='edit') m.connect('/user/reset/{id:.*}', action='perform_reset') diff --git a/ckan/controllers/user.py b/ckan/controllers/user.py index c1b81dc3070..ebcfeaa9421 100644 --- a/ckan/controllers/user.py +++ b/ckan/controllers/user.py @@ -444,3 +444,16 @@ def followers(self, id=None): c.followers = get_action('user_follower_list')(context, {'id':c.user_dict['id']}) return render('user/followers.html') + + + def dashboard(self, id=None): + context = {'model': model, 'session': model.Session, + 'user': c.user or c.author, 'for_view': True} + data_dict = {'id':id, 'user_obj':c.userobj} + self._setup_template_variables(context, data_dict) + c.followers = get_action('user_follower_list')(context, + {'id':c.user_dict['id']}) + return render('user/followers.html') + + + From b26daa5cc74f9914de317012edd58d1d17283147 Mon Sep 17 00:00:00 2001 From: "Sven R. Kunze" Date: Tue, 19 Jun 2012 15:04:08 +0200 Subject: [PATCH 02/20] New template 'dashboard.html', modified layout --- ckan/controllers/user.py | 4 +--- ckan/templates/user/dashboard.html | 16 ++++++++++++++++ ckan/templates/user/layout.html | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 ckan/templates/user/dashboard.html diff --git a/ckan/controllers/user.py b/ckan/controllers/user.py index ebcfeaa9421..ed967b781e7 100644 --- a/ckan/controllers/user.py +++ b/ckan/controllers/user.py @@ -451,9 +451,7 @@ def dashboard(self, id=None): 'user': c.user or c.author, 'for_view': True} data_dict = {'id':id, 'user_obj':c.userobj} self._setup_template_variables(context, data_dict) - c.followers = get_action('user_follower_list')(context, - {'id':c.user_dict['id']}) - return render('user/followers.html') + return render('user/dashboard.html') diff --git a/ckan/templates/user/dashboard.html b/ckan/templates/user/dashboard.html new file mode 100644 index 00000000000..139443aefca --- /dev/null +++ b/ckan/templates/user/dashboard.html @@ -0,0 +1,16 @@ + + + ${c.user} - Dashboard - User + + ${c.user_dict.display_name}'s Dashboard + + +
+ Hello World. +
+ + + diff --git a/ckan/templates/user/layout.html b/ckan/templates/user/layout.html index a61778d9d39..f0fbd5dcafd 100644 --- a/ckan/templates/user/layout.html +++ b/ckan/templates/user/layout.html @@ -8,6 +8,7 @@