From c9e8a6b5d92a74c594f3534dcd95980e2393fb64 Mon Sep 17 00:00:00 2001 From: John Glover Date: Tue, 29 Nov 2011 17:56:47 +0000 Subject: [PATCH] change summary page to use /dataset, not /package --- README.rst | 2 +- ckanext/googleanalytics/controller.py | 4 +--- ckanext/googleanalytics/plugin.py | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index d49ad61..64319f0 100644 --- a/README.rst +++ b/README.rst @@ -92,7 +92,7 @@ Installation Once your GA account has gathered some data, you can see some basic information about the most popular packages at: - http://mydomain.com/analytics/package/top + http://mydomain.com/analytics/dataset/top By default the only data that is injected into the public-facing website is on the package page, where number of downloads are diff --git a/ckanext/googleanalytics/controller.py b/ckanext/googleanalytics/controller.py index 4e68a5c..e226db8 100644 --- a/ckanext/googleanalytics/controller.py +++ b/ckanext/googleanalytics/controller.py @@ -1,11 +1,9 @@ import logging -from ckan.lib.base import * +from ckan.lib.base import BaseController, c, render import dbutil - log = logging.getLogger('ckanext.googleanalytics') - class GAController(BaseController): def view(self): # get package objects corresponding to popular GA content diff --git a/ckanext/googleanalytics/plugin.py b/ckanext/googleanalytics/plugin.py index 91112e8..1929ff0 100644 --- a/ckanext/googleanalytics/plugin.py +++ b/ckanext/googleanalytics/plugin.py @@ -93,7 +93,8 @@ class GoogleAnalyticsPlugin(SingletonPlugin): return stream def after_map(self, map): - map.connect('analytics', '/analytics/package/top', + map.redirect("/analytics/package/top", "/analytics/dataset/top") + map.connect('analytics', '/analytics/dataset/top', controller='ckanext.googleanalytics.controller:GAController', action='view') return map