Show top datasets cross-publisher. Drop-down for the publisher. Browser version numbers filtered on download, so you get this version in the CSV too - for privacy. single_popular_dataset now copes when not much data, and can return the figures so DGU can reskin it in its own repo. Notes about usage stats centralised to notes.html.
[ckanext-ga-report.git] / ckanext / ga_report / plugin.py
blob:a/ckanext/ga_report/plugin.py -> blob:b/ckanext/ga_report/plugin.py
--- a/ckanext/ga_report/plugin.py
+++ b/ckanext/ga_report/plugin.py
@@ -31,26 +31,7 @@
         }
 
     def after_map(self, map):
-        map.connect(
-            '/data/site-usage/publisher',
-            controller='ckanext.ga_report.controller:GaPublisherReport',
-            action='index'
-        )
-        map.connect(
-            '/data/site-usage/publisher_{month}.csv',
-            controller='ckanext.ga_report.controller:GaPublisherReport',
-            action='csv'
-        )
-        map.connect(
-            '/data/site-usage/publisher/{id}_{month}.csv',
-            controller='ckanext.ga_report.controller:GaPublisherReport',
-            action='publisher_csv'
-        )
-        map.connect(
-            '/data/site-usage/publisher/{id}',
-            controller='ckanext.ga_report.controller:GaPublisherReport',
-            action='read'
-        )
+        # GaReport
         map.connect(
             '/data/site-usage',
             controller='ckanext.ga_report.controller:GaReport',
@@ -61,6 +42,33 @@
             controller='ckanext.ga_report.controller:GaReport',
             action='csv'
         )
+
+        # GaDatasetReport
+        map.connect(
+            '/data/site-usage/publisher',
+            controller='ckanext.ga_report.controller:GaDatasetReport',
+            action='publishers'
+        )
+        map.connect(
+            '/data/site-usage/publishers_{month}.csv',
+            controller='ckanext.ga_report.controller:GaDatasetReport',
+            action='publisher_csv'
+        )
+        map.connect(
+            '/data/site-usage/dataset/datasets_{id}_{month}.csv',
+            controller='ckanext.ga_report.controller:GaDatasetReport',
+            action='dataset_csv'
+        )
+        map.connect(
+            '/data/site-usage/dataset',
+            controller='ckanext.ga_report.controller:GaDatasetReport',
+            action='read'
+        )
+        map.connect(
+            '/data/site-usage/dataset/{id}',
+            controller='ckanext.ga_report.controller:GaDatasetReport',
+            action='read_publisher'
+        )
         return map